Skip to content

Instantly share code, notes, and snippets.

@vkhatri
Created February 15, 2017 01:35
Show Gist options
  • Save vkhatri/80954eead0cb0482b3ffbc3444a80c95 to your computer and use it in GitHub Desktop.
Save vkhatri/80954eead0cb0482b3ffbc3444a80c95 to your computer and use it in GitHub Desktop.
Python Wrapper to Execute Transit VPC Push Cisco Config Module for Testing
# Module Source - https://github.com/vkhatri/aws-transit-vpc/tree/feature-vrf
# http://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
import ast
import logging
import sys
# symlink transit-vpc-poller.py module for import workaround
# ln -s transit-vpc-push-cisco-config.py transit_vpc_push_cisco_config.py
import transit_vpc_push_cisco_config
# Set Logging stream to STDOUT
logging.basicConfig(stream=sys.stdout)
# Event Object
event = {
"Records": [
{
"awsRegion": "us-east-1",
"s3": {
"bucket": {
"name": "transitvpc-vpnconfigs3bucket-suffix"
},
"object": {
"key": "vpnconfigs/CSR1/us-east-1-vpn-bbbbbbbb.conf"
}
}
}
]
}
# Initialize Minimal Context Object
class LambdaContext():
pass
context = LambdaContext()
# Call Lambda Handler
transit_vpc_push_cisco_config.lambda_handler(event, context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment