Issue
I'm trying to give the EC2 instance created by my Cloudformation template a name.
Tags:
- Key: Name
- Value: "blah"
Results in the error "Key not found in Tags property". I see the key "Name" referenced in examples. Why can't I use it? Thanks
Solution
YAML treats each hyphen as indicating a new element in a list, so your definition translates to JSON looking like this:
{
"Tags": [
{"Key": "Name" },
{"Value": "blah" },
]
}
To fix, remove the hyphen before Value
:
Tags:
- Key: Name
Value: "blah"
Answered By - Parsifal Answer Checked By - David Marino (WPSolving Volunteer)