CloudFormation nested region

Viewed 73

In a part of the CloudFormation script, how can I add the region name to be taken automatically?

"AllowedOrigins" : [
    "http://localhost:5002",
    { "Fn::Join" : ["", ["http://", { "Ref" : "webAppBucketName" } , ".s3-website-us-east-1.amazonaws.com" ]]}
],

Instead of the us-east-1

1 Answers

Ok, got it. You can use AWS::Region

{ "Fn::Join" : ["", ["http://", { "Ref" : "webAppBucketName" } , { "Fn::Join" : ["", [".s3-website-", { "Ref" : "AWS::Region" } , ".amazonaws.com" ]]} ]]}
Related