简体   繁体   中英

ARN structure in Cloud formation template for AWS GovClouds

I have an offering on AWS for different regions. But for GovCloud regions ARN structure is different from normal ones. As we use ARN, normal deployment is failing in Gov regions. For this I have added a check whether region name is Gov region or not. But I had to hardcode the regions name. Is there any generalize conditions to check present region is a Gov region in CFT?

When deploying into another AWS partition (Gov Cloud or China), I would recommend using the pseduo parameter ${AWS::Partition}, for example

arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment

would look like

!Sub arn:${AWS::Partition}:elasticbeanstalk:${AWS::Region}:${AWS::AccountId}:environment/My App/MyEnvironment

Those pseduo params will be substituted based on the partition/region/account you are in.

Further reading on pseudo parameters here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM