How to export parameters from aws parameter store and import into another account
I created a utility which does exactly what you want:
pip install aws-ssm-copy
aws-ssm-copy --dry-run --source-profile <source> --recursive /
Checkout the aws-ssm-copy utility and blog for more details.
- Retrieve all parameters via
aws ssm get-parameters-by-path --path "/relative/path/" --recursive
- Write the resulting JSON somewhere down - e.g. into a file
- Prepare put commands e.g. with JS
for (const value of params.Parameters) {
const { Name, Value } = value;
console.log(`aws ssm put-parameter --name "${Name}" --value "${Value}" --type "String"`);
}
May be get-parameters-by-path suits here:
aws ssm get-parameters-by-path --path "/" --recursive
https://docs.aws.amazon.com/cli/latest/reference/ssm/get-parameters-by-path.html#synopsis