aws-cdk-lib.aws_elasticloadbalancingv2.CfnListenerProps

interface CfnListenerProps

LanguageType name
.NETAmazon.CDK.AWS.ElasticLoadBalancingV2.CfnListenerProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancingv2#CfnListenerProps
Javasoftware.amazon.awscdk.services.elasticloadbalancingv2.CfnListenerProps
Pythonaws_cdk.aws_elasticloadbalancingv2.CfnListenerProps
TypeScript aws-cdk-lib » aws_elasticloadbalancingv2 » CfnListenerProps

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,
      },
    },
    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',
  }],
  port: 123,
  protocol: 'protocol',
  sslPolicy: 'sslPolicy',
};

Properties

NameTypeDescription
defaultActionsIResolvable | IResolvable | ActionProperty[]The actions for the default rule. You cannot define a condition for a default rule.
loadBalancerArnstringThe Amazon Resource Name (ARN) of the load balancer.
alpnPolicy?string[][TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
certificates?IResolvable | IResolvable | CertificateProperty[]The default SSL server certificate for a secure listener.
port?numberThe port on which the load balancer is listening.
protocol?stringThe protocol for connections from clients to the load balancer.
sslPolicy?string[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.

defaultActions

Type: IResolvable | IResolvable | ActionProperty[]

The actions for the default rule. You cannot define a condition for a default rule.

To create additional rules for an Application Load Balancer, use AWS::ElasticLoadBalancingV2::ListenerRule .


loadBalancerArn

Type: string

The Amazon Resource Name (ARN) of the load balancer.


alpnPolicy?

Type: string[] (optional)

[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.


certificates?

Type: IResolvable | IResolvable | CertificateProperty[] (optional)

The default SSL server certificate for a secure listener.

You must provide exactly one certificate if the listener protocol is HTTPS or TLS.

To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate .


port?

Type: number (optional)

The port on which the load balancer is listening.

You cannot specify a port for a Gateway Load Balancer.


protocol?

Type: string (optional)

The protocol for connections from clients to the load balancer.

For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.


sslPolicy?

Type: string (optional)

[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.

For more information, see Security policies in the Application Load Balancers Guide and Security policies in the Network Load Balancers Guide .