1 Answer
- Newest
- Most votes
- Most comments
0
Hi,
You Select function is a step a the right direction but you should not use it directly in AvailabilityZone parameter of CFN.
Rather you should use same construct to create in AWS SSM a parameter holding the AZ and then have the AvailabilityZone parameter with a !Ref into it.
See https://docs.aws.amazon.com/fr_fr/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-parameter.html for details on how to configure SSM params
BTW, why don't you use the simple form of !Select described at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html ?
AvailabilityZone: !Select
- 0
- !GetAZs
Ref: 'AWS::Region'
Best,
Didier
Relevant content
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago
Thanks Didier for your reply,
however the "!Select 0 !GetAZs" will just get the first AZ in that region, but it will not take into account which AZ is used for the primary and which AZ was used for Multi-AZ standby since we can not specify those during creation and it gets selected randomly by AWS : https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html#USER_CreateDBInstance.Prerequisites.VPC.Manual