-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Closed
Copy link
Labels
@aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsRelated to AWS StepFunctionsbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp3
Description
Describe the bug
When I have a StateMachine with logging enabled,
to disable logging still requires an existing LogGroup.
Expected Behavior
This configuration should be correct:
new sfn.StateMachine(stack, 'StateMachine', {
definitionBody: sfn.DefinitionBody.fromChainable(...),
logs: { level: sfn.LogLevel.OFF },
});Current Behavior
TypeScript compile error occurs:
error TS2741: Property 'destination' is missing in type '{ level: sfn.LogLevel.OFF; }' but required in type 'LogOptions'.
Omitting logs property does not modify StateMachine's logging configuration.
Reproduction Steps
Deploy a StateMachine described in Expected Behavior.
Possible Solution
Make LogOptions.destination optional.
CDK should also verify destination is specified (or create one) when level is not OFF.
Additional Information/Context
CloudFormation Documentation says:
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-stepfunctions-statemachine-loggingconfiguration.html
Destinations
Required, if your log level is not set to OFF.
Workaround (Escape hatch):
const states = new sfn.StateMachine(stack, 'StateMachine', {
definitionBody: sfn.DefinitionBody.fromChainable(...),
});
(states.node.defaultChild as sfn.CfnStateMachine).addPropertyOverride('LoggingConfiguration', { Level: 'OFF' });CDK CLI Version
2.148.0
Framework Version
No response
Node.js Version
v20.15.1
OS
Ubuntu
Language
TypeScript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsRelated to AWS StepFunctionsbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp3