CfnListenerProps Struct
Properties for defining a CfnListener.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
const cfnListenerProps: elbv2.CfnListenerProps = {
defaultActions: [{
type: 'type',
// the properties below are optional
authenticateCognitoConfig: {
userPoolArn: 'userPoolArn',
userPoolClientId: 'userPoolClientId',
userPoolDomain: 'userPoolDomain',
// the properties below are optional
authenticationRequestExtraParams: {
authenticationRequestExtraParamsKey: 'authenticationRequestExtraParams',
},
onUnauthenticatedRequest: 'onUnauthenticatedRequest',
scope: 'scope',
sessionCookieName: 'sessionCookieName',
sessionTimeout: 'sessionTimeout',
},
authenticateOidcConfig: {
authorizationEndpoint: 'authorizationEndpoint',
clientId: 'clientId',
issuer: 'issuer',
tokenEndpoint: 'tokenEndpoint',
userInfoEndpoint: 'userInfoEndpoint',
// the properties below are optional
authenticationRequestExtraParams: {
authenticationRequestExtraParamsKey: 'authenticationRequestExtraParams',
},
clientSecret: 'clientSecret',
onUnauthenticatedRequest: 'onUnauthenticatedRequest',
scope: 'scope',
sessionCookieName: 'sessionCookieName',
sessionTimeout: 'sessionTimeout',
useExistingClientSecret: false,
},
fixedResponseConfig: {
statusCode: 'statusCode',
// the properties below are optional
contentType: 'contentType',
messageBody: 'messageBody',
},
forwardConfig: {
targetGroups: [{
targetGroupArn: 'targetGroupArn',
weight: 123,
}],
targetGroupStickinessConfig: {
durationSeconds: 123,
enabled: false,
},
},
jwtValidationConfig: {
issuer: 'issuer',
jwksEndpoint: 'jwksEndpoint',
// the properties below are optional
additionalClaims: [{
format: 'format',
name: 'name',
values: ['values'],
}],
},
order: 123,
redirectConfig: {
statusCode: 'statusCode',
// the properties below are optional
host: 'host',
path: 'path',
port: 'port',
protocol: 'protocol',
query: 'query',
},
targetGroupArn: 'targetGroupArn',
}],
loadBalancerArn: 'loadBalancerArn',
// the properties below are optional
alpnPolicy: ['alpnPolicy'],
certificates: [{
certificateArn: 'certificateArn',
}],
listenerAttributes: [{
key: 'key',
value: 'value',
}],
mutualAuthentication: {
advertiseTrustStoreCaNames: 'advertiseTrustStoreCaNames',
ignoreClientCertificateExpiry: false,
mode: 'mode',
trustStoreArn: 'trustStoreArn',
},
port: 123,
protocol: 'protocol',
sslPolicy: 'sslPolicy',
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
alpnPolicyoptionalstring[]alpn_policyoptionaltyping.List[str]alpnPolicyoptionalList<String>AlpnPolicyoptionalstring[]AlpnPolicyoptional*[]*string#certificatesoptionalIResolvable | IResolvable | CfnListener.CertificateProperty[]certificatesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CertificateProperty]]]certificatesoptionalIResolvableCertificatesoptionalIResolvableCertificatesoptionalinterface{}#notes
You must provide exactly one certificate if the listener protocol is HTTPS or TLS.
For an HTTPS listener, update requires some interruptions. For a TLS listener, update requires no interruption.
To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .
defaultActionsIResolvable | IResolvable | CfnListener.ActionProperty[]default_actionstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ActionProperty]]]defaultActionsIResolvableDefaultActionsIResolvableDefaultActionsinterface{}required#To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .
listenerAttributesoptionalIResolvable | IResolvable | CfnListener.ListenerAttributeProperty[]listener_attributesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ListenerAttributeProperty]]]listenerAttributesoptionalIResolvableListenerAttributesoptionalIResolvableListenerAttributesoptionalinterface{}#Attributes that you do not modify retain their current values.
loadBalancerArnstring | ILoadBalancerRefload_balancer_arntyping.Union[str, ILoadBalancerRef]loadBalancerArnStringLoadBalancerArnstringLoadBalancerArninterface{}required#mutualAuthenticationoptionalIResolvable | CfnListener.MutualAuthenticationPropertymutual_authenticationoptionaltyping.Union[IResolvable, MutualAuthenticationProperty]mutualAuthenticationoptionalIResolvableMutualAuthenticationoptionalIResolvableMutualAuthenticationoptionalinterface{}#You can't specify a port for a Gateway Load Balancer.
protocoloptionalstringprotocoloptionalstrprotocoloptionalStringProtocoloptionalstringProtocoloptional*string#notes
For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, TCP_UDP, QUIC, and TCP_QUIC. You can’t specify the UDP, TCP_UDP, QUIC, or TCP_QUIC protocol if dual-stack mode is enabled. You can't specify a protocol for a Gateway Load Balancer.
sslPolicyoptionalstringssl_policyoptionalstrsslPolicyoptionalStringSslPolicyoptionalstringSslPolicyoptional*string#notes
For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .
[HTTPS listeners] Updating the security policy can result in interruptions if the load balancer is handling a high volume of traffic. To decrease the possibility of an interruption if your load balancer is handling a high volume of traffic, create an additional load balancer or request an LCU reservation.