CloudFormation: Template Error: Each Ref Object Must Have One String Value

I am trying to create a CloudFormation stack and I am getting the following error:

Client error (ValidationError) occurred while calling CreateStack operation: Template error: Each Ref object must have one String value.

However, when I grep the pattern looking for objects Ref

, they are all strings except for one search which looks like

"Ref": {
     "Fn::FindInMap": [
         "InfraMap",
         "SecurityGroups",
         "NATSecurityGroup"
     ]
}

      

The value for this link "NATSecurityGroup": "sg-54e6be30",

which seems OK to me.

Any other thoughts on what this error might be referring to?

+3


source to share


1 answer


"Ref": {
     "Fn::FindInMap": [
         "InfraMap",
         "SecurityGroups",
         "NATSecurityGroup"
     ]
}

      

This is not correct, Ref

not required in this case, where the value it refers to is a constant and not a variable created during stack creation.

Replacing it



"Fn::FindInMap": [
     "InfraMap",
     "SecurityGroups",
     "NATSecurityGroup"
]

      

Eliminates the problem.

+5


source







All Articles