'AWS - hot to store small .yml file as SSM Parameter?
could someone advise me what is the best way to store content of the .yml file in AWS Parameter store? So it can be retrieved and restored as an .yml file with a proper indentation.
For now, it seems that I may have to convert this .yml into json and then use another utility to convert json into string and only then I can save it. Is this the only way or exists also some more direct approach? Thank you
Solution 1:[1]
On the Linux command line in bash with AWS CLI 2.0.30 you can do:
(any sample .yml file from https://en.wikipedia.org/wiki/YAML)
$ aws ssm put-parameter --type String --name quickie-param --value "`cat sample.yml`"
stores the parameter. To get it:
$ aws ssm get-parameter --name quickie-param --query Parameter.Value --output text
This will output the .yml file the same way it went in.
Solution 2:[2]
I found trying to store a yml.j2 (jinja templated yaml file) that you get this when you aws ssm put-parameter:
failed to satisfy constraint: Parameter value can't nest another parameter. Do not use "{{}}" in the value.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | stdunbar |
| Solution 2 | user19112646 |
