[AWSINTS-690] Remove enumerated IAM permissions from aws_organizations template#332
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits intoJun 26, 2026
Conversation
…late with dynamic API fetch The Organizations template had ~600 IAM permissions hardcoded across an inline policy and four managed policies, requiring a manual template update every time Datadog's required AWS permissions changed. Ports the same Lambda-based approach already used in aws_quickstart/datadog_integration_permissions.yaml: at stack deploy/update time, a Lambda fetches the current permission list from the Datadog API and attaches it to the integration role as an inline policy (standard) and chunked managed policies (resource collection). On stack delete it cleans everything up. The Lambda's cleanup_legacy_base_policies handles the pre-existing inline policy name (DatadogAWSIntegrationPolicy) so upgrades from the hardcoded version are safe. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Copies attach_integration_permissions.py and its test from aws_quickstart/ to aws_organizations/ with API_CALL_SOURCE_HEADER_VALUE = "cfn-organizations". All 29 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hkrddog
approved these changes
Jun 25, 2026
Contributor
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
IAM permissions for the Datadog AWS Integration role are hardcoded, which adds friction when permissions need to be updated. We can automate this by retrieving the required permissions from the Datadog API endpoints https://docs.datadoghq.com/api/latest/aws-integration/get-aws-integration-standard-iam-permissions/ and https://docs.datadoghq.com/api/latest/aws-integration/get-resource-collection-iam-permissions/
Changes
Removes:
DatadogAWSIntegrationPolicyDatadogIntegrationRoleManagedPolicy{1–4}Adds:
DatadogAttachIntegrationPermissionsFunctionDatadogAttachIntegrationPermissionsLambdaExecutionRoleDatadogAttachIntegrationPermissionsFunctionTriggerTesting
link to new template
This PR is very similar to #250 which implemented the same change in the
aws_quickstarttemplate. Additions are copied over fromaws_quickstart