2021年1月14日星期四

Template Error: Every default member must be a string Coludformation yml

I am trying to build my cloudformation script using yml and i think it came out good. But, when i try to create a new stack using this file, it gives Template Error: Every default member must be a string. I searched for this error and tried multiple things but no luck. Could you please provide your inputs if i am missing anything in the syntax. Below is the what i added in the yml file.

Basically, i have a 2 parameters AccountAccessKey and AccountName which have one value for non-prod and other for prod and i am trying to get that values dynamically by defining a map and usingthem in the parameters section. After, i am calling them using $AccountAccessKey and $AccountName in the 3rd section.

Any inputs would be appreciated. Thanks in advance

  AccountAccessKey:      Description: AccountAccessKey      Type: String      Default: !FindInMap [ AccountAccessKeyMap, !Ref "AWS::Region", !Ref Environment ]      AccountName:      Description: AccountName      Type: String      Default: !FindInMap [ AccountNameMap, !Ref "AWS::Region", !Ref Environment ]       AccountAccessKeyMap:      us-east-1:        dev: asdfsfsfasd4        qa:  asdfsfsfasd4        prod: 88yuuiuyiui      us-west-2:        dev: asdfsfsfasd4        qa:  asdfsfsfasd4        prod: 88yuuiuyiui      AccountNameMap:      us-east-1:        dev: nonprod        qa:  nonprod        prod: prod1      us-west-2:        dev: nonprod        qa:  nonprod        prod: prod1                    "/usr/dev/agent/conf/info.xml":                 content:                    Fn::Sub:                       - |                          <?xml version="1.0" encoding="UTF-8"?>                          <controller-info>                          <account-access-key>${AccountAccessKey}</account-access-key>                          <account-name>${AccountName}</account-name>                                                                      </controller-info>                       - {Server: !FindInMap [ ServerMap, !Ref "AWS::Region", !Ref Environment ]}  
https://stackoverflow.com/questions/65729987/template-error-every-default-member-must-be-a-string-coludformation-yml January 15, 2021 at 11:12AM

没有评论:

发表评论