Which solution will meet these requirements?
Use AWS CodeBuild to test the application. Use bash scripts invoked by AWS CodeDeploy’s appspec.yml file to restart services, and deregister and register instances with the ALB. Use the appspec.yml file to update file permissions without a custom script.
Use AWS CodePipeline to move the application from the AWS CodeCommit repository to AWS CodeDeploy. Use CodeDeploy’s deployment group to test the application, unregister and re-register instances with the ALB, and restart services. Use the appspec.yml file to update the permissions without a custom script.
Use AWS CodePipeline to move the application source code from the AWS CodeCommit repository to AWS CodeDeploy. Use CodeDeploy to test the application. Use CodeDeploy’s appspec.yml file to restart services and update permissions without a custom script. Use AWS CodeBuild to unregister and re- register instances with the ALB.
Use AWS CodePipeline to trigger AWS CodeBuild to test the application. Use bash scripts invoked by AWS CodeDeploy’s appspec.yml file to restart services. Unregister and re-register the instances in the AWS CodeDeploy deployment group with the ALB. Update the appspec.yml file to update file permissions without a custom script.
Explanations:
AWS CodeDeploy does not support directly using bash scripts in the appspec.yml file to deregister and re-register instances with the ALB. CodeDeploy is designed to handle instance lifecycle events, but not ALB management, which requires additional steps outside CodeDeploy.
CodeDeploy does not directly support testing the application, which requires AWS CodeBuild. Also, unregistering and re-registering instances with the ALB needs to be handled outside of CodeDeploy, making this solution incomplete.
AWS CodeDeploy cannot test the application directly; testing needs to be done through AWS CodeBuild. Additionally, CodeDeploy does not handle deregistering/re-registering instances with the ALB, which is necessary for this deployment process.
This solution uses AWS CodePipeline to trigger AWS CodeBuild for testing the application, and AWS CodeDeploy with bash scripts in the appspec.yml file to restart services. Instances can be deregistered and re-registered with the ALB within the deployment process. This solution maintains the necessary functionality.