Skip to content

(stepfunctions): cannot disable x-ray tracing #30796

@Tietew

Description

@Tietew

Describe the bug

When I have a StateMachine with X-Ray tracing is enabled,
Setting tracingEnabled to false does not disable X-Ray tracing.

Expected Behavior

Changing tracingEnabled from true to false disables X-Ray tracing.

Current Behavior

Changing tracingEnabled to false does not modify X-Ray tracing.

Reproduction Steps

First deploy a StateMachine with tracingEnabled: true.
The stack creates an StateMacine with X-Ray tracing enabled.

new sfn.StateMachine(stack, 'StateMachine', {
  definitionBody: sfn.DefinitionBody.fromChainable(...),
  tracingEnabled: true,
});

Then, change tracingEnabled: false and deploy again.
X-Ray tracing is still enabled.

new sfn.StateMachine(stack, 'StateMachine', {
  definitionBody: sfn.DefinitionBody.fromChainable(...),
  tracingEnabled: false,
});

Possible Solution

When tracingEnabled is explictly false, render "TrancingConfiguration": {"Enabled": false} in template instead of undefined.

Additional Information/Context

Workaround: Following escape hatch can diable X-Ray tracing.

const machine = new sfn.StateMachine(stack, 'StateMachine', {
  definitionBody: sfn.DefinitionBody.fromChainable(...),
  tracingEnabled: false,
});
(machine.node.defaultChild as cdk.CfnResource).addPropertyOverride('TracingConfiguration', { Enabled: false });

CDK CLI Version

2.148.0

Framework Version

No response

Node.js Version

20.15.1

OS

Linux

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions