-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
AwsSdkCall
and crea…
…te `Logging` class (aws#29648) ### Reason for this change SDK v2 and v3 handlers for `AwsCustomResource` log the event object passed to the handler, API responses, and caught /uncaught errors for each SDK call made. This can potentially result in logging sensitive information that a user may wish to hide. This PR introduces a new `logging` property on the `AwsSdkCall` interface that can be used to provide more control over logging in the SDK v2 and v3 handlers on a per SDK call basis. The `logging` flag is configurable via a new `Logging` class which exposes two static methods: - all: all logging during lambda execution is turned on - withDataHidden: hides all logged data associated with the API call response. This includes the raw response as well as the `Data` field on the response object Additional logging configurations can be added in the future. ### Description of changes Added a `logging` flag to the `AwsSdkCall` interface which is configurable via the new `Logging` class. The `Logging` class has an internal `render` method which renders the specified logging configuration which is passed as part of the `create`, `update`, and `delete` `ResourceProperties` to the lambda handler. These `logging` properties are then used throughout the handler to control what is logged based on their value ### Description of how you validated changes * A new integ test with `logging` as `withDataHidden` was added * Unit tests to ensure calling `render` on a `Logging` instance produces the expected result * Unit tests to ensure that using `logging` with `AwsSdkCall` while using `AwsCustomResource` produces the correct CloudFormation template ### 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*
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.