-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-eks-alb-controller-2.4.1
- Loading branch information
Showing
93 changed files
with
1,053 additions
and
5,463 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.