Created
August 5, 2021 04:26
-
-
Save markymarkus/d53a8838011d816d1d9af2db9ff32655 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LogsRule: | |
Type: AWS::Events::Rule | |
Properties: | |
EventBusName: 'default' | |
EventPattern: | |
source: | |
- aws.ssm | |
detail-type: | |
- "EC2 State Manager Association State Change" | |
State: ENABLED | |
Targets: | |
- Id: EventbridgeToLogs | |
Arn: !GetAtt EventLogGroup.Arn | |
InputTransformer: | |
InputPathsMap: | |
association-name: "$.detail.association-name" | |
time-stamp: "$.time" | |
detailed-status: "$.detail.detailed-status" | |
InputTemplate: | | |
{ | |
"timestamp": <time-stamp>, | |
"message": "{\"name\": \"<association-name>\", \"status\":\"<detailed-status>\"}" | |
} | |
EventLogGroup: | |
Type: AWS::Logs::LogGroup | |
Properties: | |
LogGroupName: '/aws/events/eventbridge' | |
RetentionInDays: 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment