Sha256: 898574ce01e1773eb802fbf60fd87d28639946b2259323927493343b618601b5
Contents?: true
Size: 1.07 KB
Versions: 24
Compression:
Stored size: 1.07 KB
Contents
require 'cfndsl' CloudFormation { Description "Creates an AWS VPC with a couple of subnets." VPC(:VPC) { EnableDnsSupport true EnableDnsHostnames true CidrBlock "10.1.0.0/16" addTag("Name", "Test VPC") } InternetGateway(:InternetGateway) { addTag("Name", "Test VPC Gateway") } VPCGatewayAttachment(:GatewayToInternet) { VpcId Ref(:VPC) InternetGatewayId Ref(:InternetGateway) } 10.times do |i| subnet = "subnet#{i}" route_table = subnet + "RouteTable" route_table_assoc = route_table + "Assoc" Subnet(subnet) { VpcId Ref(:VPC) CidrBlock "10.1.#{i}.0/24" addTag("Name", "test vpc #{subnet}") } RouteTable(route_table) { VpcId Ref(:VPC) addTag("Name", route_table) } SubnetRouteTableAssociation(route_table_assoc) { SubnetId Ref(subnet) RouteTableId Ref(route_table) } Route(subnet + "GatewayRoute" ) { DependsOn :GatewayToInternet RouteTableId Ref(route_table) DestinationCidrBlock "0.0.0.0/0" GatewayId Ref(:InternetGateway) } end }
Version data entries
24 entries across 24 versions & 1 rubygems