You need to create an API and a GET method on the API's root resource to set the endpoint URL stage variable value for a GET method in the API Gateway console. Then, select Save to change the HTTP Endpoint URL value to 'http://$stageVariables.url.' This will declare stage variables using the API Gateway console.