Class CfnRuleGroup
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.networkfirewall.CfnRuleGroup
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IRuleGroupRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T23:37:25.615Z")
@Stability(Stable)
public class CfnRuleGroup
extends CfnResource
implements IInspectable, IRuleGroupRef, ITaggable
Use the to define a reusable collection of stateless or stateful network traffic filtering rules. You use rule groups in an firewall policy to specify the filtering behavior of an firewall.
Example:
// 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.*;
CfnRuleGroup cfnRuleGroup = CfnRuleGroup.Builder.create(this, "MyCfnRuleGroup")
.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();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA custom action to use in stateless rule actions settings.static interfaceA single IP address specification.static final classA fluent builder forCfnRuleGroup.static interfaceAn optional, non-standard action to use for stateless packet handling.static interfaceThe value to use in an Amazon CloudWatch custom metric dimension.static interfaceThe 5-tuple criteria for AWS Network Firewall to use to inspect packet headers in stateful traffic flow inspection.static interfaceA list of IP addresses and address ranges, in CIDR notation.static interfaceConfigures one or more IP set references for a Suricata-compatible rule group.static interfaceCriteria for Network Firewall to use to inspect an individual packet in stateless rule inspection.static interfaceA single port range specification.static interfaceA set of port ranges for use in the rules in a rule group.static interfaceStateless inspection criteria that publishes the specified metrics to Amazon CloudWatch for the matching packet.static interfaceConfigures the reference sets for a stateful rule group.static interfaceThe inspection criteria and action for a single stateless rule.static interfaceThe object that defines the rules in a rule group.static interfaceAdditional settings for a stateful rule.static interfaceStateful inspection criteria for a domain list rule group.static interfaceThe stateless or stateful rules definitions for use in a single rule group.static interfaceSettings that are available for use in the rules in the rule group where this is defined.static interfaceAdditional options governing how Network Firewall handles the rule group.static interfaceA single Suricata rules specification, for use in a stateful rule group.static interfaceA single stateless rule.static interfaceStateless inspection criteria.static interfaceA complex type that specifies which Suricata rule metadata fields to use when displaying threat information.static interfaceTCP flags and masks to inspect packets for.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.networkfirewall.IRuleGroupRef
IRuleGroupRef.Jsii$Default, IRuleGroupRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnRuleGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRuleGroup(software.amazon.jsii.JsiiObjectRef objRef) CfnRuleGroup(software.constructs.Construct scope, String id, CfnRuleGroupProps props) Create a newAWS::NetworkFirewall::RuleGroup. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForRuleGroup(IRuleGroupRef resource) The Amazon Resource Name (ARN) of the rule group.The unique ID of the rule group resource.The maximum operating resources that this rule group can use.A description of the rule group.An object that defines the rule group rules.The descriptive name of the rule group.A reference to a RuleGroup resource.A complex type containing the currently selected rule option fields that will be displayed for rule summarization returned byDescribeRuleGroupSummary.getTags()Tag Manager which manages the tags for this resource.An array of key-value pairs to apply to this resource.getType()Indicates whether the rule group is stateless or stateful.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetCapacity(Number value) The maximum operating resources that this rule group can use.voidsetDescription(String value) A description of the rule group.voidsetRuleGroup(IResolvable value) An object that defines the rule group rules.voidAn object that defines the rule group rules.voidsetRuleGroupName(String value) The descriptive name of the rule group.voidA complex type containing the currently selected rule option fields that will be displayed for rule summarization returned byDescribeRuleGroupSummary.voidA complex type containing the currently selected rule option fields that will be displayed for rule summarization returned byDescribeRuleGroupSummary.voidsetTagsRaw(List<CfnTag> value) An array of key-value pairs to apply to this resource.voidIndicates whether the rule group is stateless or stateful.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRuleGroup
protected CfnRuleGroup(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRuleGroup
protected CfnRuleGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRuleGroup
@Stability(Stable) public CfnRuleGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnRuleGroupProps props) Create a newAWS::NetworkFirewall::RuleGroup.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForRuleGroup
- Parameters:
resource- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrRuleGroupArn
The Amazon Resource Name (ARN) of the rule group. -
getAttrRuleGroupId
The unique ID of the rule group resource. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getRuleGroupRef
A reference to a RuleGroup resource.- Specified by:
getRuleGroupRefin interfaceIRuleGroupRef
-
getTags
Tag Manager which manages the tags for this resource. -
getCapacity
The maximum operating resources that this rule group can use. -
setCapacity
The maximum operating resources that this rule group can use. -
getRuleGroupName
The descriptive name of the rule group. -
setRuleGroupName
The descriptive name of the rule group. -
getType
Indicates whether the rule group is stateless or stateful. -
setType
Indicates whether the rule group is stateless or stateful. -
getDescription
A description of the rule group. -
setDescription
A description of the rule group. -
getRuleGroup
An object that defines the rule group rules.Returns union: either
IResolvableorCfnRuleGroup.RuleGroupProperty -
setRuleGroup
An object that defines the rule group rules. -
setRuleGroup
An object that defines the rule group rules. -
getSummaryConfiguration
A complex type containing the currently selected rule option fields that will be displayed for rule summarization returned byDescribeRuleGroupSummary.Returns union: either
IResolvableorCfnRuleGroup.SummaryConfigurationProperty -
setSummaryConfiguration
A complex type containing the currently selected rule option fields that will be displayed for rule summarization returned byDescribeRuleGroupSummary. -
setSummaryConfiguration
@Stability(Stable) public void setSummaryConfiguration(@Nullable CfnRuleGroup.SummaryConfigurationProperty value) A complex type containing the currently selected rule option fields that will be displayed for rule summarization returned byDescribeRuleGroupSummary. -
getTagsRaw
An array of key-value pairs to apply to this resource. -
setTagsRaw
An array of key-value pairs to apply to this resource.
-