# BaseApplicationListenerRuleProps

Basic properties for defining a rule on a listener.

- Source: [`aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.ts#L18)

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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 }
};
```

Golang:

```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

- `action`: [ListenerAction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ListenerAction.html) — Action to perform when requests are received.

  **Default:** No action

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

- `conditions`: [ListenerCondition](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ListenerCondition.html)[] — Rule applies if matches the conditions.

  **Default:** No conditions.

- `priority`: number (required) — Priority of the rule.

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

  Priorities must be unique.

- `targetGroups`: [IApplicationTargetGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationTargetGroup.html)[] — 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.
