Skip to content

Instantly share code, notes, and snippets.

@themegabyte
Last active June 27, 2023 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save themegabyte/3f0e9673ce9d07211aa8268b415b22ee to your computer and use it in GitHub Desktop.
Save themegabyte/3f0e9673ce9d07211aa8268b415b22ee to your computer and use it in GitHub Desktop.
AWS SSM Migration
aws ssm get-parameters-by-path --recursive --path "/CodeBuild/" --max-items 100
// Courtesy: https://stackoverflow.com/a/54787665/2432830
for (const value of params.Parameters) {
const { Name, Value } = value;
console.log(`aws ssm put-parameter --name "${Name}" --value "${Value}" --type "String"`);
}
{
"Parameters": [
{
"Name": "/CodeBuild/test-val",
"Type": "String",
"Value": "myval",
"Version": 1,
"LastModifiedDate": "xxx",
"ARN": "arn:aws:ssm:eu-north-1:000000000000:parameter/CodeBuild/test-val",
"DataType": "text"
},
{
"Name": "/CodeBuild/test-val",
"Type": "String",
"Value": "myval",
"Version": 1,
"LastModifiedDate": "xxx",
"ARN": "arn:aws:ssm:eu-north-1:000000000000:parameter/CodeBuild/test-val",
"DataType": "text"
},
{
"Name": "/CodeBuild/test-val",
"Type": "String",
"Value": "myval",
"Version": 1,
"LastModifiedDate": "xxx",
"ARN": "arn:aws:ssm:eu-north-1:000000000000:parameter/CodeBuild/test-val",
"DataType": "text"
},
{
"Name": "/CodeBuild/test-val",
"Type": "String",
"Value": "myval",
"Version": 1,
"LastModifiedDate": "xxx",
"ARN": "arn:aws:ssm:eu-north-1:000000000000:parameter/CodeBuild/test-val",
"DataType": "text"
},
{
"Name": "/CodeBuild/test-val",
"Type": "String",
"Value": "myval",
"Version": 1,
"LastModifiedDate": "xxx",
"ARN": "arn:aws:ssm:eu-north-1:000000000000:parameter/CodeBuild/test-val",
"DataType": "text"
},
{
"Name": "/CodeBuild/test-val",
"Type": "String",
"Value": "myval",
"Version": 1,
"LastModifiedDate": "xxx",
"ARN": "arn:aws:ssm:eu-north-1:000000000000:parameter/CodeBuild/test-val",
"DataType": "text"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment