Class: AWSCDK::EC2::FlowLogOptions

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

Overview

Options to add a flow log to a VPC.

Direct Known Subclasses

FlowLogProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(destination: nil, log_format: nil, max_aggregation_interval: nil, traffic_type: nil) ⇒ FlowLogOptions

Returns a new instance of FlowLogOptions.

Parameters:



11
12
13
14
15
16
17
18
19
20
# File 'ec2/flow_log_options.rb', line 11

def initialize(destination: nil, log_format: nil, max_aggregation_interval: nil, traffic_type: nil)
  @destination = destination
  Jsii::Type.check_type(@destination, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkZsb3dMb2dEZXN0aW5hdGlvbiJ9")), "destination") unless @destination.nil?
  @log_format = log_format
  Jsii::Type.check_type(@log_format, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuTG9nRm9ybWF0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "logFormat") unless @log_format.nil?
  @max_aggregation_interval = max_aggregation_interval
  Jsii::Type.check_type(@max_aggregation_interval, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkZsb3dMb2dNYXhBZ2dyZWdhdGlvbkludGVydmFsIn0=")), "maxAggregationInterval") unless @max_aggregation_interval.nil?
  @traffic_type = traffic_type
  Jsii::Type.check_type(@traffic_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkZsb3dMb2dUcmFmZmljVHlwZSJ9")), "trafficType") unless @traffic_type.nil?
end

Instance Attribute Details

#destinationAWSCDK::EC2::FlowLogDestination? (readonly)

Note:

Default: FlowLogDestinationType.toCloudWatchLogs()

Specifies the type of destination to which the flow log data is to be published.

Flow log data can be published to CloudWatch Logs or Amazon S3



28
29
30
# File 'ec2/flow_log_options.rb', line 28

def destination
  @destination
end

#log_formatArray<AWSCDK::EC2::LogFormat>? (readonly)

Note:

Default: - default log format is used.

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

If multiple fields are specified, they will be separated by spaces. For full control over the literal log format string, pass a single field constructed with LogFormat.custom().

See https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records

Returns:



38
39
40
# File 'ec2/flow_log_options.rb', line 38

def log_format
  @log_format
end

#max_aggregation_intervalAWSCDK::EC2::FlowLogMaxAggregationInterval? (readonly)

Note:

Default: - FlowLogMaxAggregationInterval.ONE_MINUTES if creating flow logs for Transit Gateway, otherwise FlowLogMaxAggregationInterval.TEN_MINUTES.

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

When creating flow logs for a Transit Gateway or Transit Gateway Attachment, this property must be ONE_MINUTES.



47
48
49
# File 'ec2/flow_log_options.rb', line 47

def max_aggregation_interval
  @max_aggregation_interval
end

#traffic_typeAWSCDK::EC2::FlowLogTrafficType? (readonly)

Note:

Default: ALL

The type of traffic to log.

You can log traffic that the resource accepts or rejects, or all traffic. When the target is either TransitGateway or TransitGatewayAttachment, setting the traffic type is not possible.



56
57
58
# File 'ec2/flow_log_options.rb', line 56

def traffic_type
  @traffic_type
end

Class Method Details

.jsii_propertiesObject



58
59
60
61
62
63
64
65
# File 'ec2/flow_log_options.rb', line 58

def self.jsii_properties
  {
    :destination => "destination",
    :log_format => "logFormat",
    :max_aggregation_interval => "maxAggregationInterval",
    :traffic_type => "trafficType",
  }
end

Instance Method Details

#to_jsiiObject



67
68
69
70
71
72
73
74
75
76
# File 'ec2/flow_log_options.rb', line 67

def to_jsii
  result = {}
  result.merge!({
    "destination" => @destination,
    "logFormat" => @log_format,
    "maxAggregationInterval" => @max_aggregation_interval,
    "trafficType" => @traffic_type,
  })
  result.compact
end