Use simulated AWS CLI commands to create a VPC, subnets in distinct Availability Zones, an internet gateway, route table, route, and associations.
Simulateur déterministe — tape une commande (help) pour commencer.
cloud@forge:~$
Objectifs
- Create a VPC with a /16 CIDR.
- Create two subnets in distinct Availability Zones.
- Attach an internet gateway.
- Create a default route and associate both subnets.
Indices
Voir la solution
aws ec2 create-vpc --cidr-block 10.40.0.0/16 aws ec2 create-subnet --vpc-id vpc-001 --cidr-block 10.40.1.0/24 --availability-zone eu-west-1a aws ec2 create-subnet --vpc-id vpc-001 --cidr-block 10.40.2.0/24 --availability-zone eu-west-1b aws ec2 create-internet-gateway aws ec2 attach-internet-gateway --internet-gateway-id igw-001 --vpc-id vpc-001 aws ec2 create-route-table --vpc-id vpc-001 aws ec2 create-route --route-table-id rtb-001 --destination-cidr-block 0.0.0.0/0 --gateway-id igw-001 aws ec2 associate-route-table --route-table-id rtb-001 --subnet-id subnet-001 aws ec2 associate-route-table --route-table-id rtb-001 --subnet-id subnet-002