DatabaseCluster(aws-rds): Using grantDataApiAccess method on imported cluster using DatabaseCluster.fromDatabaseClusterAttributes fails with the error: Cannot grant Data API access when the Data API is disabled #30676
Labels
@aws-cdk/aws-rds
Related to Amazon Relational Database
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
If we want to add a Appsync dataSource and provide RDS DB cluster as serverlessCluster prop , it fails with the error: Cannot grant Data API access when the Data API is disabled
Expected Behavior
It should not fail during synth
Current Behavior
This seems to be occurring due to this: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L524 as imported cluster : https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L1065C16-L1065C39 will have enableDataApi set as false: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-rds/lib/cluster.ts#L983
Reproduction Steps
This also fails with this snippet:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.138.0
Framework Version
No response
Node.js Version
v20.8.1
OS
MacOs
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: