Last active
August 1, 2016 03:04
-
-
Save ryan-lane/2b47ac3f23a83d11f66f481e657a6f13 to your computer and use it in GitHub Desktop.
Call to awseipext lambda with KMS auth token
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
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