Class: AWSCDK::EC2::CfnTrafficMirrorSessionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_traffic_mirror_session_props.rb

Overview

Properties for defining a CfnTrafficMirrorSession.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(network_interface_id:, session_number:, traffic_mirror_filter_id:, traffic_mirror_target_id:, description: nil, owner_id: nil, packet_length: nil, tags: nil, virtual_network_id: nil) ⇒ CfnTrafficMirrorSessionProps

Returns a new instance of CfnTrafficMirrorSessionProps.

Parameters:

  • network_interface_id (String)

    The ID of the source network interface.

  • session_number (Numeric)

    The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions.

  • traffic_mirror_filter_id (String)

    The ID of the Traffic Mirror filter.

  • traffic_mirror_target_id (String)

    The ID of the Traffic Mirror target.

  • description (String, nil) (defaults to: nil)

    The description of the Traffic Mirror session.

  • owner_id (String, nil) (defaults to: nil)

    The ID of the account that owns the Traffic Mirror session.

  • packet_length (Numeric, nil) (defaults to: nil)

    The number of bytes in each packet to mirror.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    The tags to assign to a Traffic Mirror session.

  • virtual_network_id (Numeric, nil) (defaults to: nil)

    The VXLAN ID for the Traffic Mirror session.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 18

def initialize(network_interface_id:, session_number:, traffic_mirror_filter_id:, traffic_mirror_target_id:, description: nil, owner_id: nil, packet_length: nil, tags: nil, virtual_network_id: nil)
  @network_interface_id = network_interface_id
  Jsii::Type.check_type(@network_interface_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "networkInterfaceId")
  @session_number = session_number
  Jsii::Type.check_type(@session_number, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "sessionNumber")
  @traffic_mirror_filter_id = traffic_mirror_filter_id
  Jsii::Type.check_type(@traffic_mirror_filter_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "trafficMirrorFilterId")
  @traffic_mirror_target_id = traffic_mirror_target_id
  Jsii::Type.check_type(@traffic_mirror_target_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "trafficMirrorTargetId")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @owner_id = owner_id
  Jsii::Type.check_type(@owner_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ownerId") unless @owner_id.nil?
  @packet_length = packet_length
  Jsii::Type.check_type(@packet_length, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "packetLength") unless @packet_length.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @virtual_network_id = virtual_network_id
  Jsii::Type.check_type(@virtual_network_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "virtualNetworkId") unless @virtual_network_id.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

The description of the Traffic Mirror session.



67
68
69
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 67

def description
  @description
end

#network_interface_idString (readonly)

The ID of the source network interface.



43
44
45
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 43

def network_interface_id
  @network_interface_id
end

#owner_idString? (readonly)

The ID of the account that owns the Traffic Mirror session.



72
73
74
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 72

def owner_id
  @owner_id
end

#packet_lengthNumeric? (readonly)

The number of bytes in each packet to mirror.

These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror. For example, if you set this value to 100, then the first 100 bytes that meet the filter criteria are copied to the target.

If you do not want to mirror the entire packet, use the PacketLength parameter to specify the number of bytes in each packet to mirror.

For sessions with Network Load Balancer (NLB) Traffic Mirror targets the default PacketLength will be set to 8500. Valid values are 1-8500. Setting a PacketLength greater than 8500 will result in an error response.



83
84
85
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 83

def packet_length
  @packet_length
end

#session_numberNumeric (readonly)

The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions.

The first session with a matching filter is the one that mirrors the packets.

Valid values are 1-32766.



52
53
54
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 52

def session_number
  @session_number
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The tags to assign to a Traffic Mirror session.



88
89
90
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 88

def tags
  @tags
end

#traffic_mirror_filter_idString (readonly)

The ID of the Traffic Mirror filter.



57
58
59
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 57

def traffic_mirror_filter_id
  @traffic_mirror_filter_id
end

#traffic_mirror_target_idString (readonly)

The ID of the Traffic Mirror target.



62
63
64
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 62

def traffic_mirror_target_id
  @traffic_mirror_target_id
end

#virtual_network_idNumeric? (readonly)

The VXLAN ID for the Traffic Mirror session.

For more information about the VXLAN protocol, see RFC 7348 . If you do not specify a VirtualNetworkId , an account-wide unique ID is chosen at random.



95
96
97
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 95

def virtual_network_id
  @virtual_network_id
end

Class Method Details

.jsii_propertiesObject



97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 97

def self.jsii_properties
  {
    :network_interface_id => "networkInterfaceId",
    :session_number => "sessionNumber",
    :traffic_mirror_filter_id => "trafficMirrorFilterId",
    :traffic_mirror_target_id => "trafficMirrorTargetId",
    :description => "description",
    :owner_id => "ownerId",
    :packet_length => "packetLength",
    :tags => "tags",
    :virtual_network_id => "virtualNetworkId",
  }
end

Instance Method Details

#to_jsiiObject



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'ec2/cfn_traffic_mirror_session_props.rb', line 111

def to_jsii
  result = {}
  result.merge!({
    "networkInterfaceId" => @network_interface_id,
    "sessionNumber" => @session_number,
    "trafficMirrorFilterId" => @traffic_mirror_filter_id,
    "trafficMirrorTargetId" => @traffic_mirror_target_id,
    "description" => @description,
    "ownerId" => @owner_id,
    "packetLength" => @packet_length,
    "tags" => @tags,
    "virtualNetworkId" => @virtual_network_id,
  })
  result.compact
end