Reputation: 161
I'm running a script using AWS CLI to define and deploy an AWS API Gateway. I'm able to get my API id as well as the deployment id with commands like this:
API_ID=$(aws apigateway get-rest-apis --query "items[?name=='my-api'].id" --output text)
DEPLOYMENT_ID=$(aws apigateway get-stage --rest-api-id $API_ID --stage-name dev --query "deploymentId" --output text)
Now, given that I have my API id and my deployment id, how do I get the API URL, i.e. the information appearing in the API Gateway console when you navigate to API->my-api->stages->dev ?
Many thanks in advance.
Seymour
Upvotes: 4
Views: 1539
Reputation: 161
Simple solution is https://$API_ID.execute-api.$AWS_REGION.amazonaws.com/$STAGE_NAME
Upvotes: 2