aws-cdk-lib.aws_elasticloadbalancingv2.CfnListenerRuleProps

interface CfnListenerRuleProps

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

Properties for defining a CfnListenerRule.

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 cfnListenerRuleProps: elbv2.CfnListenerRuleProps = {
  actions: [{
    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: 123,
    },
    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: 123,
      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',
  }],
  conditions: [{
    field: 'field',
    hostHeaderConfig: {
      values: ['values'],
    },
    httpHeaderConfig: {
      httpHeaderName: 'httpHeaderName',
      values: ['values'],
    },
    httpRequestMethodConfig: {
      values: ['values'],
    },
    pathPatternConfig: {
      values: ['values'],
    },
    queryStringConfig: {
      values: [{
        key: 'key',
        value: 'value',
      }],
    },
    sourceIpConfig: {
      values: ['values'],
    },
    values: ['values'],
  }],
  priority: 123,

  // the properties below are optional
  listenerArn: 'listenerArn',
};

Properties

NameTypeDescription
actionsIResolvable | IResolvable | ActionProperty[]The actions.
conditionsIResolvable | IResolvable | RuleConditionProperty[]The conditions.
prioritynumberThe rule priority. A listener can't have multiple rules with the same priority.
listenerArn?stringThe Amazon Resource Name (ARN) of the listener.

actions

Type: IResolvable | IResolvable | ActionProperty[]

The actions.

The rule must include exactly one of the following types of actions: forward , fixed-response , or redirect , and it must be the last action to be performed. If the rule is for an HTTPS listener, it can also optionally include an authentication action.


conditions

Type: IResolvable | IResolvable | RuleConditionProperty[]

The conditions.

The rule can optionally include up to one of each of the following conditions: http-request-method , host-header , path-pattern , and source-ip . A rule can also optionally include one or more of each of the following conditions: http-header and query-string .


priority

Type: number

The rule priority. A listener can't have multiple rules with the same priority.

If you try to reorder rules by updating their priorities, do not specify a new priority if an existing rule already uses this priority, as this can cause an error. If you need to reuse a priority with a different rule, you must remove it as a priority first, and then specify it in a subsequent update.


listenerArn?

Type: string (optional)

The Amazon Resource Name (ARN) of the listener.