A front-end team hosts a React web app with AWS Amplify Hosting, connected to a Git repository.
Commits to main must update the production site. Commits to develop must publish a separate beta site with its own URL for testers. The team wants one Amplify app to manage both, so it does not maintain two sets of hosting configuration.
What should the developer do?
Choose one answer.
AA. Create a second Amplify app connected to the same repository, and point it at the develop branch.
BB. Add the develop branch to the existing Amplify app as a second connected branch.
CC. Copy the develop build output into a folder of the production S3 bucket by hand after each change.
DD. Create an AWS CodeDeploy deployment group that sends develop builds to a test fleet of instances.
Show the answer and explanation
Answer: B
A. Wrong: A second app works, but it creates a second set of hosting configuration, which the team wants to avoid. It also splits management across two apps when one app can host both branches.
C. Wrong: Manual copies bypass the Git-based pipeline, so the beta site is not rebuilt on each commit. They also put untested files in the production bucket.
D. Wrong: CodeDeploy deploys to compute such as EC2 instances or Lambda functions, not to Amplify Hosting apps. It is not connected to a repository branch.
Explanation
Amplify Hosting connects Git branches to an app and deploys each connected branch automatically, with its own URL. Adding a second branch to the existing app keeps production and beta hosting in one place, so there is one set of hosting configuration to manage.
Want more on Versions, aliases and stages? The 5 full-length practice sets have 14 more Versions, aliases and stages questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →