@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class LoadBalancer extends Object implements Serializable, Cloneable, StructuredPojo
Details on a load balancer to be used with a service or task set.
If the service is using the ECS
deployment controller, you are limited to one load balancer or target
group.
If the service is using the CODE_DEPLOY
deployment controller, the service is required to use either an
Application Load Balancer or Network Load Balancer. When you are creating an AWS CodeDeploy deployment group, you
specify two target groups (referred to as a targetGroupPair
). Each target group binds to a separate task
set in the deployment. The load balancer can also have up to two listeners, a required listener for production
traffic and an optional listener that allows you to test new revisions of the service before routing production
traffic to it.
Services with tasks that use the awsvpc
network mode (for example, those with the Fargate launch type)
only support Application Load Balancers and Network Load Balancers. Classic Load Balancers are not supported. Also,
when you create any target groups for these services, you must choose ip
as the target type, not
instance
. Tasks that use the awsvpc
network mode are associated with an elastic network
interface, not an Amazon EC2 instance.
Constructor and Description |
---|
LoadBalancer() |
Modifier and Type | Method and Description |
---|---|
LoadBalancer |
clone() |
boolean |
equals(Object obj) |
String |
getContainerName()
The name of the container (as it appears in a container definition) to associate with the load balancer.
|
Integer |
getContainerPort()
The port on the container to associate with the load balancer.
|
String |
getLoadBalancerName()
The name of the load balancer to associate with the Amazon ECS service or task set.
|
String |
getTargetGroupArn()
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
service or task set.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setContainerName(String containerName)
The name of the container (as it appears in a container definition) to associate with the load balancer.
|
void |
setContainerPort(Integer containerPort)
The port on the container to associate with the load balancer.
|
void |
setLoadBalancerName(String loadBalancerName)
The name of the load balancer to associate with the Amazon ECS service or task set.
|
void |
setTargetGroupArn(String targetGroupArn)
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
service or task set.
|
String |
toString()
Returns a string representation of this object.
|
LoadBalancer |
withContainerName(String containerName)
The name of the container (as it appears in a container definition) to associate with the load balancer.
|
LoadBalancer |
withContainerPort(Integer containerPort)
The port on the container to associate with the load balancer.
|
LoadBalancer |
withLoadBalancerName(String loadBalancerName)
The name of the load balancer to associate with the Amazon ECS service or task set.
|
LoadBalancer |
withTargetGroupArn(String targetGroupArn)
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
service or task set.
|
public void setTargetGroupArn(String targetGroupArn)
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set.
A target group ARN is only specified when using an application load balancer or a network load balancer. If you are using a classic load balancer this should be omitted.
For services using the ECS
deployment controller, you are limited to one target group. For services
using the CODE_DEPLOY
deployment controller, you are required to define two target groups for the
load balancer.
If your service's task definition uses the awsvpc
network mode (which is required for the Fargate
launch type), you must choose ip
as the target type, not instance
, because tasks that
use the awsvpc
network mode are associated with an elastic network interface, not an Amazon EC2
instance.
targetGroupArn
- The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
service or task set.
A target group ARN is only specified when using an application load balancer or a network load balancer. If you are using a classic load balancer this should be omitted.
For services using the ECS
deployment controller, you are limited to one target group. For
services using the CODE_DEPLOY
deployment controller, you are required to define two target
groups for the load balancer.
If your service's task definition uses the awsvpc
network mode (which is required for the
Fargate launch type), you must choose ip
as the target type, not instance
,
because tasks that use the awsvpc
network mode are associated with an elastic network
interface, not an Amazon EC2 instance.
public String getTargetGroupArn()
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set.
A target group ARN is only specified when using an application load balancer or a network load balancer. If you are using a classic load balancer this should be omitted.
For services using the ECS
deployment controller, you are limited to one target group. For services
using the CODE_DEPLOY
deployment controller, you are required to define two target groups for the
load balancer.
If your service's task definition uses the awsvpc
network mode (which is required for the Fargate
launch type), you must choose ip
as the target type, not instance
, because tasks that
use the awsvpc
network mode are associated with an elastic network interface, not an Amazon EC2
instance.
A target group ARN is only specified when using an application load balancer or a network load balancer. If you are using a classic load balancer this should be omitted.
For services using the ECS
deployment controller, you are limited to one target group. For
services using the CODE_DEPLOY
deployment controller, you are required to define two target
groups for the load balancer.
If your service's task definition uses the awsvpc
network mode (which is required for the
Fargate launch type), you must choose ip
as the target type, not instance
,
because tasks that use the awsvpc
network mode are associated with an elastic network
interface, not an Amazon EC2 instance.
public LoadBalancer withTargetGroupArn(String targetGroupArn)
The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set.
A target group ARN is only specified when using an application load balancer or a network load balancer. If you are using a classic load balancer this should be omitted.
For services using the ECS
deployment controller, you are limited to one target group. For services
using the CODE_DEPLOY
deployment controller, you are required to define two target groups for the
load balancer.
If your service's task definition uses the awsvpc
network mode (which is required for the Fargate
launch type), you must choose ip
as the target type, not instance
, because tasks that
use the awsvpc
network mode are associated with an elastic network interface, not an Amazon EC2
instance.
targetGroupArn
- The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a
service or task set.
A target group ARN is only specified when using an application load balancer or a network load balancer. If you are using a classic load balancer this should be omitted.
For services using the ECS
deployment controller, you are limited to one target group. For
services using the CODE_DEPLOY
deployment controller, you are required to define two target
groups for the load balancer.
If your service's task definition uses the awsvpc
network mode (which is required for the
Fargate launch type), you must choose ip
as the target type, not instance
,
because tasks that use the awsvpc
network mode are associated with an elastic network
interface, not an Amazon EC2 instance.
public void setLoadBalancerName(String loadBalancerName)
The name of the load balancer to associate with the Amazon ECS service or task set.
A load balancer name is only specified when using a classic load balancer. If you are using an application load balancer or a network load balancer this should be omitted.
loadBalancerName
- The name of the load balancer to associate with the Amazon ECS service or task set.
A load balancer name is only specified when using a classic load balancer. If you are using an application load balancer or a network load balancer this should be omitted.
public String getLoadBalancerName()
The name of the load balancer to associate with the Amazon ECS service or task set.
A load balancer name is only specified when using a classic load balancer. If you are using an application load balancer or a network load balancer this should be omitted.
A load balancer name is only specified when using a classic load balancer. If you are using an application load balancer or a network load balancer this should be omitted.
public LoadBalancer withLoadBalancerName(String loadBalancerName)
The name of the load balancer to associate with the Amazon ECS service or task set.
A load balancer name is only specified when using a classic load balancer. If you are using an application load balancer or a network load balancer this should be omitted.
loadBalancerName
- The name of the load balancer to associate with the Amazon ECS service or task set.
A load balancer name is only specified when using a classic load balancer. If you are using an application load balancer or a network load balancer this should be omitted.
public void setContainerName(String containerName)
The name of the container (as it appears in a container definition) to associate with the load balancer.
containerName
- The name of the container (as it appears in a container definition) to associate with the load balancer.public String getContainerName()
The name of the container (as it appears in a container definition) to associate with the load balancer.
public LoadBalancer withContainerName(String containerName)
The name of the container (as it appears in a container definition) to associate with the load balancer.
containerName
- The name of the container (as it appears in a container definition) to associate with the load balancer.public void setContainerPort(Integer containerPort)
The port on the container to associate with the load balancer. This port must correspond to a
containerPort
in the service's task definition. Your container instances must allow ingress traffic
on the hostPort
of the port mapping.
containerPort
- The port on the container to associate with the load balancer. This port must correspond to a
containerPort
in the service's task definition. Your container instances must allow ingress
traffic on the hostPort
of the port mapping.public Integer getContainerPort()
The port on the container to associate with the load balancer. This port must correspond to a
containerPort
in the service's task definition. Your container instances must allow ingress traffic
on the hostPort
of the port mapping.
containerPort
in the service's task definition. Your container instances must allow ingress
traffic on the hostPort
of the port mapping.public LoadBalancer withContainerPort(Integer containerPort)
The port on the container to associate with the load balancer. This port must correspond to a
containerPort
in the service's task definition. Your container instances must allow ingress traffic
on the hostPort
of the port mapping.
containerPort
- The port on the container to associate with the load balancer. This port must correspond to a
containerPort
in the service's task definition. Your container instances must allow ingress
traffic on the hostPort
of the port mapping.public String toString()
toString
in class Object
Object.toString()
public LoadBalancer clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.