Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.32 KB

Custom-LBIpAddress.md

File metadata and controls

33 lines (24 loc) · 1.32 KB

Custom::AMI

The Custom::LBIpAddress resource is a lookup resource which returns the private IP address of Application and Network Load Balancers.

Syntax

To obtain the private ip addresses of the load balancers in your AWS CloudFormation template, use the following syntax:

  Type : "Custom::LBIpAddress",
  Properties:
    LoadBalancerArn: Arn
    Format: string
    ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-lb-ip-address-provider'

Properties

You can specify the following properties:

  • LoadBalancerArn - The arn of the load balancer.
  • Format - CIDR or plain

The custom resource wraps the EC2 describe-network-interfaces function and searches for network interfaces with the ARN name of the load balancer in the description.

Return values

With 'Fn::GetAtt' the following values are available:

  • PrivateIpAddresses - array of private ip address of the Load Balancer, in the specified format (cidr or plain)

Caveat

  • this resource depends on the informal link between the Load Balancer and the Network Interface based on the name of the description in the network interface. If AWS changes this, the provider will break.

  • ipv6 addresses are not yet returned.