Expected Behavior
A CDK synth should still work if add_state_machines is called multiple times.
Actual Behavior
CDK synth fails with "There is already a Construct with name 'LogGroup' in DatadogStepFunctions." Removing the existing logging configuration on the statemachine seems to fix this.
Steps to Reproduce the Problem
- Define two statemachines with log groups.
self.my_statemachine_one = steps.StateMachine(self, "StatemachineOne", logs=steps.LogOptions(destination=self.statemachine_one_log_group, level=steps.LogLevel.ALL)
self.my_statemachine_two = steps.StateMachine(self, "StatemachineTwo", logs=steps.LogOptions(destination=self.statemachine_two_log_group, level=steps.LogLevel.ALL)
- Define DatadogStepFunctions construct.
self.datadog_step_functions = DataDogStepFunctions(self, "DDStep", forwarder_arn=dd_forwarder_arn)
- Call add_state_machines twice.
self.datadog_step_functions.add_state_machines([self.my_statemachine_one])
self.datadog_step_functions.add_state_machines([self.my_statemachine_two])
- Run a CDK synth. Build fails.
Specifications
- datadog-cdk-constructs-v2>=4.2.0
- python>=3.13
Expected Behavior
A CDK synth should still work if add_state_machines is called multiple times.
Actual Behavior
CDK synth fails with "There is already a Construct with name 'LogGroup' in DatadogStepFunctions." Removing the existing logging configuration on the statemachine seems to fix this.
Steps to Reproduce the Problem
Specifications