Skip to content

Instantly share code, notes, and snippets.

@riponbanik
Created March 1, 2021 03:31
Show Gist options
  • Save riponbanik/8c48bc64d4ca27869bb6d9677ad03a85 to your computer and use it in GitHub Desktop.
Save riponbanik/8c48bc64d4ca27869bb6d9677ad03a85 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from aws_cdk import (
core,
aws_ec2 as ec2
)
app = core.App()
vpc = ec2.Vpc.from_lookup(self,
id="MyVPC",
is_default=False,
vpc_name='my-vpc')
vpc_subnets=vpc.select_subnets(subnet_type=ec2.SubnetType.PRIVATE)
subnet_id=vpc_subnets.subnets[0].subnet_id
print(subnet_id)
MyStack(app,my-stack)
app.synth()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment