John Fox
John Fox

Reputation: 917

Where do i get Secret ARN when running aws cli rds execute-statement?

trying to run an aws cli rds command to run a bit of sql to update a DB. Using the following:

aws rds-data execute-statement \
    --resource-arn "arn:aws:rds:us-east-1:myaccountnumber:cluster:mysql-database" \
    --database "myDBname" \
    --sql "select * from configurations where configuration = 'mydb' and propertykey = 'environment';" 
    --secret-arn "arn:aws:secretsmanager:us-west-2:123456789012:secret:mysecret" 

I'm struggling to work out what the secret ARN is?

I get that it's something stored in secrets manager but do not know what this is from the RDS instance.

How do i set this on the instance or is it something like the user password?

Thanks in advance

Upvotes: 7

Views: 5635

Answers (1)

Mark B
Mark B

Reputation: 200722

Executing statements in your database via the AWS API only works (at this time) if your database is an Aurora Serverless cluster with the Data API enabled. To use the Data API you have to pass it an ARN to a secret that contains the database credentials.

Upvotes: 7

Related Questions