You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(stepfunctions): disabling logging still requires LogGroup (#30816)
### Issue # (if applicable)
Closes#30814.
### Reason for this change
To disable logging on a StateMachine (with logging enabled), we should specify `LogLevel.OFF` to `LogOptions.level`. But cannot remove the LogGroup because `LogOptions.destination` is required.
``` ts
new sfn.StateMachine(this, 'StateMachine', {
definitionBody: ...,
logs: { level: sfn.LogLevel.OFF } // allow to disable logging
});
```
### Description of changes
- Make `LogOptions.destination` optional.
- Validate `LogOptions.destination` is present when `LogOptions.level` is not `OFF`.
### Description of how you validated changes
Unit and integ tests that verify `LogOptions.destination` is opitional when `LogOptions.level` is `OFF` and throw an exception otherwise.
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine-logging.js.snapshot/IntegTestDefaultTestDeployAssertE3E7D2A4.assets.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine-logging.js.snapshot/IntegTestDefaultTestDeployAssertE3E7D2A4.template.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine-logging.js.snapshot/aws-stepfunctions-integ.assets.json
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine-logging.js.snapshot/cdk.out
Copy file name to clipboardExpand all lines: packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.state-machine-logging.js.snapshot/integ.json
0 commit comments