This is the important part of my template:
Parameters:
EnvType:
Description: Environment type.
Type: String
AllowedValues:
- prod
- test
Mappings:
EnvDomain:
Primary:
prod: "prodexample.com"
test: "testexample.com"
The question I have is can I add a parameter (under "Parameters:" of course) that has a value defined by Mappings? It would look something like this:
DomainName:
Type: String
Default: !FindInMap ["EnvDomain", "Primary", "${EnvType}"
I'm not sure how to,Sub the EnvType in there? can !join be used or is this even possible?
From a semantic point of view i recommend the following:
Use a combination of parameters and mappings inside the resource section, eg
!Sub
- vpc-${myParam}-${myMapping}
- myParam: !Ref Parameter1
myMapping: !FindInMap [x, y, z]
The question I have is can I add a parameter (under "Parameters:" of course) that has a value defined by Mappings?
Sadly, you can't do this. Such functionality is not supported .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.