Class: AWSCDK::EC2::CfnFlowLogProps

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

Overview

Properties for defining a CfnFlowLog.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_id:, resource_type:, deliver_cross_account_role: nil, deliver_logs_permission_arn: nil, destination_options: nil, log_destination: nil, log_destination_type: nil, log_format: nil, log_group_name: nil, max_aggregation_interval: nil, tag_field_specifications: nil, tags: nil, traffic_type: nil) ⇒ CfnFlowLogProps

Returns a new instance of CfnFlowLogProps.

Parameters:

  • resource_id (String, AWSCDK::Interfaces::AWSEC2::ISubnetRef, AWSCDK::Interfaces::AWSEC2::ITransitGatewayRef, AWSCDK::Interfaces::AWSEC2::IVPCRef)

    The ID of the resource to monitor.

  • resource_type (String)

    The type of resource to monitor.

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

    The ARN of the IAM role that allows the service to publish flow logs across accounts.

  • deliver_logs_permission_arn (String, AWSCDK::Interfaces::AWSIAM::IRoleRef, nil) (defaults to: nil)

    The ARN of the IAM role that allows Amazon EC2 to publish flow logs to the log destination.

  • destination_options (Object, nil) (defaults to: nil)

    The destination options.

  • log_destination (String, AWSCDK::Interfaces::AWSLogs::ILogGroupRef, AWSCDK::Interfaces::AWSS3::IBucketRef, nil) (defaults to: nil)

    The destination for the flow log data. The meaning of this parameter depends on the destination type.

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

    The type of destination for the flow log data.

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

    The fields to include in the flow log record, in the order in which they should appear.

  • log_group_name (String, AWSCDK::Interfaces::AWSLogs::ILogGroupRef, nil) (defaults to: nil)

    The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.

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

    The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record.

  • tag_field_specifications (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::EC2::CfnFlowLog::TagFieldSpecificationProperty>, nil) (defaults to: nil)

    The resource types and associated tags for EC2 resources associated with the EC2 Tags feature for log enrichment.

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

    The tags to apply to the flow logs.

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

    The type of traffic to monitor (accepted traffic, rejected traffic, or all traffic).



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'ec2/cfn_flow_log_props.rb', line 22

def initialize(resource_id:, resource_type:, deliver_cross_account_role: nil, deliver_logs_permission_arn: nil, destination_options: nil, log_destination: nil, log_destination_type: nil, log_format: nil, log_group_name: nil, max_aggregation_interval: nil, tag_field_specifications: nil, tags: nil, traffic_type: nil)
  @resource_id = resource_id
  Jsii::Type.check_type(@resource_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lYzIuSVN1Ym5ldFJlZiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuaW50ZXJmYWNlcy5hd3NfZWMyLklUcmFuc2l0R2F0ZXdheVJlZiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuaW50ZXJmYWNlcy5hd3NfZWMyLklWUENSZWYifV19fQ==")), "resourceId")
  @resource_type = resource_type
  Jsii::Type.check_type(@resource_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceType")
  @deliver_cross_account_role = 
  Jsii::Type.check_type(@deliver_cross_account_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deliverCrossAccountRole") unless @deliver_cross_account_role.nil?
  @deliver_logs_permission_arn = deliver_logs_permission_arn
  Jsii::Type.check_type(@deliver_logs_permission_arn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifV19fQ==")), "deliverLogsPermissionArn") unless @deliver_logs_permission_arn.nil?
  @destination_options = destination_options
  Jsii::Type.check_type(@destination_options, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "destinationOptions") unless @destination_options.nil?
  @log_destination = log_destination
  Jsii::Type.check_type(@log_destination, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sb2dzLklMb2dHcm91cFJlZiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuaW50ZXJmYWNlcy5hd3NfczMuSUJ1Y2tldFJlZiJ9XX19")), "logDestination") unless @log_destination.nil?
  @log_destination_type = log_destination_type
  Jsii::Type.check_type(@log_destination_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logDestinationType") unless @log_destination_type.nil?
  @log_format = log_format
  Jsii::Type.check_type(@log_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logFormat") unless @log_format.nil?
  @log_group_name = log_group_name
  Jsii::Type.check_type(@log_group_name, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sb2dzLklMb2dHcm91cFJlZiJ9XX19")), "logGroupName") unless @log_group_name.nil?
  @max_aggregation_interval = max_aggregation_interval
  Jsii::Type.check_type(@max_aggregation_interval, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxAggregationInterval") unless @max_aggregation_interval.nil?
  @tag_field_specifications = tag_field_specifications
  Jsii::Type.check_type(@tag_field_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNmbkZsb3dMb2cuVGFnRmllbGRTcGVjaWZpY2F0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "tagFieldSpecifications") unless @tag_field_specifications.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?
  @traffic_type = traffic_type
  Jsii::Type.check_type(@traffic_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "trafficType") unless @traffic_type.nil?
end

Instance Attribute Details

#deliver_cross_account_roleString? (readonly)

The ARN of the IAM role that allows the service to publish flow logs across accounts.



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

def 
  @deliver_cross_account_role
end

#deliver_logs_permission_arnString, ... (readonly)

The ARN of the IAM role that allows Amazon EC2 to publish flow logs to the log destination.

This parameter is required if the destination type is cloud-watch-logs , or if the destination type is kinesis-data-firehose and the delivery stream and the resources to monitor are in different accounts.



74
75
76
# File 'ec2/cfn_flow_log_props.rb', line 74

def deliver_logs_permission_arn
  @deliver_logs_permission_arn
end

#destination_optionsObject? (readonly)

The destination options.



79
80
81
# File 'ec2/cfn_flow_log_props.rb', line 79

def destination_options
  @destination_options
end

#log_destinationString, ... (readonly)

The destination for the flow log data. The meaning of this parameter depends on the destination type.

  • If the destination type is cloud-watch-logs , specify the ARN of a CloudWatch Logs log group. For example:

arn:aws:logs: region : account_id :log-group: my_group

Alternatively, use the LogGroupName parameter.

  • If the destination type is s3 , specify the ARN of an S3 bucket. For example:

arn:aws:s3::: my_bucket / my_subfolder /

The subfolder is optional. Note that you can't use AWSLogs as a subfolder name.

  • If the destination type is kinesis-data-firehose , specify the ARN of a Kinesis Data Firehose delivery stream. For example:

arn:aws:firehose: region : account_id :deliverystream: my_stream



100
101
102
# File 'ec2/cfn_flow_log_props.rb', line 100

def log_destination
  @log_destination
end

#log_destination_typeString? (readonly)

The type of destination for the flow log data.

Default: cloud-watch-logs



107
108
109
# File 'ec2/cfn_flow_log_props.rb', line 107

def log_destination_type
  @log_destination_type
end

#log_formatString? (readonly)

The fields to include in the flow log record, in the order in which they should appear.

If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must include at least one field. For more information about the available fields, see Flow log records in the Amazon VPC User Guide or Transit Gateway Flow Log records in the AWS Transit Gateway Guide .

Specify the fields using the ${field-id} format, separated by spaces.



116
117
118
# File 'ec2/cfn_flow_log_props.rb', line 116

def log_format
  @log_format
end

#log_group_nameString, ... (readonly)

The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.

This parameter is valid only if the destination type is cloud-watch-logs .



123
124
125
# File 'ec2/cfn_flow_log_props.rb', line 123

def log_group_name
  @log_group_name
end

#max_aggregation_intervalNumeric? (readonly)

The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record.

The possible values are 60 seconds (1 minute) or 600 seconds (10 minutes). This parameter must be 60 seconds for transit gateway resource types.

When a network interface is attached to a Nitro-based instance , the aggregation interval is always 60 seconds or less, regardless of the value that you specify.

Default: 600



134
135
136
# File 'ec2/cfn_flow_log_props.rb', line 134

def max_aggregation_interval
  @max_aggregation_interval
end

#resource_idString, ... (readonly)

The ID of the resource to monitor.

For example, if the resource type is VPC , specify the ID of the VPC.



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

def resource_id
  @resource_id
end

#resource_typeString (readonly)

The type of resource to monitor.



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

def resource_type
  @resource_type
end

#tag_field_specificationsAWSCDK::IResolvable, ... (readonly)

The resource types and associated tags for EC2 resources associated with the EC2 Tags feature for log enrichment.



139
140
141
# File 'ec2/cfn_flow_log_props.rb', line 139

def tag_field_specifications
  @tag_field_specifications
end

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

The tags to apply to the flow logs.



144
145
146
# File 'ec2/cfn_flow_log_props.rb', line 144

def tags
  @tags
end

#traffic_typeString? (readonly)

The type of traffic to monitor (accepted traffic, rejected traffic, or all traffic).

This parameter is not supported for transit gateway resource types. It is required for the other resource types.



151
152
153
# File 'ec2/cfn_flow_log_props.rb', line 151

def traffic_type
  @traffic_type
end

Class Method Details

.jsii_propertiesObject



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'ec2/cfn_flow_log_props.rb', line 153

def self.jsii_properties
  {
    :resource_id => "resourceId",
    :resource_type => "resourceType",
    :deliver_cross_account_role => "deliverCrossAccountRole",
    :deliver_logs_permission_arn => "deliverLogsPermissionArn",
    :destination_options => "destinationOptions",
    :log_destination => "logDestination",
    :log_destination_type => "logDestinationType",
    :log_format => "logFormat",
    :log_group_name => "logGroupName",
    :max_aggregation_interval => "maxAggregationInterval",
    :tag_field_specifications => "tagFieldSpecifications",
    :tags => "tags",
    :traffic_type => "trafficType",
  }
end

Instance Method Details

#to_jsiiObject



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'ec2/cfn_flow_log_props.rb', line 171

def to_jsii
  result = {}
  result.merge!({
    "resourceId" => @resource_id,
    "resourceType" => @resource_type,
    "deliverCrossAccountRole" => @deliver_cross_account_role,
    "deliverLogsPermissionArn" => @deliver_logs_permission_arn,
    "destinationOptions" => @destination_options,
    "logDestination" => @log_destination,
    "logDestinationType" => @log_destination_type,
    "logFormat" => @log_format,
    "logGroupName" => @log_group_name,
    "maxAggregationInterval" => @max_aggregation_interval,
    "tagFieldSpecifications" => @tag_field_specifications,
    "tags" => @tags,
    "trafficType" => @traffic_type,
  })
  result.compact
end