Skip to content

Instantly share code, notes, and snippets.

@alastairhm
Created November 20, 2018 14:17
Show Gist options
  • Save alastairhm/97c841d95c631102bb36e9817ab89516 to your computer and use it in GitHub Desktop.
Save alastairhm/97c841d95c631102bb36e9817ab89516 to your computer and use it in GitHub Desktop.
Get SSM parameter with boto3
import os
import sys
import json
import boto3
import logging
from botocore.vendored import requests
from botocore.exceptions import ClientError
ssm = boto3.client('ssm')
parameter = ssm.get_parameter(Name='/jenkins/jenkins_api_user', WithDecryption=True)
print(parameter['Parameter']['Value'])
parameter = ssm.get_parameter(Name='/jenkins/jenkins_api_token', WithDecryption=True)
print(parameter['Parameter']['Value'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment