Skip to content

[TON-707] Attach rendered instrumentation IAM policies#338

Open
fanny-jiang wants to merge 4 commits into
masterfrom
fanny/TON-707
Open

[TON-707] Attach rendered instrumentation IAM policies#338
fanny-jiang wants to merge 4 commits into
masterfrom
fanny/TON-707

Conversation

@fanny-jiang

@fanny-jiang fanny-jiang commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Note: Please remember to review the contribution guidelines
if you have not yet done so.

What does this PR do?

  • requests rendered instrumentation policy_documents using the target AWS account and partition
  • attaches the returned documents directly without client-side statement rendering, wrapping, or chunking
  • checks the Datadog role managed-policy attachment quota before removing existing instrumentation policies
  • follows the existing standard-integration cleanup, create, and attach pattern
  • keeps the tested Python source synchronized with the Lambda embedded in datadog_integration_permissions.yaml

Motivation

Move IAM statement rendering and chunking into instrumenter-config, which owns the permission definitions, and keep the CloudFormation Lambda focused on attaching the resulting documents. The quota preflight prevents cleanup when the final document count cannot fit on the role.

Testing Guidelines

  • python3 -B -S -m unittest discover -p "*_test.py" from aws_quickstart (56 tests)
  • the test suite verifies that the embedded Lambda exactly matches attach_integration_permissions.py

Additional Notes

  • depends on https://github.com/ddoghq/dd-source/pull/18715 and must be published only after the producer is deployed
  • there is no fallback to legacy flat permissions; missing policy_documents is treated as an instrumentation failure
  • ECS is intentionally unchanged and is not enabled in the UI
  • EKS permission scope is intentionally unchanged; separate work will remove the EKS instrumenter Lambda
  • bumps the QuickStart version to v4.16.0 and the policy attachment schema version to 2

@datadog-prod-us1-4

This comment has been minimized.

@fanny-jiang fanny-jiang changed the title Consume rendered instrumentation policies safely [TON-707] Attach rendered instrumentation IAM policies Jul 14, 2026
@fanny-jiang fanny-jiang marked this pull request as ready for review July 14, 2026 19:00
@fanny-jiang fanny-jiang requested a review from a team as a code owner July 14, 2026 19:00
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