Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Resources:
- Vpc:
- Type: AWS::EC2::VPC
- DeletionPolicy: Retain
- Properties:
- CidrBlock: !Ref VpcCidr
- EnableDnsSupport: 'true'
- EnableDnsHostnames: 'true'
- PubSubnetAz1:
- Type: AWS::EC2::Subnet
- DeletionPolicy: Retain
- Properties:
- VpcId: !Ref Vpc
- CidrBlock: !Ref SubnetCidr1
- AvailabilityZone: !Select [0, !Split [",", !Ref AvailabilityZones] ]
- MapPublicIpOnLaunch: true
- PubSubnetAz2:
- Type: AWS::EC2::Subnet
- DeletionPolicy: Retain
- Properties:
- VpcId: !Ref Vpc
- CidrBlock: !Ref SubnetCidr2
- AvailabilityZone: !Select [1, !Split [",", !Ref AvailabilityZones] ]
- MapPublicIpOnLaunch: true
- InternetGateway:
- Type: AWS::EC2::InternetGateway
- DeletionPolicy: Retain
- AttachGateway:
- Type: AWS::EC2::VPCGatewayAttachment
- DeletionPolicy: Retain
- Properties:
- VpcId: !Ref Vpc
- InternetGatewayId: !Ref InternetGateway
- RouteViaIgw:
- Type: AWS::EC2::RouteTable
- DeletionPolicy: Retain
- Properties:
- VpcId: !Ref Vpc
- PublicRouteViaIgw:
- Type: AWS::EC2::Route
- DeletionPolicy: Retain
- DependsOn: AttachGateway
- Properties:
- RouteTableId: !Ref RouteViaIgw
- DestinationCidrBlock: 0.0.0.0/0
- GatewayId: !Ref InternetGateway
- PubSubnet1RouteTableAssociation:
- Type: AWS::EC2::SubnetRouteTableAssociation
- DeletionPolicy: Retain
- Properties:
- SubnetId: !Ref PubSubnetAz1
- RouteTableId: !Ref RouteViaIgw
- PubSubnet2RouteTableAssociation:
- Type: AWS::EC2::SubnetRouteTableAssociation
- DeletionPolicy: Retain
- Properties:
- SubnetId: !Ref PubSubnetAz2
- RouteTableId: !Ref RouteViaIgw
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement