This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcf.json
191 lines (166 loc) · 4.93 KB
/
cf.json
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Resources for mosql-example.",
"Parameters": {
"LocalIP": {
"Description": "Your local IP address.",
"Type": "String",
"AllowedPattern": "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$",
"MinLength": 8,
"MaxLength": 16,
"ConstraintDescription": "Must be a valid IP address."
},
"ChartioIP": {
"Description": "Chartio's IP address.",
"Type": "String",
"AllowedPattern": "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$",
"MinLength": 8,
"MaxLength": 16,
"ConstraintDescription": "Must be a valid IP address.",
"Default": "173.203.96.249"
},
"KeyName": {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to workers",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription" : "Must be the name of an existing EC2 KeyPair."
}
},
"Mappings" : {
"AWSRegion2AMI" : {
"us-east-1" : { "AMI": "ami-21630d44" },
"us-west-2" : { "AMI": "ami-cf3c21ff" },
"eu-west-1" : { "AMI": "ami-9d2f0fea" },
"eu-central-1" : { "AMI": "ami-6265657f" },
"ap-southeast-1" : { "AMI": "ami-96c2c8c4" },
"ap-southeast-2" : { "AMI": "ami-f32b64c9" },
"ap-northeast-1" : { "AMI": "ami-0841ca08" }
}
},
"Resources": {
"VPC": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "10.0.0.0/16",
"EnableDnsSupport": true,
"EnableDnsHostnames": true,
"InstanceTenancy": "default",
"Tags": [ {
"Key": "Name",
"Value": { "Fn::Join" : [ "-", [ { "Ref": "AWS::StackName" }, "VPC" ] ] }
} ]
}
},
"InternetGateway": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {
"Tags": [ {
"Key": "Name",
"Value": { "Fn::Join" : [ "-", [ { "Ref": "AWS::StackName" }, "InternetGateway" ] ] }
} ]
}
},
"InternetGatewayAttachment": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": { "Ref": "VPC" },
"InternetGatewayId": { "Ref": "InternetGateway" }
}
},
"Subnet": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"AvailabilityZone": {
"Fn::Select": [ 0, { "Fn::GetAZs": { "Ref": "AWS::Region" } } ]
},
"CidrBlock": "10.0.0.0/24",
"Tags": [ {
"Key": "Name",
"Value": { "Fn::Join" : [ "-", [ { "Ref": "AWS::StackName" }, "Subnet" ] ] }
} ],
"VpcId": { "Ref": "VPC" }
}
},
"RouteTable": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": { "Ref": "VPC" },
"Tags": [ {
"Key": "Name",
"Value": { "Fn::Join" : [ "-", [ { "Ref": "AWS::StackName" }, "RouteTable" ] ] }
} ]
}
},
"RouteTableRoute": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": { "Ref": "RouteTable" },
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": { "Ref": "InternetGateway" }
}
},
"RouteTableSubnetAssociation": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": { "Ref": "RouteTable" },
"SubnetId": { "Ref": "Subnet" }
}
},
"SecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Security group for mosql-example.",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": 22,
"ToPort": 22,
"CidrIp": { "Fn::Join": [ "", [ { "Ref": "LocalIP" }, "/32" ] ] }
},
{
"IpProtocol": "tcp",
"FromPort": 5432,
"ToPort": 5432,
"CidrIp": { "Fn::Join": [ "", [ { "Ref": "LocalIP" }, "/32" ] ] }
},
{
"IpProtocol": "tcp",
"FromPort": 5432,
"ToPort": 5432,
"CidrIp": { "Fn::Join": [ "", [ { "Ref": "ChartioIP" }, "/32" ] ] }
}
],
"SecurityGroupEgress": [
{
"IpProtocol": "tcp",
"FromPort": 0,
"ToPort": 65535,
"CidrIp": "0.0.0.0/0"
}
],
"Tags": [ {
"Key": "Name",
"Value": { "Fn::Join" : [ "-", [ { "Ref": "AWS::StackName" }, "SecurityGroup" ] ] }
} ],
"VpcId": { "Ref": "VPC" }
}
}
},
"Outputs": {
"SubnetId": {
"Description": "Subnet id",
"Value": { "Ref": "Subnet" }
},
"SubnetAvailabilityZone": {
"Description": "Subnet availability zone",
"Value": { "Fn::GetAtt": [ "Subnet", "AvailabilityZone" ] }
},
"SecurityGroupId": {
"Description": "Security group id",
"Value": { "Ref": "SecurityGroup" }
},
"AMI": {
"Description": "AMI",
"Value": { "Fn::FindInMap" : [ "AWSRegion2AMI", { "Ref" : "AWS::Region" }, "AMI" ] }
}
}
}