Class CfnTrafficMirrorFilterRule

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

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:22.608Z") @Stability(Stable) public class CfnTrafficMirrorFilterRule extends CfnResource implements IInspectable
Creates a Traffic Mirror filter rule.

A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror.

You need the Traffic Mirror filter ID when you create the 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.ec2.*;
 CfnTrafficMirrorFilterRule cfnTrafficMirrorFilterRule = CfnTrafficMirrorFilterRule.Builder.create(this, "MyCfnTrafficMirrorFilterRule")
         .destinationCidrBlock("destinationCidrBlock")
         .ruleAction("ruleAction")
         .ruleNumber(123)
         .sourceCidrBlock("sourceCidrBlock")
         .trafficDirection("trafficDirection")
         .trafficMirrorFilterId("trafficMirrorFilterId")
         // the properties below are optional
         .description("description")
         .destinationPortRange(TrafficMirrorPortRangeProperty.builder()
                 .fromPort(123)
                 .toPort(123)
                 .build())
         .protocol(123)
         .sourcePortRange(TrafficMirrorPortRangeProperty.builder()
                 .fromPort(123)
                 .toPort(123)
                 .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

    • CfnTrafficMirrorFilterRule

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

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

      @Stability(Stable) public CfnTrafficMirrorFilterRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnTrafficMirrorFilterRuleProps 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.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getCfnProperties

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

      @Stability(Stable) @NotNull public String getDestinationCidrBlock()
      The destination CIDR block to assign to the Traffic Mirror rule.
    • setDestinationCidrBlock

      @Stability(Stable) public void setDestinationCidrBlock(@NotNull String value)
      The destination CIDR block to assign to the Traffic Mirror rule.
    • getRuleAction

      @Stability(Stable) @NotNull public String getRuleAction()
      The action to take on the filtered traffic.
    • setRuleAction

      @Stability(Stable) public void setRuleAction(@NotNull String value)
      The action to take on the filtered traffic.
    • getRuleNumber

      @Stability(Stable) @NotNull public Number getRuleNumber()
      The number of the Traffic Mirror rule.
    • setRuleNumber

      @Stability(Stable) public void setRuleNumber(@NotNull Number value)
      The number of the Traffic Mirror rule.
    • getSourceCidrBlock

      @Stability(Stable) @NotNull public String getSourceCidrBlock()
      The source CIDR block to assign to the Traffic Mirror rule.
    • setSourceCidrBlock

      @Stability(Stable) public void setSourceCidrBlock(@NotNull String value)
      The source CIDR block to assign to the Traffic Mirror rule.
    • getTrafficDirection

      @Stability(Stable) @NotNull public String getTrafficDirection()
      The type of traffic.
    • setTrafficDirection

      @Stability(Stable) public void setTrafficDirection(@NotNull String value)
      The type of traffic.
    • getTrafficMirrorFilterId

      @Stability(Stable) @NotNull public String getTrafficMirrorFilterId()
      The ID of the filter that this rule is associated with.
    • setTrafficMirrorFilterId

      @Stability(Stable) public void setTrafficMirrorFilterId(@NotNull String value)
      The ID of the filter that this rule is associated with.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the Traffic Mirror rule.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the Traffic Mirror rule.
    • getDestinationPortRange

      @Stability(Stable) @Nullable public Object getDestinationPortRange()
      The destination port range.
    • setDestinationPortRange

      @Stability(Stable) public void setDestinationPortRange(@Nullable IResolvable value)
      The destination port range.
    • setDestinationPortRange

      @Stability(Stable) public void setDestinationPortRange(@Nullable CfnTrafficMirrorFilterRule.TrafficMirrorPortRangeProperty value)
      The destination port range.
    • getProtocol

      @Stability(Stable) @Nullable public Number getProtocol()
      The protocol, for example UDP, to assign to the Traffic Mirror rule.
    • setProtocol

      @Stability(Stable) public void setProtocol(@Nullable Number value)
      The protocol, for example UDP, to assign to the Traffic Mirror rule.
    • getSourcePortRange

      @Stability(Stable) @Nullable public Object getSourcePortRange()
      The source port range.
    • setSourcePortRange

      @Stability(Stable) public void setSourcePortRange(@Nullable IResolvable value)
      The source port range.
    • setSourcePortRange

      @Stability(Stable) public void setSourcePortRange(@Nullable CfnTrafficMirrorFilterRule.TrafficMirrorPortRangeProperty value)
      The source port range.