Table of Contents

Class CfnMapping

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

Represents a CloudFormation mapping.

public class CfnMapping : CfnRefElement, IConstruct, IConstruct, IDependable
Inheritance
CfnMapping
Implements
IConstruct
Inherited Members

Examples

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)" }
                    } }
                }
            });

            regionTable.FindInMap(Aws.REGION, "regionName");

Remarks

ExampleMetadata: infused

Constructors

CfnMapping(Construct, string, ICfnMappingProps?)

public CfnMapping(Construct scope, string id, ICfnMappingProps? props = null)

Parameters

scope Construct
id string
props ICfnMappingProps

Methods

FindInMap(string, string)

public virtual string FindInMap(string key1, string key2)

Parameters

key1 string
key2 string

Returns

string

A reference to a value in the map based on the two keys.

SetValue(string, string, object)

Sets a value in the map based on the two keys.

public virtual void SetValue(string key1, string key2, object value)

Parameters

key1 string
key2 string
value object