in squid_app/vpc_stack.py [0:0]
def __init__(self, scope: core.Construct, id: str, vpc_cidr: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
# Create a VPC with 2 public and 2 isolated subnets across 2 availiability zones.
self.vpc = ec2.Vpc(self, "vpc",
max_azs=2,
cidr=vpc_cidr,
subnet_configuration=[ec2.SubnetConfiguration(
subnet_type=ec2.SubnetType.PUBLIC,
name="Public",
cidr_mask=24
),
ec2.SubnetConfiguration(
subnet_type=ec2.SubnetType.ISOLATED,
name="Isolated",
cidr_mask=24
)
]
)
core.CfnOutput(self, "output-vpc-id",
value=self.vpc.vpc_id)