Skip to content

[TON-466][TON-473] feat(aws_quickstart): forward CloudTrail resource update events to Datadog for agent installation#312

Merged
raymondeah merged 20 commits into
masterfrom
ray.eah/ton-466-agent-install-event-forwarding
May 29, 2026
Merged

[TON-466][TON-473] feat(aws_quickstart): forward CloudTrail resource update events to Datadog for agent installation#312
raymondeah merged 20 commits into
masterfrom
ray.eah/ton-466-agent-install-event-forwarding

Conversation

@raymondeah
Copy link
Copy Markdown
Contributor

@raymondeah raymondeah commented May 19, 2026

What does this PR do?

When InstrumentationResourceTypes is non-empty in main_workflow.yaml or main_extended_workflow.yaml, deploys a nested datadog_agent_resource_update_forwarding.yaml stack with:

  • datadog-agent-resource-update-intake-connection
    • EventBridge Connection holding the Datadog API + APP keys
  • datadog-agent-resource-update-intake-destination
    • EventBridge API Destination pointing at https://api.${DatadogSite}/api/unstable/instrumenter/events
  • EventBridge IAM invocation role granting events:InvokeApiDestination permission
  • datadog-agent-resource-update-rule-ec2
    • EventBridge rule forwarding EC2 lifecycle and configuration update CloudTrail events
    • only created when aws:ec2:instance is specified in InstrumentationResourceTypes
  • datadog-agent-resource-update-rule-eks
    • EventBridge rule forwarding EKS lifecycle and configuration update CloudTrail events
    • only created when aws:eks:cluster is specified in InstrumentationResourceTypes

Motivation

The Datadog Agent management feature needs near-real-time signal when EC2 instances and EKS clusters are created, tagged, or reconfigured

Testing Guidelines

  • Manual launch of template confirms the InstrumentationResourceTypes parameter is exposed in the CFN console and the nested forwarding stack deploys when set.

…main_extended and main_extended_workflow

v4.10.0 (PR #306) added the InstrumentationResourceTypes parameter only to
main_v2.yaml. main_extended.yaml and main_extended_workflow.yaml are the
templates UI launches actually use going forward, so the parameter and the
DatadogSite + InstrumentationResourceTypes passthrough to the role stack belong
there too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@raymondeah raymondeah force-pushed the ray.eah/ton-466-agent-install-event-forwarding branch from 38e7642 to 10db3d6 Compare May 19, 2026 20:53
@raymondeah raymondeah changed the base branch from master to ray.eah/ton-388-port-instrumentation-resource-types-to-extended May 19, 2026 20:53
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@raymondeah raymondeah force-pushed the ray.eah/ton-466-agent-install-event-forwarding branch from 10db3d6 to a72d03c Compare May 19, 2026 20:57
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@raymondeah raymondeah force-pushed the ray.eah/ton-466-agent-install-event-forwarding branch from a72d03c to ce20937 Compare May 20, 2026 18:12
raymondeah and others added 11 commits May 20, 2026 16:10
…t to main_workflow (drop main_extended)

main_extended.yaml isn't on the UI launch path; revert there and apply to
main_workflow.yaml instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…instrumenter-events intake

Adds an EventBridge connection, API destination, invocation role, and EC2
CloudTrail rule as a new nested stack, conditionally deployed when
InstrumentationResourceTypes is set. Single-region by design.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tionResourceTypes; add EKS

Add an EKS CloudTrail rule (CreateCluster, TagResource, UntagResource) and gate
each rule on whether its UDM type appears in InstrumentationResourceTypes.
Substring check is via Fn::Split / Fn::Join — CFN has no Conditions-level
substring intrinsic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…type

EC2 CreateTags/DeleteTags are scoped to instances via resourcesSet item resourceId
prefix "i-"; EKS TagResource/UntagResource are scoped to cluster ARNs via
wildcard match. Creation events (RunInstances, CreateCluster) bypass the filter
through EventBridge $or because their request payloads don't carry the filter
field.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…4.11.0, changelog

- Rename datadog_agent_install_forwarding.yaml to datadog_agent_resource_update_forwarding.yaml
  (the pipeline forwards resource update events; agent install is one consumer)
- DatadogAgentInstallForwardingStack -> DatadogAgentResourceUpdateForwardingStack in main_v2.yaml
- Bump version.txt to v4.11.0 + add 4.11.0 changelog entry
- Revert README — leave matching current prod

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ored comments

Drop "instrumenter-events" from connection and rule descriptions, the main_v2
comment, and the changelog entry. Remove the explanatory comments I added under
Conditions and Resources (substring-trick and $or rationale). The intake URL
itself stays — it's the actual ApiDestination endpoint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…gement"

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ded and main_extended_workflow

These two templates also need the InstrumentationResourceTypes parameter
(originally added only to main_v2 in v4.10.0) plus the same gating, role-stack
wiring, and conditional forwarding stack as main_v2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…w (drop main_extended)

main_extended.yaml isn't on the UI launch path; revert there and add the
forwarding wiring to main_workflow.yaml alongside main_v2 and
main_extended_workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@raymondeah raymondeah force-pushed the ray.eah/ton-466-agent-install-event-forwarding branch from ce20937 to c464a1b Compare May 20, 2026 20:12
…te events

Extends the forwarding pipeline (4.12.0) to also forward EC2
ModifyInstanceAttribute and EKS UpdateClusterConfig / UpdateClusterVersion
CloudTrail events. These represent queryable-field changes that affect
Agent management rule evaluation but previously only reached Datadog via
the hourly reconciler.

Bumps to v4.13.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@raymondeah raymondeah changed the title [TON-466] feat(aws_quickstart): forward CloudTrail resource update events to Datadog [TON-466][TON-473] feat(aws_quickstart): forward CloudTrail resource update events to Datadog for agent installation May 27, 2026
raymondeah and others added 4 commits May 27, 2026 10:42
…t-instrumentation-resource-types-to-extended

# Conflicts:
#	aws_quickstart/CHANGELOG.md
…tion-resource-types-to-extended' into ray.eah/ton-466-agent-install-event-forwarding

# Conflicts:
#	aws_quickstart/CHANGELOG.md
#	aws_quickstart/version.txt
…log to single entry

- Remove ShouldForwardEvents condition and DatadogAgentResourceUpdateForwardingStack
  resource from main_v2.yaml. The template is deprecated and no longer the UI launch
  path; forwarding ships via main_workflow.yaml and main_extended_workflow.yaml.
- Collapse the two staged CHANGELOG entries (forwarding pipeline + non-tag update
  events) into a single v4.13.0 entry; revert version.txt to v4.13.0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…n multiple regions

IAM role names are account-global. With an explicit RoleName the second-region
deploy of the same template fails with EntityAlreadyExists. Letting
CloudFormation auto-generate the name lets customers deploy the integration
in every region they want covered.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@raymondeah raymondeah marked this pull request as ready for review May 27, 2026 15:03
@raymondeah raymondeah requested a review from a team as a code owner May 27, 2026 15:03
@raymondeah
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@raymondeah raymondeah changed the base branch from ray.eah/ton-388-port-instrumentation-resource-types-to-extended to master May 28, 2026 15:01
…nt-install-event-forwarding

# Conflicts:
#	aws_quickstart/CHANGELOG.md
#	aws_quickstart/version.txt
@raymondeah raymondeah merged commit 259cf7f into master May 29, 2026
4 checks passed
@raymondeah raymondeah deleted the ray.eah/ton-466-agent-install-event-forwarding branch May 29, 2026 13:16
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.

2 participants