I have a script where I want to fetch the AWS API gateway ID and API key value. So far I have been able to get the API gateway ID using the cli:
aws apigateway get-api-keys --query 'items[?name==`my-api-key-name`].id' --output text --region us-east-1
But I am unable to fetch the value of API key. I have tried the following cli, but no luck:
aws apigateway get-api-keys --query 'items[?name==`my-api-key-name`].value' --output text --region us-east-1
Can someone assist me on this please?
You're missing --include-values
key.
You can try this:
aws apigateway get-api-keys --query 'items[?name==`my-api-key-name`].value' --include-values --output text --region us-east-1
or this:
aws apigateway get-api-key --api-key <api-key-id> --include-value --query "value" --output text
Here you can find more info on that.
UPD:
Included suggestion from @Anatolii Bivol to use --query "value"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With