Skip to content
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

aws-rds: Imported Database Cluster cannot grant data API access #31116

Closed
1 task
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@TonySherman
Copy link

Describe the bug

I am having the same issue as #30676 that was previously closed.

I am looking up a RDS Database Cluster to use as an AppSync datasource. The RDS Cluster does have Data API enabled and I can add it as a datasource in the AppSync console, however when I add the RDS datasource via cdk, I get the error:
RuntimeError: Error: Cannot grant Data API access when the Data API is disabled

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I should be able add a RDS datasource to an AppSync API by using the fromDatabaseClusterAttributes function.

Current Behavior

Error is thrown:
RuntimeError: Error: Cannot grant Data API access when the Data API is disabled

Reproduction Steps

# look up cluster
cluster = aws_rds.DatabaseCluster.from_database_cluster_attributes(
            self,
            'cluster',
            cluster_identifier='my-cluster',
        )

# add cluster as AppSync datasource
graph_api.add_rds_datasource(
            'rds-datasource',
            serverless_cluster=cluster,
            secret_store=my_secret,
        )

Possible Solution

No response

Additional Information/Context

#30676 explains this issue very well and what is causing it.

CDK CLI Version

2.151.0 (build b8289e2

Framework Version

No response

Node.js Version

v18.17.1

OS

MacOS

Language

Python

Language Version

Python 3.9

Other information

No response

@TonySherman TonySherman added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 14, 2024
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Aug 14, 2024
@TonySherman
Copy link
Author

TonySherman commented Aug 14, 2024

@rahuldeverani curious if you were able to resolve this issue or how you worked around it (referring to #30676).

@ashishdhingra ashishdhingra self-assigned this Aug 14, 2024
@ashishdhingra ashishdhingra added needs-reproduction This issue needs reproduction. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Aug 14, 2024
@TonySherman
Copy link
Author

I was able to deploy a RDS datasource by using aws_appsync.CfnDataSource and creating a role manually with the data api permissions.

@TonySherman
Copy link
Author

I've created an example repo to reproduce the issue that I'm seeing: https://github.com/TonySherman/cdk-rds-appsync-example/tree/main

@xanderhades
Copy link

@ashishdhingra
Copy link
Contributor

Reproducible. DatabaseCluster.fromDatabaseClusterAttributes() returns a new instance of ImportedDatabaseCluster. It doesn't appear to make any context lookup calls similar to what is mentioned at Context methods. So unsure DatabaseCluster.fromDatabaseClusterAttributes() could effectively be used for this scenario.

@ashishdhingra ashishdhingra added effort/medium Medium work item – several days of effort and removed needs-reproduction This issue needs reproduction. labels Aug 15, 2024
@ashishdhingra ashishdhingra removed their assignment Aug 15, 2024
@TonySherman
Copy link
Author

@kwwendt was able to provide another method of importing a cluster by using rds.ServerlessCluster.from_serverless_cluster_attributes . So it's possible this issue could be closed, however, a lot of the AppSync rds datasource examples use rds.ServerlessCluster as the example datasource. Maybe those should be updated?

Copy link

github-actions bot commented Oct 3, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

github-actions bot commented Oct 3, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.