-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.json
55 lines (51 loc) · 1.69 KB
/
sample.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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "[Network] Kafka",
"Resources": {
"DynamicAMI" : {
"Type" : "Custom::DynamicAMI",
"Properties" : {
"ServiceToken": { "Fn::Join": [ ":", [ "arn:aws:lambda", { "Ref": "AWS::Region" }, { "Ref": "AWS::AccountId" }, "ami-lookup" ]]},
"NodeName" : "base",
"Region" : { "Ref" : "AWS::Region" },
"AccountId" : { "Ref" : "AWS::AccountId" }
}
},
"LaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"InstanceType" : "t2.small",
"ImageId" : { "Fn::GetAtt" : [ "DynamicAMI", "Id" ] } ,
"UserData" : {
"Fn::Base64" : { "Fn::Join" : [ "", [
"#!/bin/bash\n",
"cfn-init --stack ", { "Ref" : "AWS::StackName" },
" --resource LaunchConfig",
" --region ", { "Ref" : "AWS::Region" },
"\n",
"cfn-signal --stack ", { "Ref" : "AWS::StackName" },
" --exit $?",
" --resource LaunchGroup",
" --region ", { "Ref" : "AWS::Region" },
"\n"
] ] }
}
}
},
"LaunchGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"CreationPolicy" : {
"ResourceSignal" : { "Count" : "1", "Timeout" : "PT5M" }
},
"Properties" : {
"LaunchConfigurationName" : { "Ref" : "LaunchConfig" },
"MinSize" : "1",
"MaxSize" : "1",
"Cooldown" : "180",
"HealthCheckGracePeriod" : "300",
"HealthCheckType" : "EC2",
"Tags" : [ { "Key" : "Name", "Value" : { "Ref" : "AWS::StackName" }, "PropagateAtLaunch" : "true" } ]
}
}
}
}