-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSafepay-WorkerNode test.json
137 lines (127 loc) · 4.25 KB
/
Safepay-WorkerNode test.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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"eksclustername": {
"Type": "String",
"Default": "Safepay-EKS",
"Description": "Name of the EKS cluster."
},
"eksversion": {
"Type": "String",
"Default": "1.21"
},
"VPC": {
"Type": "AWS::EC2::VPC::Id",
"Description": "Name of an existing VPC in your Region"
},
"Privatesubnet1": {
"Type": "AWS::EC2::Subnet::Id",
"Description": "Select 1st Private Subnet fom your existing VPC"
},
"Privatesubnet2": {
"Type": "AWS::EC2::Subnet::Id",
"Description": "Select 2nd Private Subnet fom your existing VPC"
}
},
"Resources": {
"EKSSG": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"VpcId": {
"Ref": "VPC"
},
"GroupDescription": "SG For EKS"
}
},
"EKSCluster": {
"Type": "AWS::EKS::Cluster",
"Properties": {
"Name": {"Ref": "eksclustername"},
"Version": {
"Ref": "eksversion"
},
"RoleArn": "arn:aws:iam::678878256416:role/AWS-EKS-Demo",
"ResourcesVpcConfig": {
"SecurityGroupIds": [{"Ref":"EKSSG"}],
"SubnetIds": [{"Ref" : "Privatesubnet1"},
{"Ref" : "Privatesubnet2"}],
"EndpointPublicAccess": false,
"EndpointPrivateAccess": true
},
"Logging": {
"ClusterLogging": {
"EnabledTypes": [{
"Type": "api"
},
{
"Type": "audit"
}]
}} }
},
"egress1": {
"Type": "AWS::EC2::SecurityGroupEgress",
"Properties": {
"GroupId": {
"Ref": "EKSSG"
},
"IpProtocol": "-1",
"CidrIp": "0.0.0.0/0"
}
},
"Port80": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupId": {
"Ref": "EKSSG"
},
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "0.0.0.0/0"
}
},
"Port22": {
"Type": "AWS::EC2::SecurityGroupIngress",
"Properties": {
"GroupId": {
"Ref": "EKSSG"
},
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "0.0.0.0/0"
}
},
"EKSNodegroup": {
"Type": "AWS::EKS::Nodegroup",
"Properties": {
"ClusterName": {"Ref": "eksclustername"},
"NodeRole": "arn:aws:iam::678878256416:role/AWS-EKS-WorkerNode",
"ScalingConfig": {
"MinSize": 2,
"DesiredSize": 3,
"MaxSize": 5
},
"Labels": {
"Key1": "Value1",
"Key2": "Value2"
},
"Subnets": [{"Ref" : "Privatesubnet1"},
{"Ref" : "Privatesubnet2"}]
}
}
},
"Outputs": {
"eksclustername": {
"Value": {
"Ref": "EKSCluster"
},
"Description": "Name of the Eks cluster",
"Export": {
"Name": {
"Fn::Sub": "${AWS::StackName}-eksclustername"
}
}
}
}
}