Skip to content

Instantly share code, notes, and snippets.

@youyo
Last active February 24, 2017 06:14
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 youyo/48846ea087dcd81b618171ea0800a09c to your computer and use it in GitHub Desktop.
Save youyo/48846ea087dcd81b618171ea0800a09c to your computer and use it in GitHub Desktop.
awsauth = AWS4Auth(
os.environ['AWS_ACCESS_KEY_ID'],
os.environ['AWS_SECRET_ACCESS_KEY'],
os.environ['AWS_REGION'],
'es',
session_token=os.environ['AWS_SESSION_TOKEN']
)
client = Elasticsearch(
hosts=[{'host': 'xxxxxxxxx.region.es.amazonaws.com', 'port': 443}],
http_auth=awsauth,
use_ssl=True,
verify_certs=True,
connection_class=RequestsHttpConnection
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment