# LoadBalancerInfoProperty

The `LoadBalancerInfo` property type specifies information about the load balancer or target group used for an AWS CodeDeploy deployment group.

For more information, see [Integrating CodeDeploy with Elastic Load Balancing](https://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-aws-elastic-load-balancing.html) in the *AWS CodeDeploy User Guide* .

For CloudFormation to use the properties specified in `LoadBalancerInfo` , the `DeploymentStyle.DeploymentOption` property must be set to `WITH_TRAFFIC_CONTROL` . If `DeploymentStyle.DeploymentOption` is not set to `WITH_TRAFFIC_CONTROL` , CloudFormation ignores any settings specified in `LoadBalancerInfo` .

> CloudFormation supports blue/green deployments on the AWS Lambda compute platform only.

`LoadBalancerInfo` is a property of the [DeploymentGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html) resource.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codedeploy as codedeploy } from 'aws-cdk-lib';
const loadBalancerInfoProperty: codedeploy.CfnDeploymentGroup.LoadBalancerInfoProperty = {
  elbInfoList: [{
    name: 'name',
  }],
  targetGroupInfoList: [{
    name: 'name',
  }],
  targetGroupPairInfoList: [{
    prodTrafficRoute: {
      listenerArns: ['listenerArns'],
    },
    targetGroups: [{
      name: 'name',
    }],
    testTrafficRoute: {
      listenerArns: ['listenerArns'],
    },
  }],
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codedeploy as codedeploy

load_balancer_info_property = codedeploy.CfnDeploymentGroup.LoadBalancerInfoProperty(
    elb_info_list=[codedeploy.CfnDeploymentGroup.ELBInfoProperty(
        name="name"
    )],
    target_group_info_list=[codedeploy.CfnDeploymentGroup.TargetGroupInfoProperty(
        name="name"
    )],
    target_group_pair_info_list=[codedeploy.CfnDeploymentGroup.TargetGroupPairInfoProperty(
        prod_traffic_route=codedeploy.CfnDeploymentGroup.TrafficRouteProperty(
            listener_arns=["listenerArns"]
        ),
        target_groups=[codedeploy.CfnDeploymentGroup.TargetGroupInfoProperty(
            name="name"
        )],
        test_traffic_route=codedeploy.CfnDeploymentGroup.TrafficRouteProperty(
            listener_arns=["listenerArns"]
        )
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codedeploy.*;

LoadBalancerInfoProperty loadBalancerInfoProperty = LoadBalancerInfoProperty.builder()
        .elbInfoList(List.of(ELBInfoProperty.builder()
                .name("name")
                .build()))
        .targetGroupInfoList(List.of(TargetGroupInfoProperty.builder()
                .name("name")
                .build()))
        .targetGroupPairInfoList(List.of(TargetGroupPairInfoProperty.builder()
                .prodTrafficRoute(TrafficRouteProperty.builder()
                        .listenerArns(List.of("listenerArns"))
                        .build())
                .targetGroups(List.of(TargetGroupInfoProperty.builder()
                        .name("name")
                        .build()))
                .testTrafficRoute(TrafficRouteProperty.builder()
                        .listenerArns(List.of("listenerArns"))
                        .build())
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeDeploy;

var loadBalancerInfoProperty = new LoadBalancerInfoProperty {
    ElbInfoList = new [] { new ELBInfoProperty {
        Name = "name"
    } },
    TargetGroupInfoList = new [] { new TargetGroupInfoProperty {
        Name = "name"
    } },
    TargetGroupPairInfoList = new [] { new TargetGroupPairInfoProperty {
        ProdTrafficRoute = new TrafficRouteProperty {
            ListenerArns = new [] { "listenerArns" }
        },
        TargetGroups = new [] { new TargetGroupInfoProperty {
            Name = "name"
        } },
        TestTrafficRoute = new TrafficRouteProperty {
            ListenerArns = new [] { "listenerArns" }
        }
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

loadBalancerInfoProperty := &LoadBalancerInfoProperty{
	ElbInfoList: []interface{}{
		&ELBInfoProperty{
			Name: jsii.String("name"),
		},
	},
	TargetGroupInfoList: []interface{}{
		&TargetGroupInfoProperty{
			Name: jsii.String("name"),
		},
	},
	TargetGroupPairInfoList: []interface{}{
		&TargetGroupPairInfoProperty{
			ProdTrafficRoute: &TrafficRouteProperty{
				ListenerArns: []*string{
					jsii.String("listenerArns"),
				},
			},
			TargetGroups: []interface{}{
				&TargetGroupInfoProperty{
					Name: jsii.String("name"),
				},
			},
			TestTrafficRoute: &TrafficRouteProperty{
				ListenerArns: []*string{
					jsii.String("listenerArns"),
				},
			},
		},
	},
}
```

## Properties

- `elbInfoList`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDeploymentGroup.ELBInfoProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.CfnDeploymentGroup.ELBInfoProperty.html)[] — An array that contains information about the load balancers to use for load balancing in a deployment.

  If you're using Classic Load Balancers, specify those load balancers in this array.

  > You can add up to 10 load balancers to the array. > If you're using Application Load Balancers or Network Load Balancers, use the `targetGroupInfoList` array instead of this one.

- `targetGroupInfoList`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDeploymentGroup.TargetGroupInfoProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.CfnDeploymentGroup.TargetGroupInfoProperty.html)[] — An array that contains information about the target groups to use for load balancing in a deployment.

  If you're using Application Load Balancers and Network Load Balancers, specify their associated target groups in this array.

  > You can add up to 10 target groups to the array. > If you're using Classic Load Balancers, use the `elbInfoList` array instead of this one.

- `targetGroupPairInfoList`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDeploymentGroup.TargetGroupPairInfoProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.CfnDeploymentGroup.TargetGroupPairInfoProperty.html)[] — The target group pair information.

  This is an array of `TargeGroupPairInfo` objects with a maximum size of one.
