- Newest
- Most votes
- Most comments
It appears that the issue you're experiencing is related to authentication and authorization when trying to connect to your Aurora DSQL cluster. Since you mentioned that using a token copied from the console worked, but the programmatically generated token didn't, the problem likely lies in the token generation process or the permissions associated with the IAM role being used.
Here are a few things to check and try:
-
Ensure that the IAM role or user you're using to generate the token has the necessary permissions. For admin access, the IAM policy should include the
dsql:DbConnectAdminaction. -
Verify that the IAM credentials being used by your application (whether running locally or in Lambda) are correct and have the required permissions.
-
Check if your token is being generated correctly. The token should be valid for 15 minutes. Make sure your local machine's clock is synchronized correctly, as time skew can cause authentication issues.
-
If you're running this in a Lambda function, ensure that the Lambda execution role has the necessary permissions to generate the token and connect to the Aurora DSQL cluster.
-
Double-check that you're using the correct cluster endpoint. The endpoint for Aurora DSQL might be different from standard Aurora endpoints.
-
Ensure that your cluster's security group allows incoming connections from your client's IP address or the Lambda function's VPC.
-
If you're using a customer-managed key for encryption, make sure your IAM role has the necessary permissions on that key, including
kms:DescribeKeyandkms:CreateGrant.
If the issue persists after checking these points, you might want to enable more detailed logging or use AWS CloudTrail to get more information about the access denied error. This could help pinpoint whether it's an IAM permission issue, a network access problem, or something else.
Remember that Aurora DSQL is a preview service, so there might be some limitations or issues that are not yet fully documented. If you continue to face problems, it might be worth reaching out to AWS support for more detailed assistance.
Sources
Understanding authentication and authorization for Aurora DSQL - Amazon Aurora DSQL
Access denied in AWS aurora (RDS database) | AWS re:Post
Relevant content
- asked 8 months ago
- asked 5 months ago
