feat(redshift): audit logging to cloudwatch#36410
feat(redshift): audit logging to cloudwatch#36410badmintoncryer wants to merge 20 commits intoaws:mainfrom
Conversation
…gExports and add integration tests for CloudWatch and S3 logging
…lusters - Created a new integration test file for Redshift clusters with CloudWatch and S3 logging. - Implemented a test stack that provisions a VPC, a CloudWatch logging cluster, and an S3 logging cluster. - Configured logging for both clusters and set up a logging bucket with auto-delete enabled. - Added parameter group configuration to enable user activity logging for the CloudWatch logging cluster.
…nfigurations for database audit logging
|
|
||||||||||||||
|
|
||||||||||||||
| * | ||
| * @default - All log types | ||
| */ | ||
| readonly logExports?: LogExport[]; |
There was a problem hiding this comment.
Configuring S3 bucket audit logging and logExports settings simultaneously causes a deployment error. Therefore, I've added logExports prop to only CloudWatchLoggingOptions.
This AWS::Redshift::Cluster resource is in a CREATE_FAILED state.
Resource handler returned message: "Log exports can only be used with CloudWatch export (Service: Redshift, Status Code: 400, Request ID: 58cb6b05-1577-4c42-ac6f-34755d2fbf8e) (SDK Attempt Count: 1)" (RequestToken: 103dc9fa-608c-310c-5376-18e3d12c7bd0, HandlerErrorCode: GeneralServiceException)Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Issue # (if applicable)
Closes #25755.
Reason for this change
Redshift supports for configuring audit logging sent to Cloudwatch or S3.
https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html
Description of changes
ClusterLoggingabstract classS3ClusterLoggingandCloudwatchClusterLoggingThe existing
loggingPropertyargument also exists, but I felt the design was insufficient for properly switching between CloudWatch and S3 configurations.In this PR, I am deprecating the existing argument and adding a new logging argument with an entirely different structure.
Since this is an alpha module, breaking changes should be acceptable. If the reviewer deems it necessary, it is also possible to remove the existing argument entirely.
Describe any new or updated permissions being added
Add S3 bucket resource policy for logging bucket.
https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions
The resource policy being applied is completely identical to the logic used for the existing loggingProperty configuration.
Description of how you validated changes
Add both unit and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license