Class: AWSCDK::EC2::CfnFlowLogProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnFlowLogProps
- Defined in:
- ec2/cfn_flow_log_props.rb
Overview
Properties for defining a CfnFlowLog.
Instance Attribute Summary collapse
-
#deliver_cross_account_role ⇒ String?
readonly
The ARN of the IAM role that allows the service to publish flow logs across accounts.
-
#deliver_logs_permission_arn ⇒ String, ...
readonly
The ARN of the IAM role that allows Amazon EC2 to publish flow logs to the log destination.
-
#destination_options ⇒ Object?
readonly
The destination options.
-
#log_destination ⇒ String, ...
readonly
The destination for the flow log data.
-
#log_destination_type ⇒ String?
readonly
The type of destination for the flow log data.
-
#log_format ⇒ String?
readonly
The fields to include in the flow log record, in the order in which they should appear.
-
#log_group_name ⇒ String, ...
readonly
The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs.
-
#max_aggregation_interval ⇒ Numeric?
readonly
The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record.
-
#resource_id ⇒ String, ...
readonly
The ID of the resource to monitor.
-
#resource_type ⇒ String
readonly
The type of resource to monitor.
-
#tag_field_specifications ⇒ AWSCDK::IResolvable, ...
readonly
The resource types and associated tags for EC2 resources associated with the EC2 Tags feature for log enrichment.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
The tags to apply to the flow logs.
-
#traffic_type ⇒ String?
readonly
The type of traffic to monitor (accepted traffic, rejected traffic, or all traffic).
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of CfnFlowLogProps.
- #to_jsii ⇒ Object
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.
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 = 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 = Jsii::Type.check_type(@deliver_logs_permission_arn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifV19fQ==")), "deliverLogsPermissionArn") unless @deliver_logs_permission_arn.nil? @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 = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : 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_role ⇒ String? (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 @deliver_cross_account_role end |
#deliver_logs_permission_arn ⇒ String, ... (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 end |
#destination_options ⇒ Object? (readonly)
The destination options.
79 80 81 |
# File 'ec2/cfn_flow_log_props.rb', line 79 def @destination_options end |
#log_destination ⇒ String, ... (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_type ⇒ String? (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_format ⇒ String? (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_name ⇒ String, ... (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_interval ⇒ Numeric? (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_id ⇒ String, ... (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_type ⇒ String (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_specifications ⇒ AWSCDK::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 |
#tags ⇒ Array<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 end |
#traffic_type ⇒ String? (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_properties ⇒ Object
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_jsii ⇒ Object
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 |