Courseiva

SOA-C02 Deployment, Provisioning, and Automation Practice Question

A company is using AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment fails because the instances in the Auto Scaling group are not registered with the target group of an Application Load Balancer. The SysOps administrator needs to ensure that new instances launched by the Auto Scaling group are automatically registered with the target group. What should the administrator do?

⚠ Common exam trap

SOA-C02 often tests whether candidates choose manual workarounds (user data scripts, lifecycle hooks) over native AWS integrations, so the trap is picking a more complex solution when a simple attachment exists.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Attach the target group to the Auto Scaling group.

To ensure that instances launched by an Auto Scaling group are automatically registered with an Application Load Balancer target group, the target group must be attached to the Auto Scaling group. This is done by specifying the target group ARN in the Auto Scaling group's configuration (via the console, CLI, or CloudFormation). When attached, the Auto Scaling group automatically registers new instances with the target group and deregisters terminated ones.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use Amazon Inspector to automatically register instances with the target group.

    Why it's wrong here

    Amazon Inspector is an automated security assessment service that evaluates instances for software vulnerabilities and unintended network exposure; it has no mechanism to register EC2 instances or on-premises servers with an Elastic Load Balancing target group. Target group registration is a function of the Elastic Load Balancing service itself, often driven by Auto Scaling or orchestration services, not by security scanning tools. Therefore, using Inspector would not cause instances to receive CodeDeploy deployments through the load balancer.

  • ✓

    Attach the target group to the Auto Scaling group.

    Why this is correct

    Attaching the target group to the Auto Scaling group is the AWS-recommended managed integration: when the Auto Scaling group launches new instances, it automatically registers them with the attached target group, and when instances are terminated, it deregisters them. This ensures that CodeDeploy, which can deploy to instances registered with a target group, has a current and accurate list of deployment targets without custom scripting. This approach is the correct answer because it leverages native AWS orchestration to keep target group membership synchronized with the Auto Scaling group's instance lifecycle.

  • ✗

    Create a lifecycle hook in the Auto Scaling group to register instances with the target group.

    Why it's wrong here

    Lifecycle hooks are designed to pause an Auto Scaling group during instance launch or termination so you can perform custom actions, such as running a script, draining connections, or waiting for a health check, before the instance transitions to the InService state. They do not inherently register instances with a target group; registration is a separate API call (RegisterTargets) that you must implement in the hook's notification target, e.g., using Lambda or SSM Run Command. Using a lifecycle hook adds complexity and potential failure points, and it is not the managed automatic solution that attaching the target group provides.

  • ✗

    Configure the Auto Scaling group to launch instances with a user data script that registers the instance with the target group.

    Why it's wrong here

    While a user data script could call the RegisterTargets API to add the instance to the target group, this approach is error-prone and not automatic from the load balancer or Auto Scaling perspective. The script runs only at initial launch, so it would not handle manual re-registration or instance replacement if the instance is later deregistered, and it requires proper IAM permissions and scripting logic for each AMI. In contrast, attaching the target group to the Auto Scaling group makes registration a native, declarative behavior, eliminating the need for custom bootstrap code and ensuring consistent registration actions during scale-out events.

About these practice questions

This SOA-C02 question is part of Courseiva's 1,169-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.