Which combination of steps should a DevOps engineer perform to meet these requirements?
(Choose two.)
Create a new version of the common AMI with the CodeDeploy agent installed. Update the IAM role of the EC2 instances to allow access to CodeDeploy.
Create a new version of the common AMI with the CodeDeploy agent installed. Create an AppSpec file that contains application deployment scripts and grants access to CodeDeploy.
Create an application in CodeDeploy. Configure an in-place deployment type. Specify the Auto Scaling group as the deployment target. Add a step to the CodePipeline pipeline to use EC2 Image Builder to create a new AMI. Configure CodeDeploy to deploy the newly created AMI.
Create an application in CodeDeploy. Configure an in-place deployment type. Specify the Auto Scaling group as the deployment target. Update the CodePipeline pipeline to use the CodeDeploy action to deploy the application.
Create an application in CodeDeploy. Configure an in-place deployment type. Specify the EC2 instances that are launched from the common AMI as the deployment target. Update the CodePipeline pipeline to use the CodeDeploy action to deploy the application.
Explanations:
The CodeDeploy agent must be installed on the EC2 instances for CodeDeploy to manage deployments. Updating the IAM role to grant CodeDeploy access is also essential for communication and deployment management.
Although an AppSpec file is necessary for deployment, the step does not meet all requirements; granting access to CodeDeploy requires IAM role configuration on the instances, not within the AppSpec file itself.
Using EC2 Image Builder to create an AMI is unnecessary for in-place deployments. In-place deployments update running instances rather than creating a new AMI, making this step redundant for the requirement.
Configuring a CodeDeploy application with an in-place deployment type targeting the Auto Scaling group allows CodePipeline to use CodeDeploy for automated deployments to EC2 instances, meeting the deployment requirement fully.
Specifying individual EC2 instances as the deployment target is not ideal for an Auto Scaling group. This approach fails to ensure the deployment consistency across the group, making it less reliable for scaling requirements.