Skip to content
v2.278.0

CfnRuleGroupProps Struct ​

Properties for defining a CfnRuleGroup.

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 cfnRuleGroupProps: networkfirewall.CfnRuleGroupProps = {
  capacity: 123,
  ruleGroupName: 'ruleGroupName',
  type: 'type',

  // the properties below are optional
  description: 'description',
  ruleGroup: {
    rulesSource: {
      rulesSourceList: {
        generatedRulesType: 'generatedRulesType',
        targets: ['targets'],
        targetTypes: ['targetTypes'],
      },
      rulesString: 'rulesString',
      statefulRules: [{
        action: 'action',
        header: {
          destination: 'destination',
          destinationPort: 'destinationPort',
          direction: 'direction',
          protocol: 'protocol',
          source: 'source',
          sourcePort: 'sourcePort',
        },
        ruleOptions: [{
          keyword: 'keyword',

          // the properties below are optional
          settings: ['settings'],
        }],
      }],
      statelessRulesAndCustomActions: {
        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',
        }],
      },
    },

    // the properties below are optional
    referenceSets: {
      ipSetReferences: {
        ipSetReferencesKey: {
          referenceArn: 'referenceArn',
        },
      },
    },
    ruleVariables: {
      ipSets: {
        ipSetsKey: {
          definition: ['definition'],
        },
      },
      portSets: {
        portSetsKey: {
          definition: ['definition'],
        },
      },
    },
    statefulRuleOptions: {
      ruleOrder: 'ruleOrder',
    },
  },
  summaryConfiguration: {
    ruleOptions: ['ruleOptions'],
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
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_networkfirewall as networkfirewall

cfn_rule_group_props = networkfirewall.CfnRuleGroupProps(
    capacity=123,
    rule_group_name="ruleGroupName",
    type="type",

    # the properties below are optional
    description="description",
    rule_group=networkfirewall.CfnRuleGroup.RuleGroupProperty(
        rules_source=networkfirewall.CfnRuleGroup.RulesSourceProperty(
            rules_source_list=networkfirewall.CfnRuleGroup.RulesSourceListProperty(
                generated_rules_type="generatedRulesType",
                targets=["targets"],
                target_types=["targetTypes"]
            ),
            rules_string="rulesString",
            stateful_rules=[networkfirewall.CfnRuleGroup.StatefulRuleProperty(
                action="action",
                header=networkfirewall.CfnRuleGroup.HeaderProperty(
                    destination="destination",
                    destination_port="destinationPort",
                    direction="direction",
                    protocol="protocol",
                    source="source",
                    source_port="sourcePort"
                ),
                rule_options=[networkfirewall.CfnRuleGroup.RuleOptionProperty(
                    keyword="keyword",

                    # the properties below are optional
                    settings=["settings"]
                )]
            )],
            stateless_rules_and_custom_actions=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"
                )]
            )
        ),

        # the properties below are optional
        reference_sets=networkfirewall.CfnRuleGroup.ReferenceSetsProperty(
            ip_set_references={
                "ip_set_references_key": {
                    "reference_arn": "referenceArn"
                }
            }
        ),
        rule_variables=networkfirewall.CfnRuleGroup.RuleVariablesProperty(
            ip_sets={
                "ip_sets_key": {
                    "definition": ["definition"]
                }
            },
            port_sets={
                "port_sets_key": networkfirewall.CfnRuleGroup.PortSetProperty(
                    definition=["definition"]
                )
            }
        ),
        stateful_rule_options=networkfirewall.CfnRuleGroup.StatefulRuleOptionsProperty(
            rule_order="ruleOrder"
        )
    ),
    summary_configuration=networkfirewall.CfnRuleGroup.SummaryConfigurationProperty(
        rule_options=["ruleOptions"]
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
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.*;

CfnRuleGroupProps cfnRuleGroupProps = CfnRuleGroupProps.builder()
        .capacity(123)
        .ruleGroupName("ruleGroupName")
        .type("type")

        // the properties below are optional
        .description("description")
        .ruleGroup(RuleGroupProperty.builder()
                .rulesSource(RulesSourceProperty.builder()
                        .rulesSourceList(RulesSourceListProperty.builder()
                                .generatedRulesType("generatedRulesType")
                                .targets(List.of("targets"))
                                .targetTypes(List.of("targetTypes"))
                                .build())
                        .rulesString("rulesString")
                        .statefulRules(List.of(StatefulRuleProperty.builder()
                                .action("action")
                                .header(HeaderProperty.builder()
                                        .destination("destination")
                                        .destinationPort("destinationPort")
                                        .direction("direction")
                                        .protocol("protocol")
                                        .source("source")
                                        .sourcePort("sourcePort")
                                        .build())
                                .ruleOptions(List.of(RuleOptionProperty.builder()
                                        .keyword("keyword")

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

                // the properties below are optional
                .referenceSets(ReferenceSetsProperty.builder()
                        .ipSetReferences(Map.of(
                                "ipSetReferencesKey", Map.of(
                                        "referenceArn", "referenceArn")))
                        .build())
                .ruleVariables(RuleVariablesProperty.builder()
                        .ipSets(Map.of(
                                "ipSetsKey", Map.of(
                                        "definition", List.of("definition"))))
                        .portSets(Map.of(
                                "portSetsKey", PortSetProperty.builder()
                                        .definition(List.of("definition"))
                                        .build()))
                        .build())
                .statefulRuleOptions(StatefulRuleOptionsProperty.builder()
                        .ruleOrder("ruleOrder")
                        .build())
                .build())
        .summaryConfiguration(SummaryConfigurationProperty.builder()
                .ruleOptions(List.of("ruleOptions"))
                .build())
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .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 cfnRuleGroupProps = new CfnRuleGroupProps {
    Capacity = 123,
    RuleGroupName = "ruleGroupName",
    Type = "type",

    // the properties below are optional
    Description = "description",
    RuleGroup = new RuleGroupProperty {
        RulesSource = new RulesSourceProperty {
            RulesSourceList = new RulesSourceListProperty {
                GeneratedRulesType = "generatedRulesType",
                Targets = new [] { "targets" },
                TargetTypes = new [] { "targetTypes" }
            },
            RulesString = "rulesString",
            StatefulRules = new [] { new StatefulRuleProperty {
                Action = "action",
                Header = new HeaderProperty {
                    Destination = "destination",
                    DestinationPort = "destinationPort",
                    Direction = "direction",
                    Protocol = "protocol",
                    Source = "source",
                    SourcePort = "sourcePort"
                },
                RuleOptions = new [] { new RuleOptionProperty {
                    Keyword = "keyword",

                    // the properties below are optional
                    Settings = new [] { "settings" }
                } }
            } },
            StatelessRulesAndCustomActions = 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"
                } }
            }
        },

        // the properties below are optional
        ReferenceSets = new ReferenceSetsProperty {
            IpSetReferences = new Dictionary<string, object> {
                { "ipSetReferencesKey", new Dictionary<string, string?> {
                    { "referenceArn", "referenceArn" }
                } }
            }
        },
        RuleVariables = new RuleVariablesProperty {
            IpSets = new Dictionary<string, object> {
                { "ipSetsKey", new Dictionary<string, string[]?> {
                    { "definition", new [] { "definition" } }
                } }
            },
            PortSets = new Dictionary<string, object> {
                { "portSetsKey", new PortSetProperty {
                    Definition = new [] { "definition" }
                } }
            }
        },
        StatefulRuleOptions = new StatefulRuleOptionsProperty {
            RuleOrder = "ruleOrder"
        }
    },
    SummaryConfiguration = new SummaryConfigurationProperty {
        RuleOptions = new [] { "ruleOptions" }
    },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
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"

cfnRuleGroupProps := &CfnRuleGroupProps{
	Capacity: jsii.Number(123),
	RuleGroupName: jsii.String("ruleGroupName"),
	Type: jsii.String("type"),

	// the properties below are optional
	Description: jsii.String("description"),
	RuleGroup: &RuleGroupProperty{
		RulesSource: &RulesSourceProperty{
			RulesSourceList: &RulesSourceListProperty{
				GeneratedRulesType: jsii.String("generatedRulesType"),
				Targets: []*string{
					jsii.String("targets"),
				},
				TargetTypes: []*string{
					jsii.String("targetTypes"),
				},
			},
			RulesString: jsii.String("rulesString"),
			StatefulRules: []interface{}{
				&StatefulRuleProperty{
					Action: jsii.String("action"),
					Header: &HeaderProperty{
						Destination: jsii.String("destination"),
						DestinationPort: jsii.String("destinationPort"),
						Direction: jsii.String("direction"),
						Protocol: jsii.String("protocol"),
						Source: jsii.String("source"),
						SourcePort: jsii.String("sourcePort"),
					},
					RuleOptions: []interface{}{
						&RuleOptionProperty{
							Keyword: jsii.String("keyword"),

							// the properties below are optional
							Settings: []*string{
								jsii.String("settings"),
							},
						},
					},
				},
			},
			StatelessRulesAndCustomActions: &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"),
					},
				},
			},
		},

		// the properties below are optional
		ReferenceSets: &ReferenceSetsProperty{
			IpSetReferences: map[string]interface{}{
				"ipSetReferencesKey": map[string]*string{
					"referenceArn": jsii.String("referenceArn"),
				},
			},
		},
		RuleVariables: &RuleVariablesProperty{
			IpSets: map[string]interface{}{
				"ipSetsKey": map[string][]*string{
					"definition": []*string{
						jsii.String("definition"),
					},
				},
			},
			PortSets: map[string]interface{}{
				"portSetsKey": &PortSetProperty{
					"definition": []*string{
						jsii.String("definition"),
					},
				},
			},
		},
		StatefulRuleOptions: &StatefulRuleOptionsProperty{
			RuleOrder: jsii.String("ruleOrder"),
		},
	},
	SummaryConfiguration: &SummaryConfigurationProperty{
		RuleOptions: []*string{
			jsii.String("ruleOptions"),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

capacitynumbercapacityint | floatcapacityNumberCapacitydoubleCapacity*float64 required #
The maximum operating resources that this rule group can use.
notes

You can't change a rule group's capacity setting after you create the rule group. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
A description of the rule group.
ruleGroupoptionalIResolvable | CfnRuleGroup.RuleGroupPropertyrule_groupoptionaltyping.Union[IResolvable, RuleGroupProperty]ruleGroupoptionalIResolvableRuleGroupoptionalIResolvableRuleGroupoptionalinterface{} #
An object that defines the rule group rules.
ruleGroupNamestringrule_group_namestrruleGroupNameStringRuleGroupNamestringRuleGroupName*string required #
The descriptive name of the rule group.

You can't change the name of a rule group after you create it.

summaryConfigurationoptionalIResolvable | CfnRuleGroup.SummaryConfigurationPropertysummary_configurationoptionaltyping.Union[IResolvable, SummaryConfigurationProperty]summaryConfigurationoptionalIResolvableSummaryConfigurationoptionalIResolvableSummaryConfigurationoptionalinterface{} #
A complex type containing the currently selected rule option fields that will be displayed for rule summarization returned by `DescribeRuleGroupSummary` .
  • The RuleOptions specified in SummaryConfiguration
  • Rule metadata organization preferences
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
An array of key-value pairs to apply to this resource.

For more information, see Tag .

typestringtypestrtypeStringTypestringType*string required #
Indicates whether the rule group is stateless or stateful.

If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.