CfnResourceMetadataContext Class Added in v2.278.0
Manages resource-level CloudFormation Metadata Context.
| Source | core/lib/metadata-context.ts |
|---|---|
| Type last changed |
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 constructSelector: cdk.IConstructSelector;
const cfnResourceMetadataContext = cdk.CfnResourceMetadataContext.of(this, /* all optional props */ {
selector: constructSelector,
});
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
# construct_selector: cdk.IConstructSelector
cfn_resource_metadata_context = cdk.CfnResourceMetadataContext.of(self,
selector=construct_selector
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
IConstructSelector constructSelector;
CfnResourceMetadataContext cfnResourceMetadataContext = CfnResourceMetadataContext.of(this, CfnResourceMetadataContextOptions.builder()
.selector(constructSelector)
.build());
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;
IConstructSelector constructSelector;
var cfnResourceMetadataContext = CfnResourceMetadataContext.Of(this, new CfnResourceMetadataContextOptions {
Selector = constructSelector
});
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 constructSelector IConstructSelector
cfnResourceMetadataContext := cdk.CfnResourceMetadataContext_Of(this, &CfnResourceMetadataContextOptions{
Selector: constructSelector,
})
Methods
Removes Context from the selected resources.
of(scope: IConstruct, options?: CfnResourceMetadataContextOptions): CfnResourceMetadataContext // chainable@staticmethod def of(scope: IConstruct, options: typing.Optional[CfnResourceMetadataContextOptions] = None) -> CfnResourceMetadataContextpublic static CfnResourceMetadataContext of(IConstruct scope, CfnResourceMetadataContextOptions options)public static CfnResourceMetadataContext Of(IConstruct scope, CfnResourceMetadataContextOptions? options = null)func Of(Scope IConstruct, Options CfnResourceMetadataContextOptions) CfnResourceMetadataContext static #Returns the resource context API for a construct scope.
2 parameters
Parameters
scopescopescopescopeScope— The scope whose resources receive the context.optionsoptionsoptionsoptionsOptions— Resource selection options.
set(context: CfnResourceMetadataContextProps): voiddef set(self, context: CfnResourceMetadataContextProps) -> Nonepublic void set(CfnResourceMetadataContextProps context)public void Set(CfnResourceMetadataContextProps context)func Set(Context CfnResourceMetadataContextProps) #Replaces the complete Context value on the selected resources.
Includes resources added after this call.