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

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-10-08T16:59:59.240Z") @Stability(Stable) public class CfnRule extends CfnResource implements IInspectable, IRuleRef, ITaggableV2
Resource Type definition for AWS::NetworkSecurityManager::Rule.

Creates and manages a Network Security Manager rule.

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.networksecuritymanager.*;
 CfnRule cfnRule = CfnRule.Builder.create(this, "MyCfnRule")
         .ruleName("ruleName")
         // the properties below are optional
         .configuration("configuration")
         .firewallType("firewallType")
         .ruleDescription("ruleDescription")
         .ruleType("ruleType")
         .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

    • CfnRule

      protected CfnRule(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnRule

      protected CfnRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnRule

      @Stability(Stable) public CfnRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnRuleProps props)
      Create a new AWS::NetworkSecurityManager::Rule.

      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

    • arnForRule

      @Stability(Stable) @NotNull public static String arnForRule(@NotNull IRuleRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnRule

      @Stability(Stable) @NotNull public static Boolean isCfnRule(@NotNull Object x)
      Checks whether the given object is a CfnRule.

      Parameters:
      x - This parameter is required.
    • 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.
    • getAttrRuleArn

      @Stability(Stable) @NotNull public String getAttrRuleArn()
      The Amazon Resource Name (ARN) of the rule.
    • getAttrRuleId

      @Stability(Stable) @NotNull public String getAttrRuleId()
      The unique identifier of the rule.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The status of the rule.
    • getAttrVersion

      @Stability(Stable) @NotNull public String getAttrVersion()
      The version number of the rule.
    • getCdkTagManager

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

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

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getRuleRef

      @Stability(Stable) @NotNull public RuleReference getRuleRef()
      A reference to a Rule resource.
      Specified by:
      getRuleRef in interface IRuleRef
    • getRuleName

      @Stability(Stable) @NotNull public String getRuleName()
      The name of the rule.
    • setRuleName

      @Stability(Stable) public void setRuleName(@NotNull String value)
      The name of the rule.
    • getConfiguration

      @Stability(Stable) @Nullable public String getConfiguration()
      The rule configuration as a JSON string.
    • setConfiguration

      @Stability(Stable) public void setConfiguration(@Nullable String value)
      The rule configuration as a JSON string.
    • getFirewallType

      @Stability(Stable) @Nullable public String getFirewallType()
      The type of firewall for this rule.
    • setFirewallType

      @Stability(Stable) public void setFirewallType(@Nullable String value)
      The type of firewall for this rule.
    • getRuleDescription

      @Stability(Stable) @Nullable public String getRuleDescription()
      A description of the rule.
    • setRuleDescription

      @Stability(Stable) public void setRuleDescription(@Nullable String value)
      A description of the rule.
    • getRuleType

      @Stability(Stable) @Nullable public String getRuleType()
      The type of rule.
    • setRuleType

      @Stability(Stable) public void setRuleType(@Nullable String value)
      The type of rule.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      The tags associated with the rule.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      The tags associated with the rule.