Skip to content

fix: Changing Scope of Log Group Lookup in DatadogStepFunctions construct - #683

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
fix-scope-for-statemachine-log-groups
Aug 21, 2026
Merged

fix: Changing Scope of Log Group Lookup in DatadogStepFunctions construct#683
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
fix-scope-for-statemachine-log-groups

Conversation

@TalUsvyatsky

@TalUsvyatsky TalUsvyatsky commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #666.

This updates the scope of the log group lookup in DatadogStepFunctions to be consistent with the scope of a newly-created log group in the same construct. Previously, newly-created log groups used the state machine as their scope while lookups used the DatadogStepFunctions construct itself. This caused a construct-id collision ("There is already a Construct with name 'LogGroup' in DatadogStepFunctions.") when addStateMachines was called for more than one state machine that had a pre-defined log group.

Adds unit tests to #667, opened by @mjdean94, which contains the original one-line fix (4066d28/eabe05c after rebase). This PR keeps that fix commit as-is and adds a regression unit test on top, then runs it through this repo's full CI (including integration tests), which fork PRs cannot trigger since tests.yml only runs on push.

Testing Guidelines

Added a unit test in test/datadog-step-functions.spec.ts that creates two state machines, each with its own pre-defined log group, and calls addStateMachines for each on the same DatadogStepFunctions construct. Verified locally that this test fails against the pre-fix scoping and passes with the fix.

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

Closes #667

mjdean94 and others added 2 commits August 21, 2026 10:23
…ng log groups

Covers #666 — addStateMachines() previously threw a construct-id
collision when called for a second state machine with a pre-defined
log group, because the log group lookup was scoped to the shared
DatadogStepFunctions construct instead of the state machine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@TalUsvyatsky
TalUsvyatsky requested a review from a team as a code owner August 21, 2026 14:25
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit e473495 into main Aug 21, 2026
13 of 14 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the fix-scope-for-statemachine-log-groups branch August 21, 2026 14:52
@TalUsvyatsky TalUsvyatsky mentioned this pull request Aug 21, 2026
10 tasks
TalUsvyatsky added a commit that referenced this pull request Aug 21, 2026
This release includes the following commits:
e473495 fix: Changing Scope of Log Group Lookup in DatadogStepFunctions construct (#683)
4e8b86b chore: fix release script (#682)
66aad81 fix(deps): vuln aws-cdk-lib (minor → 2.265.0) [examples/step-functions-typescript-stack] (#672)
a0aa8c6 ADMS: vuln minor: github.com/aws/aws-cdk-go/awscdk/v2, golang.org/x/mod [examples/step-functions-go-stack] (#678)
86ef10e ADMS: vuln aws-cdk-lib (minor → 2.265.0) [examples/typescript-stack] (#675)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataDogStepFunctions with Multiple add_state_machines Invocations Fails Due to LogGroup Collision

3 participants