-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redshift-alpha: existing integration test actually fails to deploy #31817
Comments
Looks like grantPrivileges() > executeStatement() is failing while executing Syntax for GRANT allows to specify comma separated actions ( Table name can use:
In the issue, the error is |
Hi @badmintoncryer , after some investigation, we determined that this issue is a regression introduced by PR #24308. I am currently working on a workaround. |
@5d Thank you for your information! |
…#32452) ### Issue # (if applicable) Closes - #31817 - #29231 ### Reason for this change This regression was introduced in PR#24308, which added support for executing the `ALT TABLE` SQL statement when the table name is changed in the CDK construct. The root cause is in the modification of the physical ID of the custom resource Lambda function. Previously, this Lambda function was returning the `tableName` after table is created. However, the physical ID was updated to a combined ID in the format `clusterId:databaseName:tableNamePrefix:stackIdSuffix`. This change breaks the logic that depends on the return value being used as the `tableName`. For example, in the reported issue, the integration test relies on this value to grant permissions to specific users. The new combined ID format causes SQL statement errors, as described in the issue. ### Description of changes The fix involves adding logic to detect whether the resource's physical ID is in the new format. If it is, the logic reconstructs the `tableName` from the combined ID. This ensures that Lambda functions referencing the `tableName` receive the correct value. ### Description of how you validated changes - rerun unit test cases - deployed integration test cases ### 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*
Describe the bug
There is an
integ.database.ts
integ test, but this test cannot actually be deployed to AWS.Generated template file is here.
Regression Issue
Last Known Working CDK Version
2.160.0
Expected Behavior
The integ test should be able to deploy.
Current Behavior
Failed to deploy.
Reproduction Steps
You can perform this integration test as follows.
cd packages/@aws-cdk/aws-redshift-alpha yarn yarn build yarn integ test/integ.database.js --force
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.160.0
Framework Version
No response
Node.js Version
v22.9.0
OS
macOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: