Q4 — AWS DOP-C02 Ch.1
Question 4 of 100 | ← Chapter 1
A development team is building a full-stack serverless web application consisting of a backend REST API and a frontend built using a single-page application (SPA) framework. The team wants to adopt a Git-based workflow for development and deployment. They created an AWS CodeCommit repository to store application code. They want to use multiple development branches to test new features and ensure that code changes on development branches are deployed to different development environments. Code changes to the main branch must be automatically promoted to production.
- A. Create an application in the AWS Amplify console and connect the CodeCommit repository. Create feature branch deployments for each environment. Connect the Route 53 domain to the application and enable automatic subdomain creation. ✓
- B. Create an AWS CodePipeline pipeline using the CodeCommit repository as the source. Configure the pipeline to deploy to different environments based on the changed branch. Create an AWS Lambda function that creates a new subdomain based on the source branch name and invoke it in the deployment workflow.
- C. Create an application in AWS Elastic Beanstalk using the CodeCommit repository as the source. Configure Elastic Beanstalk to create new application environments based on the changed branch. Connect the Route 53 domain to the application and enable automatic subdomain creation.
- D. Create multiple AWS CodePipeline pipelines using the CodeCommit repository as the source. Configure each pipeline to deploy to a specific environment based on a configured branch. Configure AWS CodeDeploy steps in the pipelines to deploy application components and create Route 53 public hosted zones.
Correct Answer: A. Create an application in the AWS Amplify console and connect the CodeCommit repository. Create feature branch deployments for each environment. Connect the Route 53 domain to the application and enable automatic subdomain creation.
Explanation
AWS Amplify natively supports Git-based workflows with automatic branch-to-environment mapping. When developers push to a new branch, Amplify automatically creates a new deployment environment. The main branch maps to production, while feature branches (e.g., develop) map to isolated preview environments. Amplify Hosting supports connecting custom domains and automatically provisioning subdomains per branch (e.g., feature-branch.app.example.com). This satisfies all requirements with zero infrastructure-as-code or custom automation. Options B, C, and D require significant custom logic (Lambda, Elastic Beanstalk environment management, or multiple pipelines), increasing operational overhead and complexity compared to Amplify’s built-in capabilities.