query against rds aws mssql with cli

0

Hi, I tried query an mssql instance I have in rds with the following command:

aws rds-data execute-sql --db-cluster-or-instance-arn "arn:aws:rds:eu-west-1:******1:db:devtest-********-01-rds-db" --database "Js" --aws-secret-store-arn "arn:aws:secretsmanager:$(aws-region):$(aws-account-id):secret:${{ parameters.cluster }}-51WqBM" --sql-statements "SELECT 1"

or

aws rds-data execute-statement --resource-arn "arn:aws:rds:$(aws-region):$(aws-account-id):db:${{ parameters.cluster }}-rds-db" --database "J******s" --secret-arn "arn:aws:secretsmanager:$(aws-region):$aws-account-id):secret:${{ parameters.cluster }}-51WqBM" --sql "SELECT 1"

but I take always the following:

An error occurred (BadRequestException) when calling the ExecuteStatement operation: Invalid cluster arn:

ARN and secret has been check and they are correct. I suspect this is coming up because is not an Aurora SQL.

Anyone has a suggestion please?

1 個回答
0

Hello.

Yes, as you are aware, RDS Data API can only be used with Amazon Aurora Serverless v1.
Since this API cannot be used with normal RDS, it cannot be used with MSSQL either.
If you want to use RDS Data API, please use Aurora Serverless v1.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html

profile picture
專家
已回答 6 個月前
  • Hi, thanks a lot for your prompt answer. Is any way to query an mssql instance from my azure pipelines?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南