Class: AWSCDK::EC2::FlowLogDestination

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

Overview

The destination type for the flow log.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFlowLogDestination

Returns a new instance of FlowLogDestination.



8
9
10
# File 'ec2/flow_log_destination.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'ec2/flow_log_destination.rb', line 12

def self.jsii_overridable_methods
  {
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

.to_cloud_watch_logs(log_group = nil, iam_role = nil) ⇒ AWSCDK::EC2::FlowLogDestination

Use CloudWatch logs as the destination.

Parameters:

Returns:

  • (AWSCDK::EC2::FlowLogDestination)


23
24
25
26
27
# File 'ec2/flow_log_destination.rb', line 23

def self.to_cloud_watch_logs(log_group = nil, iam_role = nil)
  Jsii::Type.check_type(log_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sb2dzLklMb2dHcm91cFJlZiJ9")), "logGroup") unless log_group.nil?
  Jsii::Type.check_type(iam_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "iamRole") unless iam_role.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.FlowLogDestination", "toCloudWatchLogs", [log_group, iam_role])
end

.to_firehose(delivery_stream, iam_role = nil) ⇒ AWSCDK::EC2::FlowLogDestination

Use Amazon Data Firehose as the destination.

If the delivery stream and the VPC are in different account, you must specify iam_role.

Parameters:

Returns:

  • (AWSCDK::EC2::FlowLogDestination)

See Also:



37
38
39
40
41
# File 'ec2/flow_log_destination.rb', line 37

def self.to_firehose(delivery_stream, iam_role = nil)
  Jsii::Type.check_type(delivery_stream, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19raW5lc2lzZmlyZWhvc2UuSURlbGl2ZXJ5U3RyZWFtUmVmIn0=")), "deliveryStream")
  Jsii::Type.check_type(iam_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "iamRole") unless iam_role.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.FlowLogDestination", "toFirehose", [delivery_stream, iam_role])
end

.to_kinesis_data_firehose_destination(delivery_stream_arn) ⇒ AWSCDK::EC2::FlowLogDestination

Deprecated.

use toFirehose

Use Amazon Data Firehose as the destination.

Parameters:

  • delivery_stream_arn (String)

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

Returns:

  • (AWSCDK::EC2::FlowLogDestination)


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

def self.to_kinesis_data_firehose_destination(delivery_stream_arn)
  Jsii::Type.check_type(delivery_stream_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "deliveryStreamArn")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.FlowLogDestination", "toKinesisDataFirehoseDestination", [delivery_stream_arn])
end

.to_s3(bucket = nil, key_prefix = nil, options = nil) ⇒ AWSCDK::EC2::FlowLogDestination

Use S3 as the destination.

Parameters:

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

    optional s3 bucket to publish logs to.

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

    optional prefix within the bucket to write logs to.

  • options (AWSCDK::EC2::S3DestinationOptions, nil) (defaults to: nil)

    additional s3 destination options.

Returns:

  • (AWSCDK::EC2::FlowLogDestination)


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

def self.to_s3(bucket = nil, key_prefix = nil, options = nil)
  Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket") unless bucket.nil?
  Jsii::Type.check_type(key_prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "keyPrefix") unless key_prefix.nil?
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::S3DestinationOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlMzRGVzdGluYXRpb25PcHRpb25zIn0=")), "options") unless options.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.FlowLogDestination", "toS3", [bucket, key_prefix, options])
end

Instance Method Details

#bind(scope, flow_log) ⇒ AWSCDK::EC2::FlowLogDestinationConfig

Generates a flow log destination configuration.

Parameters:

Returns:



72
73
74
75
76
# File 'ec2/flow_log_destination.rb', line 72

def bind(scope, flow_log)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(flow_log, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkZsb3dMb2cifQ==")), "flowLog")
  jsii_call_method("bind", [scope, flow_log])
end