aws apigateway create-rest-api --region $AWS_REGION --name $GATEWAY_NAME API_ID=$(aws apigateway get-rest-apis --region $AWS_REGION --query "items[?name=='$GATEWAY_NAME']" | grep id | cut -d'"' -f4) RESOURCE_ID=$(aws apigateway get-resources --region us-east-1 --rest-api-id $API_ID --query "items[?path=='/']" | grep id | cut -d'"' -f4) aws apigateway put-method --region $AWS_REGION --rest-api-id $API_ID --resource-id $RESOURCE_ID --http-method OPTIONS --authorization-type NONE aws apigateway put-integration --region $AWS_REGION --rest-api-id $API_ID --resource-id $RESOURCE_ID --http-method OPTIONS --type MOCK aws apigateway create-deployment --region $AWS_REGION --rest-api-id $API_ID --stage-name 'dev' aws apigateway create-deployment --region $AWS_REGION --rest-api-id $API_ID --stage-name 'test' aws apigateway create-deployment --region $AWS_REGION --rest-api-id $API_ID --stage-name 'stage' aws apigateway create-deployment --region $AWS_REGION --rest-api-id $API_ID --stage-name 'prod'