Open Tietew opened 3 months ago
Thanks @Tietew for reporting this issue. I can confirm the issue and appreciate your efforts in PR contribution!
Does setting logs: undefined
not work? By default there is no logging
new sfn.StateMachine(stack, 'StateMachine', {
definitionBody: sfn.DefinitionBody.fromChainable(...),
});
@wong-a setting logs: undefined
does not render LoggingConfiguration
resource property. When updating a StateMachine with logging enabled, CloudFormation does not modify logging configuration when LoggingConfiguration
resource property does not exist. We need to specify {"LoggingConfiguration":{"Level":"OFF"}}
if we want to change logging from enabled to disabled.
CloudFormation does not modify logging configuration when LoggingConfiguration resource property does not exist. We need to specify {"LoggingConfiguration":{"Level":"OFF"}} if we want to change logging from enabled to disabled.
If this is true, it sounds like an issue to fix in CloudFormation resource instead of CDK
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:
Current Behavior
TypeScript compile error occurs:
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 verifydestination
is specified (or create one) whenlevel
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
Workaround (Escape hatch):
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