Skip to content
v2.278.0

BaseApplicationListenerRuleProps Struct ​

Basic properties for defining a rule on a listener.

Example ​

ts
// 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';

declare const applicationTargetGroup: elbv2.ApplicationTargetGroup;
declare const listenerAction: elbv2.ListenerAction;
declare const listenerCondition: elbv2.ListenerCondition;
const baseApplicationListenerRuleProps: elbv2.BaseApplicationListenerRuleProps = {
  priority: 123,

  // the properties below are optional
  action: listenerAction,
  conditions: [listenerCondition],
  targetGroups: [applicationTargetGroup],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticloadbalancingv2 as elbv2

# application_target_group: elbv2.ApplicationTargetGroup
# listener_action: elbv2.ListenerAction
# listener_condition: elbv2.ListenerCondition

base_application_listener_rule_props = elbv2.BaseApplicationListenerRuleProps(
    priority=123,

    # the properties below are optional
    action=listener_action,
    conditions=[listener_condition],
    target_groups=[application_target_group]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticloadbalancingv2.*;

ApplicationTargetGroup applicationTargetGroup;
ListenerAction listenerAction;
ListenerCondition listenerCondition;

BaseApplicationListenerRuleProps baseApplicationListenerRuleProps = BaseApplicationListenerRuleProps.builder()
        .priority(123)

        // the properties below are optional
        .action(listenerAction)
        .conditions(List.of(listenerCondition))
        .targetGroups(List.of(applicationTargetGroup))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;

ApplicationTargetGroup applicationTargetGroup;
ListenerAction listenerAction;
ListenerCondition listenerCondition;

var baseApplicationListenerRuleProps = new BaseApplicationListenerRuleProps {
    Priority = 123,

    // the properties below are optional
    Action = listenerAction,
    Conditions = new [] { listenerCondition },
    TargetGroups = new [] { applicationTargetGroup }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var applicationTargetGroup ApplicationTargetGroup
var listenerAction ListenerAction
var listenerCondition ListenerCondition

baseApplicationListenerRuleProps := &BaseApplicationListenerRuleProps{
	Priority: jsii.Number(123),

	// the properties below are optional
	Action: listenerAction,
	Conditions: []ListenerCondition{
		listenerCondition,
	},
	TargetGroups: []IApplicationTargetGroup{
		applicationTargetGroup,
	},
}

Properties ​

actionoptionalListenerActionactionoptionalListenerActionactionoptionalListenerActionActionoptionalListenerActionActionoptionalListenerAction #
Action to perform when requests are received.

Default: No action

Only one of action, fixedResponse, redirectResponse or targetGroups can be specified.

conditionsoptionalListenerCondition[]conditionsoptionaltyping.List[ListenerCondition]conditionsoptionalList<ListenerCondition>ConditionsoptionalListenerCondition[]Conditionsoptional*[]ListenerCondition #
Rule applies if matches the conditions.

Default: No conditions.

prioritynumberpriorityint | floatpriorityNumberPrioritydoublePriority*float64 required #
Priority of the rule.

The rule with the lowest priority will be used for every request.

Priorities must be unique.

targetGroupsoptionalIApplicationTargetGroup[]target_groupsoptionaltyping.List[IApplicationTargetGroup]targetGroupsoptionalList<IApplicationTargetGroup>TargetGroupsoptionalIApplicationTargetGroup[]TargetGroupsoptional*[]IApplicationTargetGroup #
Target groups to forward requests to.

Default: No target groups.

Only one of action, fixedResponse, redirectResponse or targetGroups can be specified.

Implies a forward action.