Skip to content

Instantly share code, notes, and snippets.

@ryan-lane
Last active August 1, 2016 03:04
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 ryan-lane/2b47ac3f23a83d11f66f481e657a6f13 to your computer and use it in GitHub Desktop.
Save ryan-lane/2b47ac3f23a83d11f66f481e657a6f13 to your computer and use it in GitHub Desktop.
Call to awseipext lambda with KMS auth token
import json
import boto3
payload = {
'action': 'associate',
'resource': '52.0.0.1',
'instance_id': 'i-12345',
'username': username,
'token': token
}
payload_json = json.dumps(payload)
client = boto3.client('lambda')
response = client.invoke(
FunctionName='awseipext-production-iad',
InvocationType='RequestResponse',
LogType='Tail',
Payload=payload_json
)
print response['StatusCode']
print response['Payload'].read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment