java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:20.154Z") @Stability(Stable) public class CfnRuleGroup extends CfnResource implements IInspectable, ITaggable
Use the RuleGroup to define a reusable collection of stateless or stateful network traffic filtering rules.

You use rule groups in an FirewallPolicy 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())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrRuleGroupArn

      @Stability(Stable) @NotNull public String getAttrRuleGroupArn()
      The Amazon Resource Name (ARN) of the RuleGroup .
    • getAttrRuleGroupId

      @Stability(Stable) @NotNull public String getAttrRuleGroupId()
      The unique ID of the RuleGroup resource.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getCapacity

      @Stability(Stable) @NotNull public Number getCapacity()
      The maximum operating resources that this rule group can use.
    • setCapacity

      @Stability(Stable) public void setCapacity(@NotNull Number value)
      The maximum operating resources that this rule group can use.
    • getRuleGroupName

      @Stability(Stable) @NotNull public String getRuleGroupName()
      The descriptive name of the rule group.
    • setRuleGroupName

      @Stability(Stable) public void setRuleGroupName(@NotNull String value)
      The descriptive name of the rule group.
    • getType

      @Stability(Stable) @NotNull public String getType()
      Indicates whether the rule group is stateless or stateful.
    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      Indicates whether the rule group is stateless or stateful.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description of the rule group.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description of the rule group.
    • getRuleGroup

      @Stability(Stable) @Nullable public Object getRuleGroup()
      An object that defines the rule group rules.
    • setRuleGroup

      @Stability(Stable) public void setRuleGroup(@Nullable IResolvable value)
      An object that defines the rule group rules.
    • setRuleGroup

      @Stability(Stable) public void setRuleGroup(@Nullable CfnRuleGroup.RuleGroupProperty value)
      An object that defines the rule group rules.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      An array of key-value pairs to apply to this resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to this resource.