RDS Data API Execute Statement for postgres uses wrong secret value for database name #8577
Labels
bug
This issue is a bug.
p2
This is a standard priority issue
rds-data
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
service-api
This issue is due to a problem in a service API, not the SDK implementation.
Describe the bug
I've created a Secrets Manager secret for testing the Data API with Aurora Postgres and I've confirmed that the secret is working in the console using the query editor.
When I try to run the following command:
aws rds-data execute-statement --resource-arn CLUSTER_ARN --secret-arn SECRET_ARN --sql "select * from information_schema.tables;"
it gives me the following error:
An error occurred (DatabaseErrorException) when calling the ExecuteStatement operation: ERROR: database "USERNAME" does not exist; SQLState: 3D000
where
USERNAME
is the value for the username in the secret.Expected Behavior
The data API runs successfully in the same way as the query editor.
Current Behavior
dbname is not being read correctly so the data API does not work at all.
Reproduction Steps
aws rds-data execute-statement --resource-arn CLUSTER_ARN --secret-arn SECRET_ARN --sql "select * from information_schema.tables;"
Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.15.28
Environment details (OS name and version, etc.)
MacOS Sonoma 14.2.1
The text was updated successfully, but these errors were encountered: