Skip to content
v2.278.0

CfnTemplateMetadataContext Class Added in v2.278.0 ​

Manages template-level CloudFormation Metadata Context.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';

declare const stack: cdk.Stack;
const cfnTemplateMetadataContext = cdk.CfnTemplateMetadataContext.of(stack);
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

# stack: cdk.Stack

cfn_template_metadata_context = cdk.CfnTemplateMetadataContext.of(stack)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

Stack stack;

CfnTemplateMetadataContext cfnTemplateMetadataContext = CfnTemplateMetadataContext.of(stack);
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

Stack stack;

var cfnTemplateMetadataContext = CfnTemplateMetadataContext.Of(stack);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

var stack Stack

cfnTemplateMetadataContext := cdk.CfnTemplateMetadataContext_Of(stack)

Methods ​

clear(): voiddef clear(self, ) -> Nonepublic void clear()public void Clear()func Clear() #
Removes the template Context value.
of(stack: Stack): CfnTemplateMetadataContext // chainable@staticmethod def of(stack: Stack) -> CfnTemplateMetadataContextpublic static CfnTemplateMetadataContext of(Stack stack)public static CfnTemplateMetadataContext Of(Stack stack)func Of(Stack Stack) CfnTemplateMetadataContext static #
Returns the template context API for a stack.
1 parameter

Parameters

  • stackstackstackstackStack — The stack whose template receives the context.
set(context: CfnTemplateMetadataContextProps): voiddef set(self, context: CfnTemplateMetadataContextProps) -> Nonepublic void set(CfnTemplateMetadataContextProps context)public void Set(CfnTemplateMetadataContextProps context)func Set(Context CfnTemplateMetadataContextProps) #
Replaces the complete template Context value.

Values must be concrete because CloudFormation does not resolve intrinsic functions in template metadata.