映射(Mappings)
更新时间:2024-09-25
下述内容即将下线,后续参考最新版本的映射信息。
映射(Mappings)
Mappings是一个 Key-Value 映射表。在模板的 Resources 和 Outputs 部分可以使用 Fn::FindInMap 内部函数,通过给出 Key 获取映射表的 Value。
语法
映射部分由 Key-Value 对组成。
示例
以下示例正确的映射
Plain Text
1{
2 "Mappings": {
3 "Mapping": {
4 "TestKey1": {
5 "TestValue1": "value1"
6 },
7 "TestKey2": {
8 "TestValue2": "value2"
9 },
10 "TestKey3": {
11 "TestValue3": "value3"
12 },
13 "TestKey4": {
14 "TestValue4": 1234
15 }
16 }
17 }
18}