# ActivatedRuleProperty

The `ActivatedRule` object in an `UpdateWebACL` request specifies a `Rule` that you want to insert or delete, the priority of the `Rule` in the `WebACL` , and the action that you want AWS WAF to take when a web request matches the `Rule` ( `ALLOW` , `BLOCK` , or `COUNT` ).

To specify whether to insert or delete a `Rule` , use the `Action` parameter in the `WebACLUpdate` data type.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_waf as waf } from 'aws-cdk-lib';
const activatedRuleProperty: waf.CfnWebACL.ActivatedRuleProperty = {
  priority: 123,
  ruleId: 'ruleId',

  // the properties below are optional
  action: {
    type: 'type',
  },
};
```

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_waf as waf

activated_rule_property = waf.CfnWebACL.ActivatedRuleProperty(
    priority=123,
    rule_id="ruleId",

    # the properties below are optional
    action=waf.CfnWebACL.WafActionProperty(
        type="type"
    )
)
```

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.waf.*;

ActivatedRuleProperty activatedRuleProperty = ActivatedRuleProperty.builder()
        .priority(123)
        .ruleId("ruleId")

        // the properties below are optional
        .action(WafActionProperty.builder()
                .type("type")
                .build())
        .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.WAF;

var activatedRuleProperty = new ActivatedRuleProperty {
    Priority = 123,
    RuleId = "ruleId",

    // the properties below are optional
    Action = new WafActionProperty {
        Type = "type"
    }
};
```

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"

activatedRuleProperty := &ActivatedRuleProperty{
	Priority: jsii.Number(123),
	RuleId: jsii.String("ruleId"),

	// the properties below are optional
	Action: &WafActionProperty{
		Type: jsii.String("type"),
	},
}
```

## Properties

- `action`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnWebACL.WafActionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_waf.CfnWebACL.WafActionProperty.html) — Specifies the action that Amazon CloudFront or AWS WAF takes when a web request matches the conditions in the `Rule` .

  Valid values for `Action` include the following:

  - `ALLOW` : CloudFront responds with the requested object.
  - `BLOCK` : CloudFront responds with an HTTP 403 (Forbidden) status code.
  - `COUNT` : AWS WAF increments a counter of requests that match the conditions in the rule and then continues to inspect the web request based on the remaining rules in the web ACL.

  `ActivatedRule|OverrideAction` applies only when updating or adding a `RuleGroup` to a `WebACL` . In this case, you do not use `ActivatedRule|Action` . For all other update requests, `ActivatedRule|Action` is used instead of `ActivatedRule|OverrideAction` .

- `priority`: number (required) — Specifies the order in which the `Rules` in a `WebACL` are evaluated.

  Rules with a lower value for `Priority` are evaluated before `Rules` with a higher value. The value must be a unique integer. If you add multiple `Rules` to a `WebACL` , the values don't need to be consecutive.

- `ruleId`: string (required) — The `RuleId` for a `Rule` .

  You use `RuleId` to get more information about a `Rule` , update a `Rule` , insert a `Rule` into a `WebACL` or delete a one from a `WebACL` , or delete a `Rule` from AWS WAF .

  `RuleId` is returned by `CreateRule` and by `ListRules` .
