coldsnap
coldsnap copied to clipboard
Support for Tags
I'm looking at using coldsnap as an input to my terraform codebase for deploying. I'm thinking about querying the uploaded snapshots with Terraform's snapshot data source, creating AMIs, and then using that as the input for launchconfigs. To make this work, it'd be interesting to have support for tagging snapshots to give more details for the snapshot data source.
I wonder if there are any opinions of if this is a good workflow in general? Perhaps there are other workflows that someone else here could suggest as an alternative?
Separately, would a PR implementing support for arbitrary tags be wanted?
Hi @grahamc, thanks for reaching out! That seems like a fine workflow to me. Regarding a PR, of course we always appreciate community engagement and contributions. Otherwise, I can discuss the feature request with the team.
Hey @jpculp, obviously (:)) I haven't sent a PR... I don't suppose you've discussed it with the team?
Hi @grahamc, no worries! I'll bring it up at our next team meeting.
In general where I'd hesitate would be if the feature would require calling other, non-EBS APIs.
However, it looks like the StartSnapshot API supports passing a list of tags, so I think this would largely be a matter of figuring out the right shape for the CLI and then how to get argh to deserialize that as a HashMap<String, String>.
My first instinct would be something like:
--tag foo --tag bar=baz
But that might be too restrictive or ambiguous given the allowed characters:
In general, the allowed characters are letters, numbers, spaces representable in UTF-8, and the following characters: _ . : / = + - @.
I'm not sure what the specific restrictions (if any) for snapshot tags are.
Maybe either of these:
--tag foo --tag bar,baz
--tag Key=foo Key=bar,Value=baz
With a preference for the first form, if commas aren't a valid character.
I don't have a stake in the design here, but I feel that sticking closer to the design used by aws cli (--tags Key=webserver,Value= Key=stack,Value=Production) may be good for consistency? Using a comma to separate the key from value would be surprising to me.
Since coldsnap is one of the projects supported by the Bottlerocket team at AWS, you're also welcome to show up at the Bottlerocket community meeting to chat about coldsnap usage if you'd like! Next meeting should be in a few weeks.