Advertisement
Guest User

Untitled

a guest
Apr 26th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. AWSTemplateFormatVersion: "2010-09-09"
  2. Metadata:
  3. Generator: "former2"
  4. Description: ""
  5. Resources:
  6. EC2VPC:
  7. Type: "AWS::EC2::VPC"
  8. Properties:
  9. CidrBlock: "10.0.0.0/16"
  10. EnableDnsSupport: true
  11. EnableDnsHostnames: true
  12. InstanceTenancy: "default"
  13. Tags:
  14. -
  15. Key: "Name"
  16. Value: "my-canada-vpc"
  17.  
  18. EC2Subnet:
  19. Type: "AWS::EC2::Subnet"
  20. Properties:
  21. AvailabilityZone: !Sub "${AWS::Region}a"
  22. CidrBlock: "10.0.0.0/20"
  23. VpcId: !Ref EC2VPC
  24. MapPublicIpOnLaunch: false
  25. Tags:
  26. -
  27. Key: "Name"
  28. Value: !Sub "my-canada-subnet-public1-${AWS::Region}a"
  29.  
  30. EC2Subnet2:
  31. Type: "AWS::EC2::Subnet"
  32. Properties:
  33. AvailabilityZone: !Sub "${AWS::Region}b"
  34. CidrBlock: "10.0.16.0/20"
  35. VpcId: !Ref EC2VPC
  36. MapPublicIpOnLaunch: false
  37. Tags:
  38. -
  39. Key: "Name"
  40. Value: !Sub "my-canada-subnet-public2-${AWS::Region}b"
  41.  
  42. EC2Subnet3:
  43. Type: "AWS::EC2::Subnet"
  44. Properties:
  45. AvailabilityZone: !Sub "${AWS::Region}d"
  46. CidrBlock: "10.0.32.0/20"
  47. VpcId: !Ref EC2VPC
  48. MapPublicIpOnLaunch: false
  49. Tags:
  50. -
  51. Key: "Name"
  52. Value: !Sub "my-canada-subnet-public3-${AWS::Region}d"
  53.  
  54. EC2InternetGateway:
  55. Type: "AWS::EC2::InternetGateway"
  56. Properties:
  57. Tags:
  58. -
  59. Key: "Name"
  60. Value: "my-canada-igw"
  61.  
  62. EC2DHCPOptions:
  63. Type: "AWS::EC2::DHCPOptions"
  64. Properties:
  65. DomainName: !Sub "${AWS::Region}.compute.internal"
  66.  
  67. EC2VPCDHCPOptionsAssociation:
  68. Type: "AWS::EC2::VPCDHCPOptionsAssociation"
  69. Properties:
  70. DhcpOptionsId: !Ref EC2DHCPOptions
  71. VpcId: !Ref EC2VPC
  72.  
  73. EC2RouteTable:
  74. Type: "AWS::EC2::RouteTable"
  75. Properties:
  76. VpcId: !Ref EC2VPC
  77. Tags:
  78. -
  79. Key: "Name"
  80. Value: "my-canada-rtb-public"
  81.  
  82. EC2RouteTable2:
  83. Type: "AWS::EC2::RouteTable"
  84. Properties:
  85. VpcId: !Ref EC2VPC
  86.  
  87. EC2Route:
  88. Type: "AWS::EC2::Route"
  89. Properties:
  90. DestinationCidrBlock: "0.0.0.0/0"
  91. GatewayId: !Ref EC2InternetGateway
  92. RouteTableId: !Ref EC2RouteTable
  93.  
  94. EC2SubnetRouteTableAssociation:
  95. Type: "AWS::EC2::SubnetRouteTableAssociation"
  96. Properties:
  97. RouteTableId: !Ref EC2RouteTable
  98. SubnetId: !Ref EC2Subnet2
  99.  
  100. EC2SubnetRouteTableAssociation2:
  101. Type: "AWS::EC2::SubnetRouteTableAssociation"
  102. Properties:
  103. RouteTableId: !Ref EC2RouteTable
  104. SubnetId: !Ref EC2Subnet
  105.  
  106. EC2SubnetRouteTableAssociation3:
  107. Type: "AWS::EC2::SubnetRouteTableAssociation"
  108. Properties:
  109. RouteTableId: !Ref EC2RouteTable
  110. SubnetId: !Ref EC2Subnet3
  111.  
  112.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement