Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mlbiam
Last active August 14, 2017 13:59
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 mlbiam/858a32d0ecc4bc2c520f695d41989440 to your computer and use it in GitHub Desktop.
Save mlbiam/858a32d0ecc4bc2c520f695d41989440 to your computer and use it in GitHub Desktop.
pull_secrets.py
#!/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