-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(elbv2): unable to add multiple certificates to NLB (#19289)
This PR does a couple of things to update the NetworkListener to be on par with ApplicationListener. 1. Add a NetworkListenerCertificate construct that allows you to associate multiple certificates with a listener. 2. Add a `addCertificates` method to `NetworkListener` similar to the same method on the `ApplicationListener`. This is needed because even though the `certificates` property on a `Listener`is an array, it expects only one certificate. To add more than one you have to create an `AWS::ElasticLoadBalancingV2::ListenerCertificate`. This functionality was added to `ApplicationListner` via #13490. fixes #8918, #15328 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- v2.173.4
- v2.173.3
- v2.173.2
- v2.173.1
- v2.173.0
- v2.172.0
- v2.171.1
- v2.171.0
- v2.170.0
- v2.169.0
- v2.168.0
- v2.167.2
- v2.167.1
- v2.167.0
- v2.166.0
- v2.165.0
- v2.164.1
- v2.164.0
- v2.163.1
- v2.163.0
- v2.162.1
- v2.162.0
- v2.161.1
- v2.161.0
- v2.160.0
- v2.159.1
- v2.159.0
- v2.158.0
- v2.157.0
- v2.156.0
- v2.155.0
- v2.154.1
- v2.154.0
- v2.153.0
- v2.152.0
- v2.151.1
- v2.151.0
- v2.150.0
- v2.149.0
- v2.148.1
- v2.148.0
- v2.147.3
- v2.147.2
- v2.147.1
- v2.147.0
- v2.146.0
- v2.145.0
- v2.144.0
- v2.143.1
- v2.143.0
- v2.142.1
- v2.142.0
- v2.141.0
- v2.140.0
- v2.139.1
- v2.139.0
- v2.138.0
- v2.137.0
- v2.136.1
- v2.136.0
- v2.135.0
- v2.134.0
- v2.133.0
- v2.132.1
- v2.132.0
- v2.131.0
- v2.130.0
- v2.129.0
- v2.128.0
- v2.127.0
- v2.126.0
- v2.125.0
- v2.124.0
- v2.123.0
- v2.122.0
- v2.121.1
- v2.121.0
- v2.120.0
- v2.119.0
- v2.118.0
- v2.117.0
- v2.116.1
- v2.116.0
- v2.115.0
- v2.114.1
- v2.114.0
- v2.113.0
- v2.112.0
- v2.111.0
- v2.110.1
- v2.110.0
- v2.109.0
- v2.108.1
- v2.108.0
- v2.107.0
- v2.106.1
- v2.106.0
- v2.105.0
- v2.104.0
- v2.103.1
- v2.103.0
- v2.102.1
- v2.102.0
- v2.101.1
- v2.101.0
- v2.100.0
- v2.99.1
- v2.99.0
- v2.98.0
- v2.97.1
- v2.97.0
- v2.96.2
- v2.96.1
- v2.96.0
- v2.95.1
- v2.95.0
- v2.94.0
- v2.93.0
- v2.92.0
- v2.91.0
- v2.90.0
- v2.89.0
- v2.88.0
- v2.87.0
- v2.86.0
- v2.85.0
- v2.84.0
- v2.83.1
- v2.83.0
- v2.82.0
- v2.81.0
- v2.80.0
- v2.79.1
- v2.79.0
- v2.78.0
- v2.77.0
- v2.76.0
- v2.75.1
- v2.75.0
- v2.74.0
- v2.73.0
- v2.72.1
- v2.72.0
- v2.71.0
- v2.70.0
- v2.69.0
- v2.68.0
- v2.67.0
- v2.66.1
- v2.66.0
- v2.65.0
- v2.64.0
- v2.63.2
- v2.63.1
- v2.63.0
- v2.62.2
- v2.62.1
- v2.62.0
- v2.61.1
- v2.61.0
- v2.60.0
- v2.59.0
- v2.58.1
- v2.58.0
- v2.57.0
- v2.56.1
- v2.56.0
- v2.55.1
- v2.55.0
- v2.54.0
- v2.53.0
- v2.52.1
- v2.52.0
- v2.51.1
- v2.51.0
- v2.50.0
- v2.49.1
- v2.49.0
- v2.48.0
- v2.47.0
- v2.46.0
- v2.45.0
- v2.44.0
- v2.43.1
- v2.43.0
- v2.42.1
- v2.42.0
- v2.41.0
- v2.40.0
- v2.39.1
- v2.39.0
- v2.38.1
- v2.38.0
- v2.37.1
- v2.37.0
- v2.36.0
- v2.35.0
- v2.34.2
- v2.34.1
- v2.34.0
- v2.33.0
- v2.32.1
- v2.32.0
- v2.31.2
- v2.31.1
- v2.31.0
- v2.30.0
- v2.29.1
- v2.29.0
- v2.28.1
- v2.28.0
- v2.27.0
- v2.26.0
- v2.25.0
- v2.24.1
- v2.24.0
- v2.23.0
- v2.22.0
- v2.21.1
- v2.21.0
- v2.20.0
- v2.19.0
- v1.204.0
- v1.203.0
- v1.202.0
- v1.201.0
- v1.200.0
- v1.199.0
- v1.198.1
- v1.198.0
- v1.197.0
- v1.196.0
- v1.195.0
- v1.194.0
- v1.193.0
- v1.192.0
- v1.191.0
- v1.190.0
- v1.189.0
- v1.188.0
- v1.187.0
- v1.186.1
- v1.186.0
- v1.185.0
- v1.184.1
- v1.184.0
- v1.183.0
- v1.182.0
- v1.181.1
- v1.181.0
- v1.180.0
- v1.179.0
- v1.178.0
- v1.177.0
- v1.176.0
- v1.175.0
- v1.174.0
- v1.173.0
- v1.172.0
- v1.171.0
- v1.170.1
- v1.170.0
- v1.169.0
- v1.168.0
- v1.167.0
- v1.166.1
- v1.165.0
- v1.164.0
- v1.163.2
- v1.163.1
- v1.163.0
- v1.162.0
- v1.161.0
- v1.160.0
- v1.159.0
- v1.158.0
- v1.157.0
- v1.156.1
- v1.156.0
- v1.155.0
- v1.154.0
- v1.153.1
- v1.153.0
- v1.152.0
- v1.151.0
Showing
3 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener-certificate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Construct } from 'constructs'; | ||
import { CfnListenerCertificate } from '../elasticloadbalancingv2.generated'; | ||
import { IListenerCertificate } from '../shared/listener-certificate'; | ||
import { INetworkListener } from './network-listener'; | ||
|
||
// keep this import separate from other imports to reduce chance for merge conflicts with v2-main | ||
// eslint-disable-next-line no-duplicate-imports, import/order | ||
import { Construct as CoreConstruct } from '@aws-cdk/core'; | ||
|
||
/** | ||
* Properties for adding a set of certificates to a listener | ||
*/ | ||
export interface NetworkListenerCertificateProps { | ||
/** | ||
* The listener to attach the rule to | ||
*/ | ||
readonly listener: INetworkListener; | ||
|
||
/** | ||
* Certificates to attach | ||
* | ||
* Duplicates are not allowed. | ||
*/ | ||
readonly certificates: IListenerCertificate[]; | ||
} | ||
|
||
/** | ||
* Add certificates to a listener | ||
*/ | ||
export class NetworkListenerCertificate extends CoreConstruct { | ||
constructor(scope: Construct, id: string, props: NetworkListenerCertificateProps) { | ||
super(scope, id); | ||
|
||
const certificates = [ | ||
...(props.certificates || []).map(c => ({ certificateArn: c.certificateArn })), | ||
]; | ||
|
||
new CfnListenerCertificate(this, 'Resource', { | ||
listenerArn: props.listener.listenerArn, | ||
certificates, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters