aws / aws/aws-cdk

elasticloadbalancingv2: specify private IPv4 address for internal NLB

Open
#30,388 3 comments 3 reactions 0 assignees View on GitHub
@aws-cdk/aws-elasticloadbalancingv2 effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

We can set static private IPv4 address for internal NLB.

### Use Case

NLB supports for specifying private IPv4 address from [SubnetMapping](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-loadbalancer-subnetmapping.html#cfn-elasticloadbalancingv2-loadbalancer-subnetmapping-privateipv4address) property.

However, L2 construct cannot configure it.

### Proposed Solution

Add `staticIpv4` boolean property to `NetworkLoadBalancerProps` and set `PrivateIpv4Address` in the `SubnetMappings`.
```ts
const lb = new elbv2.NetworkLoadBalancer(this, 'LB', {
vpc,
internetFacing: false, // only for internal NLB
staticIpv4: true // add
});
```

### Other Information

_No response_

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.141.0

### Environment details (OS name and version, etc.)

irrelevant

Contributor guide

Open the contributing guide

Research direction

Start at the TypeScript NetworkLoadBalancer construct and its NetworkLoadBalancerProps definition, then trace how SubnetMappings are built for internal load balancers. Check the existing ELBv2 construct tests for subnet-mapping behavior. Done means an internal NLB can configure the requested private IPv4 mapping through the proposed property, with tests covering the resulting configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.