-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add management sink rules and deployment workflow
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Deploy management sink rules | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- event-rules/mgmt-sink-rules/template.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: us-east-2 | ||
role-to-assume: arn:aws:iam::048723829744:role/PRX-GHA-AccessRole | ||
role-session-name: gha-deploy-mgmt-sink-rules | ||
|
||
- name: Deploy to management account | ||
working-directory: event-rules/mgmt-sink-rules | ||
run: | | ||
template_body=$(cat template.yml) | ||
aws cloudformation update-stack-set \ | ||
--stack-set-name mgmt-sink-event-rules \ | ||
--capabilities CAPABILITY_NAMED_IAM \ | ||
--template-body "$template_body" \ | ||
--operation-preferences FailureTolerancePercentage=100,MaxConcurrentPercentage=100,ConcurrencyMode=SOFT_FAILURE_TOLERANCE,RegionConcurrencyType=PARALLEL |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Similar to event rules created for _organization sink_ setups. There are some events that only occur within the management account of an AWS Organization. In order to capture and funnel those events to a single consumer, rules are created on the default event buses in all regions of the management account, which forward the events to purpose-built custom buses, to which the consumers subscribe. | ||
|
||
This template should be deployed to CloudFormation stacks using a StackSet. The StackSet should be created once in the management account, and configured to deploy to every region of the management account. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
|
||
Resources: | ||
HealthEventsRule: | ||
Type: AWS::Events::Rule | ||
Properties: | ||
EventPattern: | ||
detail-type: | ||
- AWS Health Event | ||
source: | ||
- aws.health | ||
State: ENABLED | ||
Targets: | ||
- Arn: arn:aws:events:us-east-2:578003269847:event-bus/HealthEvents-sink | ||
Id: mgmt-sink-health-event | ||
RoleArn: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/PRX-HealthEventsSinkRole |