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?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则