AWS CloudFormation Defaults

What would be a good strategy for the defaults for mappings?

those.

I have a parameter country

Based on this country, I refer to DNS using mappings

"Mappings" : {
   "DNS":{
     "us" : {"dns" : "mypage.us.com", "ttl" : "600"},
     "mx" : {"dns" : "mypage.default.com", "ttl" : "300"},
     "ar" : {"dns" : "mypage.default.com", "ttl" : "300"},
     "br" : {"dns" : "mypage.default.com", "ttl" : "300"}
   }
}

If usit was displayed:

{ "Fn::FindInMap" : [ "DNS", { "Ref" : "country" }, "dns" ]}

I get "mypage.us.com"for other countries in which I created a huge list of countries with a default value mypage.default.com, in the future these values ​​will change, and we will add more countries, is there a better approach to this?

+4
source share
2 answers

, , - Fn::If . Fn::If Fn::FindInMap, Fn::FindInMap , .

- ( ecs ):

Conditions:
  IsT2Micro: !Equals [!Ref InstanceType, "t2.micro"]
  IsT2Small: !Equals [!Ref InstanceType, "t2.small"]
  ...

taskdefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      ...
      Memory: !If [ IsT2Micro, 900, !If [ IsT2Small, 1900, !Ref "AWS::NoValue"]]
+1

Cloud Formation AWS . , , , DNS . , DynamoDB . "" DynamoDB .

Cloud Formation Lambda, DynamoDB, DNS , JSON .

-3

All Articles