Created
February 15, 2017 01:35
-
-
Save vkhatri/80954eead0cb0482b3ffbc3444a80c95 to your computer and use it in GitHub Desktop.
Python Wrapper to Execute Transit VPC Push Cisco Config Module for Testing
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
# 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