CfnMappingProps Struct
Example
ts
const regionTable = new CfnMapping(this, 'RegionTable', {
mapping: {
'us-east-1': {
regionName: 'US East (N. Virginia)',
},
'us-east-2': {
regionName: 'US East (Ohio)',
},
},
lazy: true,
});
regionTable.findInMap('us-east-2', 'regionName');
python
region_table = CfnMapping(self, "RegionTable",
mapping={
"us-east-1": {
"region_name": "US East (N. Virginia)"
},
"us-east-2": {
"region_name": "US East (Ohio)"
}
},
lazy=True
)
region_table.find_in_map("us-east-2", "regionName")
java
CfnMapping regionTable = CfnMapping.Builder.create(this, "RegionTable")
.mapping(Map.of(
"us-east-1", Map.of(
"regionName", "US East (N. Virginia)"),
"us-east-2", Map.of(
"regionName", "US East (Ohio)")))
.lazy(true)
.build();
regionTable.findInMap("us-east-2", "regionName");
csharp
// Install: dotnet add package Amazon.CDK.Lib
var regionTable = new CfnMapping(this, "RegionTable", new CfnMappingProps {
Mapping = new Dictionary<string, IDictionary<string, object>> {
{ "us-east-1", new Dictionary<string, object> {
{ "regionName", "US East (N. Virginia)" }
} },
{ "us-east-2", new Dictionary<string, object> {
{ "regionName", "US East (Ohio)" }
} }
},
Lazy = true
});
regionTable.FindInMap("us-east-2", "regionName");
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
regionTable := awscdk.NewCfnMapping(this, jsii.String("RegionTable"), &CfnMappingProps{
Mapping: map[string]map[string]interface{}{
"us-east-1": map[string]interface{}{
"regionName": jsii.String("US East (N. Virginia)"),
},
"us-east-2": map[string]interface{}{
"regionName": jsii.String("US East (Ohio)"),
},
},
Lazy: jsii.Boolean(true),
})
regionTable.FindInMap(jsii.String("us-east-2"), jsii.String("regionName"))
Properties
mappingoptional{ [key: string]: { [key: string]: any } }mappingoptionaltyping.Mapping[str, typing.Mapping[str, Any]]mappingoptionalMap<String, Map<String, Object>>MappingoptionalIDictionary<string, IDictionary<string, object>>Mappingoptional*map[string]*map[string]interface{}#Mapping of key to a set of corresponding set of named values.
Default: No mapping.
notes
The key identifies a map of name-value pairs and must be unique within the mapping.
For example, if you want to set values based on a region, you can create a mapping that uses the region name as a key and contains the values you want to specify for each specific region.