Which solution will meet these requirements?
Use AWS Amplify for automatic deployment templates. Use a traffic-splitting deployment to copy any deployments. Modify any resources created by Amplify, if necessary.
Use AWS CodeBuild for automatic deployment. Upload the required AppSpec file template. Save the appspec.yml file in the root directory folder of the revision. Specify the deployment group that includes the EC2 instances for the deployment.
Use AWS CloudFormation to create an infrastructure template in JSON format to deploy the EC2 instances. Use CloudFormation helper scripts to install the necessary software and to start the application. Call the scripts directly from the template.
Use AWS AppSync to deploy the application. Upload the template as a GraphQL schema. Specify the EC2 instances for deployment of the application. Use resolvers as a version control mechanism and to make any updates to the deployments.
Explanations:
AWS Amplify is primarily designed for front-end applications and mobile backends, and it does not offer the capabilities for managing infrastructure like EC2 instances or rolling back deployments in a manner suited for backend applications.
AWS CodeBuild is used for building code but does not handle deployments by itself. It requires integration with services like AWS CodeDeploy for deployment to EC2 instances. While AppSpec files are used in deployments, this option does not provide a comprehensive solution for automated, repeatable deployments and environment management.
AWS CloudFormation is the ideal solution for automating the deployment of EC2 instances and other resources. It allows for the creation of infrastructure as code, enables the creation of identical environments, supports updates through stack updates, and provides rollback capabilities to previous versions of the stack.
AWS AppSync is focused on building GraphQL APIs and is not intended for deploying applications on EC2 instances. It does not provide the infrastructure management or deployment automation capabilities required for this scenario.