If you’re like me and HATE JSON…
I loathed grammer tree’s in school, and if there is one twisted curly bracketed hell that reminds me of them — it’s JSON. I’m a spacial relations kinda guy; You can give me YAML anyday of the week.
So this isn’t a huge post, but hopefully if you are starting off with AWS EC2 Systems Management Services, and you have an automation document with SecurityGroupIds here is a JSON formatting tip that will help you out:
The SecurityGroupIds input uses a string array, and the AWS Systems Management Service documentation doesn’t give you one example of how the heck to format it, OR that it must be an array — even if you have one value to pass.
So it’s basic JSON, but to those of us that hate the curly-bracketed-comma-obsessed-Rainman of template languages, here is the cheat sheet:
See the “SecurityGroupIds” call out at the end of the simple little example script above? Basically you start the call out as
This is a bit different than how it’s called out in CloudFormation Template — I got odd behavior when I ran it out on a single line, but you can give it a try if you’d like.
Again, to JSON script monkeys out there, this is a no brainer — but it’s a brain twister to those of us that hate this languge or are trying to learn it. I wish AWS would of tossed in one example to speed me along. Here is all they say about it:
The IDs of the security groups for the instance.
Helpful huh? The killer here was the mental hangup that I only wanted to specify ONE group, not a list. Well, it’s an army of one or nothing.
So there yah go — a little tidbit for Friday. It won’t help 90% of the folks out there, but that one poor sole scouring the Interwebs to no avail — this one is for you.