- Newest
- Most votes
- Most comments
The endpoint URL changes when the API Gateway REST API is updated, which can happen when:
- API Gateway configuration changes: Modifying API Gateway settings, such as integrating with a new Lambda function, updating resource paths, or changing authentication settings.
- Lambda function updates: Deploying a new version of a Lambda function can trigger an API Gateway update.
- Stack updates: Modifying the Serverless stack configuration, such as adding or removing resources, can lead to API Gateway changes.
To anticipate URL changes:
- Monitor API Gateway updates: Use AWS CloudWatch or (link unavailable)'s built-in monitoring to track API Gateway updates.
- Use API Gateway stages: Utilize API Gateway stages (e.g., dev, prod) to manage different environments and minimize URL changes.
- Implement a URL redirector: Set up a URL redirector, like an Amazon Route 53 alias record, to point to the latest API Gateway URL.
Recommended workflow when a URL change occurs:
- Update references: Update any external references to the new API Gateway URL.
- Test the new URL: Verify that the new URL works as expected.
- Monitor for issues: Closely monitor your application for any issues related to the URL change.
- Consider using a URL manager: Utilize a URL manager, like AWS API Gateway's Custom Domain Names, to manage URL changes and minimize disruptions.
URL Changes When:
API Gateway resource is recreated or modified significantly.
Stage names are changed.
The CloudFormation stack is deleted and recreated.
Anticipate Changes:
Monitor changes in serverless.yml.
Inspect the generated CloudFormation template.
Use serverless deploy --verbose to track changes during deployment.
Recommended Workflow:
Use Custom Domain Names: Avoids dependency on default API Gateway URLs.
Automate URL Retrieval: Use Serverless outputs to fetch and update URLs.
Lock Stage Names: Maintain consistent stage names to minimize URL changes.
Communicate Changes: Update all references and notify stakeholders if URLs change.
Consider Rollback: Roll back if an unexpected URL change disrupts services.
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 4 years ago
