Skip to content
v2.278.0

AddRuleProps Struct ​

Properties for adding a conditional load balancing rule.

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 listenerCondition: elbv2.ListenerCondition;
const addRuleProps: elbv2.AddRuleProps = {
  conditions: [listenerCondition],
  priority: 123,
};
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

# listener_condition: elbv2.ListenerCondition

add_rule_props = elbv2.AddRuleProps(
    conditions=[listener_condition],
    priority=123
)
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.*;

ListenerCondition listenerCondition;

AddRuleProps addRuleProps = AddRuleProps.builder()
        .conditions(List.of(listenerCondition))
        .priority(123)
        .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;

ListenerCondition listenerCondition;

var addRuleProps = new AddRuleProps {
    Conditions = new [] { listenerCondition },
    Priority = 123
};
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 listenerCondition ListenerCondition

addRuleProps := &AddRuleProps{
	Conditions: []ListenerCondition{
		listenerCondition,
	},
	Priority: jsii.Number(123),
}

Properties ​

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

Default: No conditions.

priorityoptionalnumberpriorityoptionalint | floatpriorityoptionalNumberPriorityoptionaldoublePriorityoptional*float64 #
Priority of this target group.

Default: Target groups are used as defaults

The rule with the lowest priority will be used for every request. If priority is not given, these target groups will be added as defaults, and must not have conditions.

Priorities must be unique.