-
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
feat(rds): add grant method for Data API #10748
Conversation
…rikx/aws-cdk into serverlesscluster-resource-arn-prop
…rikx/aws-cdk into serverlesscluster-resource-arn-prop
…rikx/aws-cdk into serverlesscluster-resource-arn-prop
ff4d69e
to
0208ab3
Compare
# Conflicts: # packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts # packages/@aws-cdk/aws-rds/test/test.serverless-cluster.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Mostly looks good, a few points to improve.
Should we check for aws-cdk/packages/@aws-cdk/aws-rds/lib/serverless-cluster.ts Lines 90 to 98 in f9afbc5
Renaming that property to sth. more expressive like |
Yes, great idea! We do the same thing for aws-cdk/packages/@aws-cdk/aws-rds/lib/instance.ts Lines 158 to 163 in 60c782f
|
Thanks a lot. I think the code you linked is actually flawed. aws-cdk/packages/@aws-cdk/aws-rds/lib/instance.ts Lines 359 to 365 in 60c782f
aws-cdk/packages/@aws-cdk/aws-rds/lib/instance.ts Lines 158 to 163 in 60c782f
If the user does not specify I run into this the same issue when testing this logic for my implementation in the serverless construct. |
@njlynch could you take the final decision for the method's name? :) Also:
|
Right, but then (on 163), it will enable it. The logic behind this is that if you haven't explicitly specified anything about IAM authentication, and then grant a principal connect access, you likely wanted IAM auth enabled. The error only throws when a user has explicitly disabled IAM auth, and then tries to grant connect access.
All else being equal, I think I like
I agree; it seems the only place this is labeled the
|
BREAKING CHANGE: Serverless cluster enableHttpEndpoint renamed to enableDataApi
It's also
having said that, I agree that it's more intent based to expose the property as aside: can the http endpoint be enabled in regions where the data api is not available? or are they truly synonymous? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. Also, I don't know if the Query Editor uses the Data API or uses the HTTP endpoint in some other way :/ |
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a few test failures to address (see Build Log for failures).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing those tests up. Everything looks good!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This PR adds a
grantDataApi
method toIServerlessCluster
to grant access to the Data API.The "minimum required permissions" to access the Data API are listed here.
This PR further restricts the IAM policy statement to the specific cluster (in favor of wildcarding).
Read access to the cluster secret must be granted separately via the secrets
grantRead
method.TBH, the
secretmanager
actions included in the two IAM policy statements in the official documentation. are rather confusing to me:rds-db-credentials
prefix. That prefix is not present insecretmanager
actions in the "RDSDataServiceAccess" statement are forcloses #10744
BREAKING CHANGE: Serverless cluster
enableHttpEndpoint
renamed toenableDataApi
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license