# CfnRuleProps

Properties for defining a `CfnRule`.

Used as props by: [CfnRule](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_networksecuritymanager.CfnRule.html)

- Source: Generated at build time
- Type last changed: v2.273.0 · 8 Oct 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_networksecuritymanager as networksecuritymanager } from 'aws-cdk-lib';
const cfnRuleProps: networksecuritymanager.CfnRuleProps = {
  ruleName: 'ruleName',

  // the properties below are optional
  configuration: 'configuration',
  firewallType: 'firewallType',
  ruleDescription: 'ruleDescription',
  ruleType: 'ruleType',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_networksecuritymanager as networksecuritymanager

cfn_rule_props = networksecuritymanager.CfnRuleProps(
    rule_name="ruleName",

    # the properties below are optional
    configuration="configuration",
    firewall_type="firewallType",
    rule_description="ruleDescription",
    rule_type="ruleType",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

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

CfnRuleProps cfnRuleProps = CfnRuleProps.builder()
        .ruleName("ruleName")

        // the properties below are optional
        .configuration("configuration")
        .firewallType("firewallType")
        .ruleDescription("ruleDescription")
        .ruleType("ruleType")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .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.NetworkSecurityManager;

var cfnRuleProps = new CfnRuleProps {
    RuleName = "ruleName",

    // the properties below are optional
    Configuration = "configuration",
    FirewallType = "firewallType",
    RuleDescription = "ruleDescription",
    RuleType = "ruleType",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

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"

cfnRuleProps := &CfnRuleProps{
	RuleName: jsii.String("ruleName"),

	// the properties below are optional
	Configuration: jsii.String("configuration"),
	FirewallType: jsii.String("firewallType"),
	RuleDescription: jsii.String("ruleDescription"),
	RuleType: jsii.String("ruleType"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `configuration`: string — The rule configuration as a JSON string.

- `firewallType`: string — The type of firewall for this rule.

- `ruleDescription`: string — A description of the rule.

- `ruleName`: string (required) — The name of the rule.

- `ruleType`: string — The type of rule.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — The tags associated with the rule.
