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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:00.414Z") @Stability(Stable) public class CfnRuleGroup extends CfnResource implements IInspectable
A CloudFormation AWS::NetworkFirewall::RuleGroup.

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();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnRuleGroupProps props)
      Create a new AWS::NetworkFirewall::RuleGroup.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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()
      An array of key-value pairs to apply to this resource.

      For more information, see Tag .

    • getCapacity

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

      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.

    • setCapacity

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

      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.

    • getRuleGroupName

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

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

    • setRuleGroupName

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

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

    • getType

      @Stability(Stable) @NotNull public String getType()
      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.

    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      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.

    • 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.