public LoadBalancer withTargetGroupArn(String targetGroupArn) {
        setTargetGroupArn(targetGroupArn);
        return this;
    }
<p>
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
service or task set.
</p>
<p>
A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer.
</p>
<p>
For services using the <code>ECS</code> deployment controller, you can specify one or multiple target groups. For
more information, see <a
href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html"
>Registering multiple target groups with a service</a> in the <i>Amazon Elastic Container Service Developer
Guide</i>.
</p>
<p>
For services using the <code>CODE_DEPLOY</code> deployment controller, you're required to define two target
groups for the load balancer. For more information, see <a
href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html">Blue/green
deployment with CodeDeploy</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.
</p>
<important>
<p>
If your service's task definition uses the <code>awsvpc</code> network mode, you must choose <code>ip</code> as
the target type, not <code>instance</code>. Do this when creating your target groups because tasks that use the
<code>awsvpc</code> network mode are associated with an elastic network interface, not an Amazon EC2 instance.
This network mode is required for the Fargate launch type.
</p>
</important>

@param targetGroupArn
       The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
       service or task set.</p>
       <p>
       A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer.
       </p>
       <p>
       For services using the <code>ECS</code> deployment controller, you can specify one or multiple target
       groups. For more information, see <a
       href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html"
       >Registering multiple target groups with a service</a> in the <i>Amazon Elastic Container Service
       Developer Guide</i>.
       </p>
       <p>
       For services using the <code>CODE_DEPLOY</code> deployment controller, you're required to define two
       target groups for the load balancer. For more information, see <a
       href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html"
       >Blue/green deployment with CodeDeploy</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.
       </p>
       <important>
       <p>
       If your service's task definition uses the <code>awsvpc</code> network mode, you must choose
       <code>ip</code> as the target type, not <code>instance</code>. Do this when creating your target groups
       because tasks that use the <code>awsvpc</code> network mode are associated with an elastic network
       interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type.
       </p>
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/LoadBalancer.java