Skip to content

update to allow exclusions and record Global IAM resource-types in the Control Tower Home region only. #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dap-aws
Copy link

@dap-aws dap-aws commented Apr 8, 2025

Issue #, if available:
How to exclude global resource types #14
#14

Description of changes:

  1. Added variable to CFN template.yaml to get the Control Tower Home region which is the region that deploys the Config BASELINE StackSet and the solution. Consistent with this commit:
    4c4eb77

  2. Added a static list of the 4 Global IAM resource-types as reference to add and remove to two new lists created.

  3. Created two new lists for exclusions: one for resource-types to exclude in the Home region and one for resource-types to exclude for all other CT governed regions, which should contain the 4 Global IAM resource-types.

  4. Used a list comprehension to remove or add the 4 Global IAM resource-types accordingly.

  5. Confirm if the region is the CT Home region to select the appropriate exclusion list for the recorder in that region.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

dap-aws added 4 commits April 8, 2025 12:11
add the CONTROL_TOWER_HOME_REGION: !Ref 'AWS::Region' variable for setting the Global Resource recording in the Home region only.
…resources in the Home region.

Adds a list and list comprehension to include the 4 global IAM resource-types in recording scope for the Control Tower Home region only. This is necessary since the 'exclusionByResourceTypes' option overrides the 'includeGlobalResourceTypes' option.
Update template.yaml with CONTROL_TOWER_HOME_REGION variable
Update ct_configrecorder_override_consumer.py to only include globals in home region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant