Skip to content

Instantly share code, notes, and snippets.

@kevinkarwaski
Last active April 22, 2016 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinkarwaski/7f9472efe9f58f9f0a530406e7363a63 to your computer and use it in GitHub Desktop.
Save kevinkarwaski/7f9472efe9f58f9f0a530406e7363a63 to your computer and use it in GitHub Desktop.
"myLifecycleHookTopic" : {
"Type" : "AWS::SNS::Topic",
"Properties" : {
"Subscription" : [
{ "Endpoint" : { "Fn::GetAtt" : [ "MyLambdaLifecycleFunction", "Arn" ] }, "Protocol" : "lambda" }
]
}
}
"myLifecycleHook": {
"Type": "AWS::AutoScaling::LifecycleHook",
"Properties": {
"AutoScalingGroupName": { "Ref": "myAutoScalingGroup" },
"HeartbeatTimeout": 300,
"LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING",
"NotificationMetadata": { "Ref": "StackName" },
"NotificationTargetARN": { "Ref": "myLifecycleHookTopic" },
"RoleARN": { "Fn::GetAtt": [ "lifecycleHookRole", "Arn" ] }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment