Created
September 12, 2021 12:51
-
-
Save m4r10k/33a840f1418020b15384af97d5783e81 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
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
EventsToCentralMonitoringEventBus: | |
Type: 'AWS::Events::Rule' | |
Properties: | |
Description: Events-To-Central-Monitoring-EventBus | |
Name: Events-To-Central-Monitoring-EventBus | |
EventPattern: | |
source: | |
- aws.cloudwatch | |
- aws.health | |
State: ENABLED | |
Targets: | |
- Arn: 'arn:aws:events:eu-central-1:<destination>:event-bus/Central-Monitoring-EventBus' | |
Id: !Select [2, !Split ['/', !Ref AWS::StackId]] | |
RoleArn: !GetAtt AllowPutOnCentralEventBusRole.Arn | |
AllowPutOnCentralBusPolicy: | |
Type: AWS::IAM::Policy | |
Properties: | |
PolicyName: AllowPutOnCentralEventBusPolicy | |
Roles: | |
- !Ref AllowPutOnCentralEventBusRole | |
PolicyDocument: | |
Statement: | |
- | |
Effect: Allow | |
Action: | |
- events:PutEvents | |
Resource: | |
- "arn:aws:events:eu-central-1:<destination>:event-bus/Central-Monitoring-EventBus" | |
AllowPutOnCentralEventBusRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: AllowPutOnCentralEventBusRole | |
AssumeRolePolicyDocument: | |
Version: "2012-10-17" | |
Statement: | |
- | |
Effect: Allow | |
Principal: | |
Service: events.amazonaws.com | |
Action: sts:AssumeRole |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment