Skip to content

Instantly share code, notes, and snippets.

@avi202020
Forked from riponbanik/app.py
Created November 21, 2022 10:27
Show Gist options
  • Save avi202020/cf8e04f3909c5431fa6ad1ea017cdc51 to your computer and use it in GitHub Desktop.
Save avi202020/cf8e04f3909c5431fa6ad1ea017cdc51 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