# StatelessRuleProperty

A single stateless rule.

This is used in `StatelessRulesAndCustomActions` .

- 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_networkfirewall as networkfirewall } from 'aws-cdk-lib';
const statelessRuleProperty: networkfirewall.CfnRuleGroup.StatelessRuleProperty = {
  priority: 123,
  ruleDefinition: {
    actions: ['actions'],
    matchAttributes: {
      destinationPorts: [{
        fromPort: 123,
        toPort: 123,
      }],
      destinations: [{
        addressDefinition: 'addressDefinition',
      }],
      protocols: [123],
      sourcePorts: [{
        fromPort: 123,
        toPort: 123,
      }],
      sources: [{
        addressDefinition: 'addressDefinition',
      }],
      tcpFlags: [{
        flags: ['flags'],

        // the properties below are optional
        masks: ['masks'],
      }],
    },
  },
};
```

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_networkfirewall as networkfirewall

stateless_rule_property = networkfirewall.CfnRuleGroup.StatelessRuleProperty(
    priority=123,
    rule_definition=networkfirewall.CfnRuleGroup.RuleDefinitionProperty(
        actions=["actions"],
        match_attributes=networkfirewall.CfnRuleGroup.MatchAttributesProperty(
            destination_ports=[networkfirewall.CfnRuleGroup.PortRangeProperty(
                from_port=123,
                to_port=123
            )],
            destinations=[networkfirewall.CfnRuleGroup.AddressProperty(
                address_definition="addressDefinition"
            )],
            protocols=[123],
            source_ports=[networkfirewall.CfnRuleGroup.PortRangeProperty(
                from_port=123,
                to_port=123
            )],
            sources=[networkfirewall.CfnRuleGroup.AddressProperty(
                address_definition="addressDefinition"
            )],
            tcp_flags=[networkfirewall.CfnRuleGroup.TCPFlagFieldProperty(
                flags=["flags"],

                # the properties below are optional
                masks=["masks"]
            )]
        )
    )
)
```

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

StatelessRuleProperty statelessRuleProperty = StatelessRuleProperty.builder()
        .priority(123)
        .ruleDefinition(RuleDefinitionProperty.builder()
                .actions(List.of("actions"))
                .matchAttributes(MatchAttributesProperty.builder()
                        .destinationPorts(List.of(PortRangeProperty.builder()
                                .fromPort(123)
                                .toPort(123)
                                .build()))
                        .destinations(List.of(AddressProperty.builder()
                                .addressDefinition("addressDefinition")
                                .build()))
                        .protocols(List.of(123))
                        .sourcePorts(List.of(PortRangeProperty.builder()
                                .fromPort(123)
                                .toPort(123)
                                .build()))
                        .sources(List.of(AddressProperty.builder()
                                .addressDefinition("addressDefinition")
                                .build()))
                        .tcpFlags(List.of(TCPFlagFieldProperty.builder()
                                .flags(List.of("flags"))

                                // the properties below are optional
                                .masks(List.of("masks"))
                                .build()))
                        .build())
                .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.NetworkFirewall;

var statelessRuleProperty = new StatelessRuleProperty {
    Priority = 123,
    RuleDefinition = new RuleDefinitionProperty {
        Actions = new [] { "actions" },
        MatchAttributes = new MatchAttributesProperty {
            DestinationPorts = new [] { new PortRangeProperty {
                FromPort = 123,
                ToPort = 123
            } },
            Destinations = new [] { new AddressProperty {
                AddressDefinition = "addressDefinition"
            } },
            Protocols = new [] { 123 },
            SourcePorts = new [] { new PortRangeProperty {
                FromPort = 123,
                ToPort = 123
            } },
            Sources = new [] { new AddressProperty {
                AddressDefinition = "addressDefinition"
            } },
            TcpFlags = new [] { new TCPFlagFieldProperty {
                Flags = new [] { "flags" },

                // the properties below are optional
                Masks = new [] { "masks" }
            } }
        }
    }
};
```

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"

statelessRuleProperty := &StatelessRuleProperty{
	Priority: jsii.Number(123),
	RuleDefinition: &RuleDefinitionProperty{
		Actions: []*string{
			jsii.String("actions"),
		},
		MatchAttributes: &MatchAttributesProperty{
			DestinationPorts: []interface{}{
				&PortRangeProperty{
					FromPort: jsii.Number(123),
					ToPort: jsii.Number(123),
				},
			},
			Destinations: []interface{}{
				&AddressProperty{
					AddressDefinition: jsii.String("addressDefinition"),
				},
			},
			Protocols: []interface{}{
				jsii.Number(123),
			},
			SourcePorts: []interface{}{
				&PortRangeProperty{
					FromPort: jsii.Number(123),
					ToPort: jsii.Number(123),
				},
			},
			Sources: []interface{}{
				&AddressProperty{
					AddressDefinition: jsii.String("addressDefinition"),
				},
			},
			TcpFlags: []interface{}{
				&TCPFlagFieldProperty{
					Flags: []*string{
						jsii.String("flags"),
					},

					// the properties below are optional
					Masks: []*string{
						jsii.String("masks"),
					},
				},
			},
		},
	},
}
```

## Properties

- `priority`: number (required) — Indicates the order in which to run this rule relative to all of the rules that are defined for a stateless rule group.

  Network Firewall evaluates the rules in a rule group starting with the lowest priority setting. You must ensure that the priority settings are unique for the rule group.

  Each stateless rule group uses exactly one `StatelessRulesAndCustomActions` object, and each `StatelessRulesAndCustomActions` contains exactly one `StatelessRules` object. To ensure unique priority settings for your rule groups, set unique priorities for the stateless rules that you define inside any single `StatelessRules` object.

  You can change the priority settings of your rules at any time. To make it easier to insert rules later, number them so there's a wide range in between, for example use 100, 200, and so on.

- `ruleDefinition`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnRuleGroup.RuleDefinitionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_networkfirewall.CfnRuleGroup.RuleDefinitionProperty.html) (required) — Defines the stateless 5-tuple packet inspection criteria and the action to take on a packet that matches the criteria.
