Last active
March 29, 2019 19:43
-
-
Save trondhindenes/a3495b3efda47c27907d7438bfb3fa2e to your computer and use it in GitHub Desktop.
testing out the aws-cdk for Python
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
#Install pips: | |
#aws-cdk-cdk | |
#aws-cdk-aws-ec2 | |
import json | |
from aws_cdk import cdk | |
from aws_cdk import aws_ec2 | |
app = cdk.App() | |
stack = cdk.Stack(app, 'MyStack') | |
vpc = aws_ec2.VpcNetwork(id='hat', scope=stack, cidr='192.168.0.0/16') | |
subnet = aws_ec2.VpcSubnet(id='subnet1', scope=stack, cidr_block='192.168.0.0/24', | |
vpc_id=vpc.vpc_id, availability_zone='wakka') | |
template = app.synthesize_stack(stack_name='MyStack')['template'] | |
print(json.dumps(template, indent=4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment