# ApplicationLoadBalancerAttributes

Properties to reference an existing load balancer.

- Source: [`aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts#L1182)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';

declare const vpc: ec2.Vpc;
const applicationLoadBalancerAttributes: elbv2.ApplicationLoadBalancerAttributes = {
  loadBalancerArn: 'loadBalancerArn',
  securityGroupId: 'securityGroupId',

  // the properties below are optional
  loadBalancerCanonicalHostedZoneId: 'loadBalancerCanonicalHostedZoneId',
  loadBalancerDnsName: 'loadBalancerDnsName',
  securityGroupAllowsAllOutbound: false,
  vpc: vpc,
};
```

## Properties

- `loadBalancerArn`: string (required) — ARN of the load balancer.

- `loadBalancerCanonicalHostedZoneId`: string = When not provided, LB cannot be used as Route53 Alias target. — The canonical hosted zone ID of this load balancer.

  **Default:** When not provided, LB cannot be used as Route53 Alias target.

- `loadBalancerDnsName`: string = When not provided, LB cannot be used as Route53 Alias target. — The DNS name of this load balancer.

  **Default:** When not provided, LB cannot be used as Route53 Alias target.

- `securityGroupAllowsAllOutbound`: boolean = true — Whether the security group allows all outbound traffic or not.

  Unless set to `false`, no egress rules will be added to the security group.

- `securityGroupId`: string (required) — ID of the load balancer's security group.

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) = If the Load Balancer was imported and a VPC was not specified, the VPC is not available. — The VPC this load balancer has been created in, if available.

  **Default:** If the Load Balancer was imported and a VPC was not specified, the VPC is not available.
