DVA-C02 exam dumps

DVA-C02 practice question 310 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 310

Single answer

You are developing a serverless application using Amazon API Gateway and AWS Lambda. You have deployed multiple stages (e.g., 'dev', 'test', 'prod') in API Gateway. You want to configure a custom domain to route requests to the 'prod' stage while ensuring that the API calls use a user-friendly URL. How can you achieve this?

  1. A

    Create a custom domain name in API Gateway, associate it with the 'prod' stage, and configure a base path mapping.

  2. B

    Create a custom domain name in API Gateway, enable stage variables, and configure the custom domain to point to the 'prod' stage.

  3. C

    Create a custom domain name in API Gateway and configure a DNS record in Route 53 to point to the 'prod' stage's endpoint URL.

  4. D

    Configure a CloudFront distribution with the API Gateway endpoint as the origin, and use Route 53 to map the custom domain to the CloudFront distribution.

Show answer and explanation

Correct answer: A

Explanation

To use a custom domain for a specific API Gateway stage, you must configure the custom domain within API Gateway and associate it with the stage using base path mapping. This ensures that requests to the custom domain are routed to the correct stage. Additionally, DNS settings in Route 53 or another DNS service must be configured to point to the custom domain in API Gateway. While CloudFront can be used in specific cases (e.g., caching or additional functionality), it is not required for this scenario.

  • A. Correct.

    Correct. To use a custom domain with an API Gateway stage, you need to create a custom domain name in API Gateway, associate the domain with the desired stage using base path mapping, and configure DNS settings in Route 53 or another DNS service.

  • B. Incorrect.

    Incorrect. Stage variables are used for dynamic runtime configuration within API Gateway, not for associating custom domains with specific stages.

  • C. Incorrect.

    Incorrect. While creating a DNS record in Route 53 is necessary for the custom domain to resolve, you must still set up the custom domain and base path mapping within API Gateway.

  • D. Incorrect.

    Incorrect. CloudFront is not required to route traffic to API Gateway stages. API Gateway natively supports custom domains and base path mappings for this purpose.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam