Skip to content
v2.278.0

StatelessRulesAndCustomActionsProperty Struct ​

Stateless inspection criteria.

Each stateless rule group uses exactly one of these data types to define its stateless rules.

Example ​

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 statelessRulesAndCustomActionsProperty: networkfirewall.CfnRuleGroup.StatelessRulesAndCustomActionsProperty = {
  statelessRules: [{
    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'],
        }],
      },
    },
  }],

  // the properties below are optional
  customActions: [{
    actionDefinition: {
      publishMetricAction: {
        dimensions: [{
          value: 'value',
        }],
      },
    },
    actionName: 'actionName',
  }],
};
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_rules_and_custom_actions_property = networkfirewall.CfnRuleGroup.StatelessRulesAndCustomActionsProperty(
    stateless_rules=[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"]
                )]
            )
        )
    )],

    # the properties below are optional
    custom_actions=[networkfirewall.CfnRuleGroup.CustomActionProperty(
        action_definition=networkfirewall.CfnRuleGroup.ActionDefinitionProperty(
            publish_metric_action=networkfirewall.CfnRuleGroup.PublishMetricActionProperty(
                dimensions=[networkfirewall.CfnRuleGroup.DimensionProperty(
                    value="value"
                )]
            )
        ),
        action_name="actionName"
    )]
)
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.*;

StatelessRulesAndCustomActionsProperty statelessRulesAndCustomActionsProperty = StatelessRulesAndCustomActionsProperty.builder()
        .statelessRules(List.of(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()))

        // the properties below are optional
        .customActions(List.of(CustomActionProperty.builder()
                .actionDefinition(ActionDefinitionProperty.builder()
                        .publishMetricAction(PublishMetricActionProperty.builder()
                                .dimensions(List.of(DimensionProperty.builder()
                                        .value("value")
                                        .build()))
                                .build())
                        .build())
                .actionName("actionName")
                .build()))
        .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.NetworkFirewall;

var statelessRulesAndCustomActionsProperty = new StatelessRulesAndCustomActionsProperty {
    StatelessRules = new [] { 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" }
                } }
            }
        }
    } },

    // the properties below are optional
    CustomActions = new [] { new CustomActionProperty {
        ActionDefinition = new ActionDefinitionProperty {
            PublishMetricAction = new PublishMetricActionProperty {
                Dimensions = new [] { new DimensionProperty {
                    Value = "value"
                } }
            }
        },
        ActionName = "actionName"
    } }
};
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"

statelessRulesAndCustomActionsProperty := &StatelessRulesAndCustomActionsProperty{
	StatelessRules: []interface{}{
		&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"),
							},
						},
					},
				},
			},
		},
	},

	// the properties below are optional
	CustomActions: []interface{}{
		&CustomActionProperty{
			ActionDefinition: &ActionDefinitionProperty{
				PublishMetricAction: &PublishMetricActionProperty{
					Dimensions: []interface{}{
						&DimensionProperty{
							Value: jsii.String("value"),
						},
					},
				},
			},
			ActionName: jsii.String("actionName"),
		},
	},
}

Properties ​

customActionsoptionalIResolvable | IResolvable | CfnRuleGroup.CustomActionProperty[]custom_actionsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CustomActionProperty]]]customActionsoptionalIResolvableCustomActionsoptionalIResolvableCustomActionsoptionalinterface{} #
Defines an array of individual custom action definitions that are available for use by the stateless rules in this `StatelessRulesAndCustomActions` specification.

You name each custom action that you define, and then you can use it by name in your stateless rule definition Actions specification.

statelessRulesIResolvable | IResolvable | CfnRuleGroup.StatelessRuleProperty[]stateless_rulestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, StatelessRuleProperty]]]statelessRulesIResolvableStatelessRulesIResolvableStatelessRulesinterface{} required #
Defines the set of stateless rules for use in a stateless rule group.