A developer deployed a web application with an Amazon API Gateway REST API using a CloudFormation template that included RestApi, Resource, Method, Stage, and Deployment resources. After adding a new resource and methods, the stack update completed successfully, but calls to the new methods return 404 Not Found. What should the developer add to the CI/CD pipeline so the newly added methods become available after deployment?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a CodeBuild step in CodePipeline that runs the aws apigateway create-deployment AWS CLI command..
Why this is the answer
When you update an Amazon API Gateway REST API using CloudFormation, changes to resources and methods are not automatically deployed. A new deployment must be explicitly created for these changes to take effect and become accessible. The aws apigateway create-deployment AWS CLI command triggers this deployment, making the new methods available. Integrating this command into a CodeBuild step within your CI/CD pipeline ensures that every time your CloudFormation stack updates the API Gateway, a new deployment is automatically created. Disabling rollback or clearing stack failure options do not address the need for an explicit API Gateway deployment. Invalidating CloudFront caches is irrelevant here because the issue is with the API Gateway deployment itself, not caching of existing endpoints.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed