Last active
August 14, 2017 13:59
-
-
Save mlbiam/858a32d0ecc4bc2c520f695d41989440 to your computer and use it in GitHub Desktop.
pull_secrets.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import boto3 | |
import sys | |
out_to = open(sys.argv[2],"w") | |
client = boto3.client('ssm') | |
response = client.get_parameters_by_path(Path=sys.argv[1],Recursive=True,WithDecryption=True) | |
for r in response['Parameters']: | |
out_to.write(r['Name'][r['Name'].rfind('/')+1:] + '=' + r['Value'] + '\n') | |
out_to.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment