Class: Aws::ECS::Types::LoadBalancer

Inherits:
Struct
  • Object
show all
Includes:
Structure
Defined in:
lib/aws-sdk-ecs/types.rb

Overview

Note:

When making an API call, you may pass LoadBalancer data as a hash:

{
  target_group_arn: "String",
  load_balancer_name: "String",
  container_name: "String",
  container_port: 1,
}

Details on a load balancer that is used with a service.

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.

Instance Attribute Summary collapse

Instance Attribute Details

#container_nameString

The name of the container (as it appears in a container definition) to associate with the load balancer.

Returns:

  • (String)


4017
4018
4019
4020
4021
4022
4023
# File 'lib/aws-sdk-ecs/types.rb', line 4017

class LoadBalancer < Struct.new(
  :target_group_arn,
  :load_balancer_name,
  :container_name,
  :container_port)
  include Aws::Structure
end

#container_portInteger

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.

Returns:

  • (Integer)


4017
4018
4019
4020
4021
4022
4023
# File 'lib/aws-sdk-ecs/types.rb', line 4017

class LoadBalancer < Struct.new(
  :target_group_arn,
  :load_balancer_name,
  :container_name,
  :container_port)
  include Aws::Structure
end

#load_balancer_nameString

The name of a load balancer.

Returns:

  • (String)


4017
4018
4019
4020
4021
4022
4023
# File 'lib/aws-sdk-ecs/types.rb', line 4017

class LoadBalancer < Struct.new(
  :target_group_arn,
  :load_balancer_name,
  :container_name,
  :container_port)
  include Aws::Structure
end

#target_group_arnString

The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service. 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.

Returns:

  • (String)


4017
4018
4019
4020
4021
4022
4023
# File 'lib/aws-sdk-ecs/types.rb', line 4017

class LoadBalancer < Struct.new(
  :target_group_arn,
  :load_balancer_name,
  :container_name,
  :container_port)
  include Aws::Structure
end