Skip to content

Commit

Permalink
refactor: rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
badmintoncryer committed Mar 17, 2024
1 parent 4928464 commit ad4f586
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ new elbv2.NetworkLoadBalancer(stack, 'NLB', {
crossZoneEnabled: true,
deletionProtection: false,
denyAllIgwTraffic: true,
zonalAffinity: elbv2.ZonalAffinity.PARTIAL_AVAILABILITY_ZONE_AFFINITY,
clientRoutingPolicy: elbv2.ClientRoutingPolicy.PARTIAL_AVAILABILITY_ZONE_AFFINITY,
});

new integ.IntegTest(app, 'nlb-attlibutes-integ', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { parseLoadBalancerFullName } from '../shared/util';
*
* @see https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html#zonal-dns-affinity
*/
export enum ZonalAffinity {
export enum ClientRoutingPolicy {
/**
* 100 percent zonal affinity
*/
Expand Down Expand Up @@ -58,7 +58,7 @@ export interface NetworkLoadBalancerProps extends BaseLoadBalancerProps {
*
* @default - AZ affinity is disabled.
*/
readonly zonalAffinity?: ZonalAffinity;
readonly clientRoutingPolicy?: ClientRoutingPolicy;
}

/**
Expand Down Expand Up @@ -248,8 +248,8 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa
this.isSecurityGroupsPropertyDefined = !!props.securityGroups;
this.connections = new ec2.Connections({ securityGroups: props.securityGroups });
this.ipAddressType = props.ipAddressType ?? IpAddressType.IPV4;
if (props.zonalAffinity) {
this.setAttribute('dns_record.client_routing_policy', props.zonalAffinity);
if (props.clientRoutingPolicy) {
this.setAttribute('dns_record.client_routing_policy', props.clientRoutingPolicy);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('tests', () => {
vpc,
crossZoneEnabled: true,
denyAllIgwTraffic: true,
zonalAffinity: elbv2.ZonalAffinity.PARTIAL_AVAILABILITY_ZONE_AFFINITY,
clientRoutingPolicy: elbv2.ClientRoutingPolicy.PARTIAL_AVAILABILITY_ZONE_AFFINITY,
});

// THEN
Expand Down

0 comments on commit ad4f586

Please sign in to comment.