-
Notifications
You must be signed in to change notification settings - Fork 4
/
ecs-cluster.yml
592 lines (560 loc) · 22.4 KB
/
ecs-cluster.yml
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
# For the future there is a better way to handle updating the ECS recommended ami updates. An example of it is here:
# https://github.com/aws-samples/ecs-refarch-cloudformation/blob/master/infrastructure/ecs-cluster.yaml#L32-L35
EcsAmiId:
Type: String
Description: ECS AMI id
EcsInstanceType:
Type: String
Description: ECS EC2 instance type
Default: t2.small
KeyName:
Type: String
Description: Name of existing EC2 KeyPair for SSH to servers
Default: devops
VpcId:
Type: AWS::EC2::VPC::Id
Description: VPC Id of existing VPC
# QA VpcId: vpc-c116d1bb
Default: vpc-9c9714f9
SubnetIds:
Type: List<AWS::EC2::Subnet::Id>
Description: List of existing VPC Subnet Ids
# QA subnets: "subnet-03540c8937acb1963,subnet-0dc2017d2cfe64e01"
Default: "subnet-7fb16326,subnet-09c2dd40"
AsgMaxSize:
Type: Number
Description: Maxium size of ECS Cluster Auto Scaler. To be safe this should be double
the current size so the rolling update has plenty of room to spin up new instances
AsgMinSize:
Type: Number
Description: Minium size of ECS Cluster Auto Scaler
AsgInitialSize:
Type: Number
Description: Initial desired size of ECS Cluster Auto Scaler. When doing a rolling update
this should be set to be the current size of the auto scaling group.
MinInstancesInServiceDuringUpdate:
Type: Number
Description: During a rolling update of the autoscaling group this value determines
how many instances should be kept up and running. It seems this number needs to be
large enough for ECS to keep all of the current services running. Otherwise the
instances are not terminated which prevents the rolling update from progressing as
the cloudformation rolling update code expects
EcsClusterName:
Type: String
Description: ECS Cluster Name
Environment:
Type: String
Description: Propigate this as a tag on created AWS resources
NewRelicLicenceKey:
Type: String
Description: Licence key to enable new relic server monitoring
IAMGroupsForSSH:
Type: String
Description: Comma seperated list of IAM Groups. Users in these groups that have
a ssh public key set in IAM will be able to ssh into the ec2 instances in the cluster
SSHScriptVersion:
Type: String
Description: tag or branch of https://github.com/concord-consortium/aws-ec2-ssh
which handles the accessing public keys for ssh users
Default: v1.3.0-cc.1
PortalDockerAuthData:
Type: String
Description: 'a json object with the configuration for docker hub. Something like :
{"https://index.docker.io/v1/":{"username":"[username]", "password":"[password]","email":"email@example.com"}}'
SSHAttemptsFailedAlarmThreshold:
Type: Number
Description: Threshold for number of failed SSH login attempts per minute to trigger a metric filter alarm
Default: 25
LambdaS3Bucket:
Type: String
# QA value: concordqa-devops
Default: concord-devops
Resources:
EcsSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: !Sub "ECS Allowed Ports - ${EcsClusterName}"
VpcId: !Ref "VpcId"
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '22'
ToPort: '22'
CidrIp: 0.0.0.0/0
Tags:
- Key: Contact
Value: scytacki
- Key: Environment
Value: !Ref 'Environment'
EcsInstanceRole:
Type: AWS::IAM::Role
Properties:
Policies:
- PolicyName: "cloudwatch-inline"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- cloudwatch:PutMetricData
Resource: "*"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Principal:
Service: "ec2.amazonaws.com"
Action: "sts:AssumeRole"
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role'
# this was taken from https://github.com/concord-consortium/aws-ec2-ssh/blob/master/showcase.yaml
SSHLocalRolePolicy:
Type: 'AWS::IAM::Policy'
Properties:
PolicyName: iam
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'iam:ListUsers'
- 'iam:GetGroup'
Resource: '*'
- Effect: Allow
Action:
- 'iam:ListSSHPublicKeys'
- 'iam:GetSSHPublicKey'
Resource: !Sub 'arn:aws:iam::${AWS::AccountId}:user/*'
- Effect: Allow
Action: 'ec2:DescribeTags'
Resource: '*'
Roles:
- !Ref EcsInstanceRole
EcsInstanceProfile:
Type: "AWS::IAM::InstanceProfile"
Properties:
Roles:
- !Ref EcsInstanceRole
CloudWatchLogsNotifications:
Type: AWS::SNS::Topic
SSHLogGroup:
Type: AWS::Logs::LogGroup
Properties:
# The retention period can only be one of many predefined number of days
# See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html#cfn-logs-loggroup-retentionindays
RetentionInDays: 120 # ~The duration of 1 trimester (~4 months)
# CloudWatch Metric Filters {{{
# Invalid SSH user attempt Metric Filter
InvalidUserMetricFilter:
Type: AWS::Logs::MetricFilter
Properties:
LogGroupName:
Ref: SSHLogGroup
# When a user tries to SSH with invalid username the next line is logged in the SSH log file:
# Apr 20 02:39:35 ip-172-31-63-56 sshd[17136]: Received disconnect from xxx.xxx.xxx.xxx: 11: [preauth]
FilterPattern: "[Mon, day, timestamp, ip, id, status = Invalid, ...]"
MetricTransformations:
- MetricValue: '1'
MetricNamespace: SSH
MetricName: sshInvalidUser
# }}}
# CloudWatch Alarms {{{
InvalidSSHUserAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmDescription: More than 10 SSH login attempts with invalid usernames have been made in the last minute
MetricName: sshInvalidUser
Namespace: SSH
Statistic: Sum # Sum of total failures in time window
Period: '60' # 60 seconds
EvaluationPeriods: '1'
Threshold: !Ref SSHAttemptsFailedAlarmThreshold
AlarmActions:
- Ref: CloudWatchLogsNotifications
ComparisonOperator: GreaterThanThreshold
# }}}
EcsInstanceLaunchConfig:
Type: AWS::AutoScaling::LaunchConfiguration
Metadata:
AWS::CloudFormation::Init:
configSets:
default:
- 01_setupCfnHup
- 02_config-amazon-cloudwatch-agent
- 03_restart_amazon-cloudwatch-agent
UpdateEnvironment:
- 02_config-amazon-cloudwatch-agent
- 03_restart_amazon-cloudwatch-agent
# Definition of JSON configuration of AmazonCloudWatchAgent, you can change the configuration below.
02_config-amazon-cloudwatch-agent:
files:
'/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json':
content: !Sub |
{
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/var/log/secure",
"log_group_name": "${SSHLogGroup}",
"log_stream_name": "{ip_address}_{instance_id}",
"timestamp_format": "%d/%b/%Y:%H:%M:%S",
"timezone": "Local"
}
]
}
}
},
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${!aws:AutoScalingGroupName}",
"ImageId": "${!aws:ImageId}",
"InstanceId": "${!aws:InstanceId}",
"InstanceType": "${!aws:InstanceType}"
},
"metrics_collected": {
"mem": {
"measurement": [
"mem_used_percent"
]
},
"swap": {
"measurement": [
"swap_used_percent"
]
}
}
}
}
# Invoke amazon-cloudwatch-agent-ctl to restart the AmazonCloudWatchAgent.
03_restart_amazon-cloudwatch-agent:
commands:
01_stop_service:
command: /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a stop
02_start_service:
command: /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s
# Cfn-hup setting, it is to monitor the change of metadata.
# When there is change in the contents of JSON file in the metadata section, cfn-hup will call cfn-init to restart the AmazonCloudWatchAgent.
01_setupCfnHup:
files:
'/etc/cfn/cfn-hup.conf':
content: !Sub |
[main]
stack=${AWS::StackId}
region=${AWS::Region}
interval=1
mode: '000400'
owner: root
group: root
'/etc/cfn/hooks.d/amazon-cloudwatch-agent-auto-reloader.conf':
content: !Sub |
[cfn-auto-reloader-hook]
triggers=post.update
path=Resources.EC2Instance.Metadata.AWS::CloudFormation::Init.02_config-amazon-cloudwatch-agent
action=/opt/aws/bin/cfn-init -v --stack ${AWS::StackId} --resource EcsInstanceLaunchConfig --region ${AWS::Region} --configsets UpdateEnvironment
runas=root
mode: '000400'
owner: root
group: root
'/lib/systemd/system/cfn-hup.service':
content: !Sub |
[Unit]
Description=cfn-hup daemon
[Service]
Type=simple
ExecStart=/opt/aws/bin/cfn-hup
Restart=always
[Install]
WantedBy=multi-user.target
commands:
01enable_cfn_hup:
command: !Sub |
systemctl enable cfn-hup.service
02start_cfn_hup:
command: !Sub |
systemctl start cfn-hup.service
Properties:
ImageId: !Ref "EcsAmiId"
InstanceType: !Ref "EcsInstanceType"
AssociatePublicIpAddress: true
# TODO need to look this up
IamInstanceProfile: !Ref EcsInstanceProfile
KeyName: !Ref "KeyName"
SecurityGroups: [ !Ref "EcsSecurityGroup" ]
UserData:
# NOTE the termination lambda fuction currently parses this UserData looking
# for the ECS_CLUSTER so the cluster name needs to not be in quotes
# a better approach in the future would be to pass an ENV var to the lambda
# function specifying the cluster
Fn::Base64: !Sub |
#!/usr/bin/env bash
echo ECS_CLUSTER=${EcsClusterName} >> /etc/ecs/ecs.config
echo ECS_ENGINE_AUTH_TYPE=docker >> /etc/ecs/ecs.config
echo ECS_ENGINE_AUTH_DATA='${PortalDockerAuthData}' >> /etc/ecs/ecs.config
rpm -Uvh https://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
# Install the CloudFormation package
yum install -y aws-cfn-bootstrap newrelic-sysmond git aws-cli
# Install Amazon CloudWatch Agent by downloading and installing a RPM package for the following S3 URL:
sudo rpm -Uvh https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
# Run CloudFormation helper Init script (cfn-init) which executes the "AWS::CloudFormation::Init" defined above in "EcsInstanceLaunchConfig"."Metadata"
# See:
# - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html#cfn-helper-scripts-reference-amazon-amis
# - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-helper-scripts-reference.html#cfn-helper-scripts-reference-latest-version
# /opt/aws/bin/cfn-init --verbose --stack 'arn:aws:cloudformation:us-east-1:612297603577:stack/staging-cluster/5e44d5e0-002c-11e7-8b52-500c286f3262' --resource EcsInstanceLaunchConfig --region us-east-1 --configsets default
sudo /opt/aws/bin/cfn-init --verbose --stack ${AWS::StackId} --resource EcsInstanceLaunchConfig --region ${AWS::Region} --configsets default
nrsysmond-config --set license_key=${NewRelicLicenceKey}
service newrelic-sysmond start
groupadd -r docker
usermod -a -G docker newrelic
service docker restart
service newrelic-sysmond restart
# Setup iam ssh access
tmpdir=$(mktemp -d)
cd "$tmpdir"
git clone --branch ${SSHScriptVersion} --depth 1 https://github.com/concord-consortium/aws-ec2-ssh
cd aws-ec2-ssh
sudo ./install.sh -i "${IAMGroupsForSSH}" -s "${IAMGroupsForSSH}"
# Notify CloudFormation
/opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EcsInstanceAutoScaleGroup --region ${AWS::Region}
EcsInstanceAutoScaleGroup:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
VPCZoneIdentifier: !Ref "SubnetIds"
LaunchConfigurationName: !Ref "EcsInstanceLaunchConfig"
MetricsCollection:
- Granularity: "1Minute"
MinSize: !Ref AsgMinSize
MaxSize: !Ref AsgMaxSize
DesiredCapacity: !Ref "AsgInitialSize"
NotificationConfigurations:
- TopicARN: !Ref "AutoScaleSNSTopic"
NotificationTypes:
- autoscaling:EC2_INSTANCE_LAUNCH
- autoscaling:EC2_INSTANCE_LAUNCH_ERROR
- autoscaling:EC2_INSTANCE_TERMINATE
- autoscaling:EC2_INSTANCE_TERMINATE_ERROR
Tags:
- Key: Contact
Value: scytacki
PropagateAtLaunch: true
- Key: Environment
Value: !Ref "Environment"
PropagateAtLaunch: true
- Key: Name
Value: !Sub "ECS ${EcsClusterName}"
PropagateAtLaunch: true
- Key: Description
Value: !Sub |
This instance is the part of an Auto Scaling group for an ECS cluster. These
resources were all created by the Cloud Formation stack ${AWS::StackName}
PropagateAtLaunch: true
# A rolling update is needed so the autoscaler uses the termination lifecycle of the
# instances. That way the lambda function can move the tasks to the new instance.
UpdatePolicy:
AutoScalingRollingUpdate:
MinSuccessfulInstancesPercent: "80"
# this will make it wait on the cfn-signal above before marking the instance
# as successful
WaitOnResourceSignals: true
# Increase the batch size so this completes faster
MaxBatchSize: "3"
MinInstancesInService: !Ref MinInstancesInServiceDuringUpdate
PauseTime: PT5M
SuspendProcesses:
- AlarmNotification
- ScheduledActions
- HealthCheck
- ReplaceUnhealthy
- AZRebalance
AutoScalingScheduledAction:
IgnoreUnmodifiedGroupSizeProperties: 'true'
EcsCluster:
Type: "AWS::ECS::Cluster"
Properties:
ClusterName: !Ref "EcsClusterName"
# taken from: https://github.com/awslabs/ecs-cid-sample
SNSLambdaRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: [autoscaling.amazonaws.com]
Action: [ "sts:AssumeRole" ]
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AutoScalingNotificationAccessRole
Path: "/"
# taken from: https://github.com/awslabs/ecs-cid-sample
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
Policies:
- PolicyName: "lambda-inline"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- autoscaling:CompleteLifecycleAction
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
- ec2:DescribeInstances
- ec2:DescribeInstanceAttribute
- ec2:DescribeInstanceStatus
- ec2:DescribeHosts
- ecs:ListContainerInstances
- ecs:SubmitContainerStateChange
- ecs:SubmitTaskStateChange
- ecs:DescribeContainerInstances
- ecs:UpdateContainerInstancesState
- ecs:ListTasks
- ecs:DescribeTasks
- sns:Publish
- sns:ListSubscriptions
Resource: "*"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service: [lambda.amazonaws.com]
Action: [ "sts:AssumeRole" ]
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AutoScalingNotificationAccessRole
Path: "/"
# taken from: https://github.com/awslabs/ecs-cid-sample
AutoScaleSNSTopic:
Type: AWS::SNS::Topic
Properties:
Subscription:
- Endpoint: !GetAtt [AutoScaleLambdaFunction, Arn]
Protocol: lambda
DependsOn: AutoScaleLambdaFunction
# taken from: https://github.com/awslabs/ecs-cid-sample
AutoScaleLambdaFunction:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: !Ref LambdaS3Bucket
S3Key: "ecs-autoscale-lamba/index.zip"
Description: Lambda code for the autoscaling hook triggers invoked when autoscaling events of launching and terminating instance occur
Handler: "index.lambda_handler"
Role: !GetAtt [LambdaExecutionRole, Arn]
Runtime: "python2.7"
Timeout: "300"
LambdaInvokePermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref AutoScaleLambdaFunction
Action: lambda:InvokeFunction
Principal: sns.amazonaws.com
SourceArn: !Ref AutoScaleSNSTopic
AutoScaleTerminateHook:
Type: AWS::AutoScaling::LifecycleHook
Properties:
AutoScalingGroupName: !Ref EcsInstanceAutoScaleGroup
DefaultResult: ABANDON
HeartbeatTimeout: "900"
LifecycleTransition: autoscaling:EC2_INSTANCE_TERMINATING
NotificationTargetARN: !Ref AutoScaleSNSTopic
RoleARN: !GetAtt [SNSLambdaRole, Arn]
DependsOn: AutoScaleSNSTopic
# autoscaling rules and setup
# we might want to change this to stepadjustments instead of just a simple
# scaling adjustment
CPUReservationScaleUpPolicy:
Type: AWS::AutoScaling::ScalingPolicy
Properties:
AdjustmentType: ChangeInCapacity
AutoScalingGroupName: !Ref EcsInstanceAutoScaleGroup
# Step scaling skips any cooldown period. As long as the difference between the
# desired capacity and the current capacity matches the scaling adjustment then no
# new scaling action will be taken.
PolicyType: StepScaling
# give the instance a minute before it is part of the total metrics, I believe
# this also delays the start of future scaleup events. We aren't using the
# autoscaler's metrics though, we are using the ECS cluster metric which will update
# instantly as soon as the instance registers itself with ECS.
EstimatedInstanceWarmup: '60'
StepAdjustments:
# from 66% to 76% scale up by one
- MetricIntervalLowerBound: 0
MetricIntervalUpperBound: 10
ScalingAdjustment: '1'
# from 76% to 100% scale up by two
- MetricIntervalLowerBound: 10
ScalingAdjustment: '2'
CPUReservationHighAlert:
Type: AWS::CloudWatch::Alarm
Properties:
EvaluationPeriods: '1'
Statistic: Maximum
# CPU reservation is across the whole cluster, so with a period of 60 the max, min
# and average will all be the same. There is no built in way to get per instance
# CPUReservation. If we had that it would give us better
# flexibilty if we have a hetrogenous set of tasks running.
Threshold: '66'
Period: '60'
AlarmActions:
- !Ref CPUReservationScaleUpPolicy
Dimensions:
- Name: ClusterName
Value: !Ref EcsCluster
ComparisonOperator: GreaterThanOrEqualToThreshold
MetricName: CPUReservation
Namespace: AWS/ECS
CPUReservationScaleDownPolicy:
Type: AWS::AutoScaling::ScalingPolicy
Properties:
AdjustmentType: ChangeInCapacity
AutoScalingGroupName: !Ref EcsInstanceAutoScaleGroup
# Step scaling skips any cooldown period. As long as the difference between the
# desired capacity and the current capacity matches the scaling adjustment then no
# new scaling action will be taken. This seems to cause problems for us because the
# the CPUReservation does not update instantly, which leads to a second
# incorrect scale down. However because there is no cooldown period this problem
# is corrected quickly as long as the extra decrease causes a scale up alarm.
PolicyType: StepScaling
StepAdjustments:
- MetricIntervalUpperBound: 0
ScalingAdjustment: '-1'
CPUReservationLowAlert:
Type: AWS::CloudWatch::Alarm
Properties:
EvaluationPeriods: '5'
Statistic: Average
Threshold: '40'
Period: '60'
AlarmActions:
- !Ref CPUReservationScaleDownPolicy
Dimensions:
- Name: ClusterName
Value: !Ref EcsCluster
ComparisonOperator: LessThanOrEqualToThreshold
MetricName: CPUReservation
Namespace: AWS/ECS
Outputs:
ClusterName:
Description: The name of the cluster created here
Value: !Ref EcsClusterName
Export:
Name: !Sub "${AWS::StackName}-ClusterName"
ClusterSecurityGroupId:
Description: EC2 Security group id of the EC2 instances in the cluster
Value: !Ref EcsSecurityGroup
Export:
Name: !Sub "${AWS::StackName}-ClusterSecurityGroupId"
ClusterSubnets:
Description: Vpc Subnets used by the cluster
Value: !Join [ ',', !Ref SubnetIds]
Export:
Name: !Sub "${AWS::StackName}-ClusterSubnets"
ClusterVpcId:
Value: !Ref VpcId
Export:
Name: !Sub "${AWS::StackName}-ClusterVpcId"