-
Notifications
You must be signed in to change notification settings - Fork 0
/
wavelength-vpc.yaml
121 lines (113 loc) · 3.58 KB
/
wavelength-vpc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
AWSTemplateFormatVersion: 2010-09-09
Description: >-
You can create 2 subnets in the Wavelength zone and assign Carrier Gateway with this template.
Parameters:
VpcCidrBlock:
Description: 'CIDR value for Wavelength Network'
Type: String
MinLength: '9'
MaxLength: '18'
Default: 10.0.0.0/16
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
OriginCidrBlock:
Description: 'CIDR value of Origin'
Type: String
MinLength: '9'
MaxLength: '18'
Default: 10.0.1.0/24
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
EdgeCidrBlock:
Description: 'CIDR value of Edge'
Type: String
MinLength: '9'
MaxLength: '18'
Default: 10.0.2.0/24
AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
WavelengthZones:
Type: String
Description: ''
Default: us-east-1-wl1-bos-wlz-1
AllowedValues:
- us-east-1-wl1-atl-wlz-1
- us-east-1-wl1-bos-wlz-1
- us-east-1-wl1-chi-wlz-1
- us-east-1-wl1-dfw-wlz-1
- us-east-1-wl1-iah-wlz-1
- us-east-1-wl1-mia-wlz-1
- us-east-1-wl1-nyc-wlz-1
- us-east-1-wl1-was-wlz-1
- us-west-2-wl1-den-wlz-1
- us-west-2-wl1-las-wlz-1
- us-west-2-wl1-phx-wlz-1
- us-west-2-wl1-sfo-wlz-1
- us-west-2-wl1-sea-wlz-1
- ap-northeast-2-wl1-cjj-wlz-1
- ap-northeast-1-wl1-kix-wlz-1
- ap-northeast-1-wl1-nrt-wlz-1
- eu-west-2-wl1-lon-wlz-1
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances. If there is no value here, you must create an ssh key (EC2 > Key Pairs).
Type: 'AWS::EC2::KeyPair::KeyName'
MinLength: '1'
MaxLength: '255'
AllowedPattern: '[\x20-\x7E]*'
ConstraintDescription: can contain only ASCII characters.
Resources:
WavelengthVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidrBlock
EnableDnsHostnames: true
EnableDnsSupport: true
Tags:
- Key: Name
Value: !Sub ${AWS::StackName}-Wavelength-Vpc
OriginZone:
Type: AWS::EC2::Subnet
DependsOn: WavelengthVPC
Properties:
VpcId: !Ref WavelengthVPC
AvailabilityZone: !Ref WavelengthZones
CidrBlock: !Ref OriginCidrBlock
Tags:
- Key: Name
Value: !Sub ${AWS::StackName}-Wavelength-Origin-Subnet
EdgeZone:
Type: AWS::EC2::Subnet
DependsOn: WavelengthVPC
Properties:
VpcId: !Ref WavelengthVPC
AvailabilityZone: !Ref WavelengthZones
CidrBlock: !Ref EdgeCidrBlock
Tags:
- Key: Name
Value: !Sub ${AWS::StackName}-Wavelength-Edge-Subnet
CarrierDefaultGateway:
Type: AWS::EC2::CarrierGateway
Properties:
VpcId: !Ref WavelengthVPC
CarrierDefaultRouteTable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref WavelengthVPC
Tags:
- Key: Name
Value: !Sub ${AWS::StackName}-Wavelength-Route-Table
DefaultRoute:
Type: AWS::EC2::Route
DependsOn: CarrierDefaultGateway
Properties:
RouteTableId: !Ref CarrierDefaultRouteTable
CarrierGatewayId: !Ref CarrierDefaultGateway
DestinationCidrBlock: 0.0.0.0/0
SubnetRouteTableAssociationOrigin:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref CarrierDefaultRouteTable
SubnetId: !Ref OriginZone
SubnetRouteTableAssociationEdge:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref CarrierDefaultRouteTable
SubnetId: !Ref EdgeZone