Skip to content

Commit ca1e1c4

Browse files
committed
Limit the event match to the specific hook we have created
1 parent 8bb0941 commit ca1e1c4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

templates/aws-stack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ Resources:
12011201
- "EC2 Instance-launch Lifecycle Action"
12021202
detail:
12031203
AutoScalingGroupName: [ !Ref AgentAutoScaleGroup ]
1204+
LifecycleHookName: [ BootHook ]
12041205
Targets:
12051206
- Arn: !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:automation-definition/${BootHookAutomation}:$DEFAULT
12061207
RoleArn: !GetAtt EventBridgeRuleRole.Arn
@@ -1281,6 +1282,7 @@ Resources:
12811282
- "EC2 Instance-terminate Lifecycle Action"
12821283
detail:
12831284
AutoScalingGroupName: [ !Ref AgentAutoScaleGroup ]
1285+
LifecycleHookName: [ ShutdownHook ]
12841286
Targets:
12851287
- Arn: !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:automation-definition/${BootHookAutomation}:$DEFAULT
12861288
RoleArn: !GetAtt EventBridgeRuleRole.Arn

0 commit comments

Comments
 (0)