on my first aws account I have parameters specified in the following manner:
/config/a => value1
/config/b => value2
/config/c/a => value31
/config/c/b => value32
I want to move these to my second aws account.
I created these parameters in the parameter store manually.
How could I easily copy these values from one account to the other?
Using aws ssm get-parameters --names "<param-name>"
would be a bit too difficult, since I have way too many parameters.
aws ssm get-parameters-by-path --path "/relative/path/" --recursive
for (const value of params.Parameters) {
const { Name, Value } = value;
console.log(`aws ssm put-parameter --name "${Name}" --value "${Value}" --type "String"`);
}
Here is my version that outputs all parameters' Name
, Type
and Value
in a TSV (tab-separated values) format:
aws ssm get-parameters-by-path --path "/" --recursive --query="Parameters[*].[Name, Type, Value]" --output text
Example response:
/prod/aaa String xxx
/prod/bbb String yyy
/prod/ccc String zzz
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With