nerdexam
Amazon

DVA-C02 · Question #394

A company has a web application that contains an Amazon API Gateway REST API. A developer has created an AWS CloudFormation template for the initial deployment of the application. The developer has de

The correct answer is C. Add an AWS CodeBuild stage to CodePipeline to run the aws apigateway create-deployment. Option C is correct because AWS::ApiGateway::Deployment in CloudFormation is a snapshot of the API at the time it was created - if that resource's properties don't change between deployments, CloudFormation considers it unchanged and does not push a new deployment to the stage, l

Submitted by diego_uy· Mar 5, 2026Deployment

Question

A company has a web application that contains an Amazon API Gateway REST API. A developer has created an AWS CloudFormation template for the initial deployment of the application. The developer has deployed the application successfully as part of an AWS CodePipeline continuous integration and continuous delivery (CI/CD) process. All resources and methods are available through the deployed stage endpoint. The CloudFormation template contains the following resource types:

AWS::ApiGateway::RestApi AWS::ApiGateway::Resource AWS::ApiGateway::Method AWS::ApiGateway::Stage AWS::ApiGateway::Deployment The developer adds a new resource to the REST API with additional methods and redeploys the template. CloudFormation reports that the deployment is successful and that the stack is in the UPDATE_COMPLETE state. However, calls to all new methods are returning 404 (Not Found) errors. What should the developer do to make the new methods available?

Options

  • ASpecify the disable-rollback option during the update-stack operation.
  • BUnset the CloudFormation stack failure options.
  • CAdd an AWS CodeBuild stage to CodePipeline to run the aws apigateway create-deployment
  • DAdd an action to CodePipeline to run the aws cloudfront create-invalidation AWS CLI command.

How the community answered

(28 responses)
  • A
    21% (6)
  • B
    14% (4)
  • C
    61% (17)
  • D
    4% (1)

Explanation

Option C is correct because AWS::ApiGateway::Deployment in CloudFormation is a snapshot of the API at the time it was created - if that resource's properties don't change between deployments, CloudFormation considers it unchanged and does not push a new deployment to the stage, leaving new methods invisible even though the stack reports success. Running aws apigateway create-deployment in a CodeBuild step forces a fresh deployment that captures all current resources and methods, making them reachable on the stage endpoint.

Why the distractors are wrong:

  • A - disable-rollback controls what happens when a stack fails; it has no effect here since the stack already succeeded (UPDATE_COMPLETE).
  • B - Stack failure options similarly govern rollback/failure behavior, not API Gateway stage content; the stack didn't fail, so this changes nothing.
  • D - cloudfront create-invalidation purges CloudFront CDN cache; API Gateway stages aren't served through CloudFront by default, and a cache miss wouldn't produce a 404 from the API Gateway service itself anyway.

Memory tip: Think of AWS::ApiGateway::Deployment as a camera snapshot - CloudFormation only takes a new photo if you tell it the camera changed. Adding new API methods changes the subject, not the camera, so you must manually trigger a new snapshot (deployment) to publish those methods to the live stage.

Topics

#API Gateway#CloudFormation#CI/CD#Deployment Management

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice