Class: AWSCDK::EC2::FlowLogDestinationConfig

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

Overview

Flow Log Destination configuration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_destination_type:, delivery_stream: nil, delivery_stream_arn: nil, destination_options: nil, iam_role: nil, key_prefix: nil, log_group: nil, s3_bucket: nil) ⇒ FlowLogDestinationConfig

Returns a new instance of FlowLogDestinationConfig.

Parameters:

  • log_destination_type (AWSCDK::EC2::FlowLogDestinationType)

    The type of destination to publish the flow logs to.

  • delivery_stream (AWSCDK::Interfaces::AWSKinesisfirehose::IDeliveryStreamRef, nil) (defaults to: nil)

    The Amazon Data Firehose delivery stream to publish the flow logs to.

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

    The ARN of Amazon Data Firehose delivery stream to publish the flow logs to.

  • destination_options (AWSCDK::EC2::DestinationOptions, nil) (defaults to: nil)

    Options for writing flow logs to a supported destination.

  • iam_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

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

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

    S3 bucket key prefix to publish the flow logs to.

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

    The CloudWatch Logs Log Group to publish the flow logs to.

  • s3_bucket (AWSCDK::S3::IBucket, nil) (defaults to: nil)

    S3 bucket to publish the flow logs to.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'ec2/flow_log_destination_config.rb', line 15

def initialize(log_destination_type:, delivery_stream: nil, delivery_stream_arn: nil, destination_options: nil, iam_role: nil, key_prefix: nil, log_group: nil, s3_bucket: nil)
  @log_destination_type = log_destination_type
  Jsii::Type.check_type(@log_destination_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkZsb3dMb2dEZXN0aW5hdGlvblR5cGUifQ==")), "logDestinationType")
  @delivery_stream = delivery_stream
  Jsii::Type.check_type(@delivery_stream, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19raW5lc2lzZmlyZWhvc2UuSURlbGl2ZXJ5U3RyZWFtUmVmIn0=")), "deliveryStream") unless @delivery_stream.nil?
  @delivery_stream_arn = delivery_stream_arn
  Jsii::Type.check_type(@delivery_stream_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deliveryStreamArn") unless @delivery_stream_arn.nil?
  @destination_options = destination_options.is_a?(Hash) ? ::AWSCDK::EC2::DestinationOptions.new(**destination_options.transform_keys(&:to_sym)) : destination_options
  Jsii::Type.check_type(@destination_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkRlc3RpbmF0aW9uT3B0aW9ucyJ9")), "destinationOptions") unless @destination_options.nil?
  @iam_role = iam_role
  Jsii::Type.check_type(@iam_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "iamRole") unless @iam_role.nil?
  @key_prefix = key_prefix
  Jsii::Type.check_type(@key_prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPrefix") unless @key_prefix.nil?
  @log_group = log_group
  Jsii::Type.check_type(@log_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sb2dzLklMb2dHcm91cFJlZiJ9")), "logGroup") unless @log_group.nil?
  @s3_bucket = s3_bucket
  Jsii::Type.check_type(@s3_bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "s3Bucket") unless @s3_bucket.nil?
end

Instance Attribute Details

#delivery_streamAWSCDK::Interfaces::AWSKinesisfirehose::IDeliveryStreamRef? (readonly)

Note:

Default: - undefined

The Amazon Data Firehose delivery stream to publish the flow logs to.



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

def delivery_stream
  @delivery_stream
end

#delivery_stream_arnString? (readonly)

Deprecated.

use deliveryStream

Note:

Default: - undefined

The ARN of Amazon Data Firehose delivery stream to publish the flow logs to.

Returns:

  • (String, nil)


49
50
51
# File 'ec2/flow_log_destination_config.rb', line 49

def delivery_stream_arn
  @delivery_stream_arn
end

#destination_optionsAWSCDK::EC2::DestinationOptions? (readonly)

Note:

Default: - undefined

Options for writing flow logs to a supported destination.



54
55
56
# File 'ec2/flow_log_destination_config.rb', line 54

def destination_options
  @destination_options
end

#iam_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - default IAM role is created for you if the destination type is CloudWatch logs

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

Required if the destination type is CloudWatch logs, or if the destination type is Amazon Data Firehose delivery stream and the delivery stream and the VPC are in different accounts.

Returns:



61
62
63
# File 'ec2/flow_log_destination_config.rb', line 61

def iam_role
  @iam_role
end

#key_prefixString? (readonly)

Note:

Default: - undefined

S3 bucket key prefix to publish the flow logs to.

Returns:

  • (String, nil)


66
67
68
# File 'ec2/flow_log_destination_config.rb', line 66

def key_prefix
  @key_prefix
end

#log_destination_typeAWSCDK::EC2::FlowLogDestinationType (readonly)

Note:

Default: - CLOUD_WATCH_LOGS

The type of destination to publish the flow logs to.



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

def log_destination_type
  @log_destination_type
end

#log_groupAWSCDK::Interfaces::AWSLogs::ILogGroupRef? (readonly)

Note:

Default: - default log group is created for you

The CloudWatch Logs Log Group to publish the flow logs to.



71
72
73
# File 'ec2/flow_log_destination_config.rb', line 71

def log_group
  @log_group
end

#s3_bucketAWSCDK::S3::IBucket? (readonly)

Note:

Default: - undefined

S3 bucket to publish the flow logs to.

Returns:



76
77
78
# File 'ec2/flow_log_destination_config.rb', line 76

def s3_bucket
  @s3_bucket
end

Class Method Details

.jsii_propertiesObject



78
79
80
81
82
83
84
85
86
87
88
89
# File 'ec2/flow_log_destination_config.rb', line 78

def self.jsii_properties
  {
    :log_destination_type => "logDestinationType",
    :delivery_stream => "deliveryStream",
    :delivery_stream_arn => "deliveryStreamArn",
    :destination_options => "destinationOptions",
    :iam_role => "iamRole",
    :key_prefix => "keyPrefix",
    :log_group => "logGroup",
    :s3_bucket => "s3Bucket",
  }
end

Instance Method Details

#to_jsiiObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'ec2/flow_log_destination_config.rb', line 91

def to_jsii
  result = {}
  result.merge!({
    "logDestinationType" => @log_destination_type,
    "deliveryStream" => @delivery_stream,
    "deliveryStreamArn" => @delivery_stream_arn,
    "destinationOptions" => @destination_options,
    "iamRole" => @iam_role,
    "keyPrefix" => @key_prefix,
    "logGroup" => @log_group,
    "s3Bucket" => @s3_bucket,
  })
  result.compact
end