Class: AWSCDK::S3::BucketMetrics

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
s3/bucket_metrics.rb

Overview

Specifies a metrics configuration for the CloudWatch request metrics from an Amazon S3 bucket.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, prefix: nil, tag_filters: nil) ⇒ BucketMetrics

Returns a new instance of BucketMetrics.

Parameters:

  • id (String)

    The ID used to identify the metrics configuration.

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

    The prefix that an object must have to be included in the metrics results.

  • tag_filters (Hash{String => Object}, nil) (defaults to: nil)

    Specifies a list of tag filters to use as a metrics configuration filter.



10
11
12
13
14
15
16
17
# File 's3/bucket_metrics.rb', line 10

def initialize(id:, prefix: nil, tag_filters: nil)
  @id = id
  Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  @prefix = prefix
  Jsii::Type.check_type(@prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "prefix") unless @prefix.nil?
  @tag_filters = tag_filters
  Jsii::Type.check_type(@tag_filters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "tagFilters") unless @tag_filters.nil?
end

Instance Attribute Details

#idString (readonly)

The ID used to identify the metrics configuration.

Returns:

  • (String)


22
23
24
# File 's3/bucket_metrics.rb', line 22

def id
  @id
end

#prefixString? (readonly)

The prefix that an object must have to be included in the metrics results.

Returns:

  • (String, nil)


26
27
28
# File 's3/bucket_metrics.rb', line 26

def prefix
  @prefix
end

#tag_filtersHash{String => Object}? (readonly)

Specifies a list of tag filters to use as a metrics configuration filter.

The metrics configuration includes only objects that meet the filter's criteria.

Returns:

  • (Hash{String => Object}, nil)


32
33
34
# File 's3/bucket_metrics.rb', line 32

def tag_filters
  @tag_filters
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
40
# File 's3/bucket_metrics.rb', line 34

def self.jsii_properties
  {
    :id => "id",
    :prefix => "prefix",
    :tag_filters => "tagFilters",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
50
# File 's3/bucket_metrics.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "id" => @id,
    "prefix" => @prefix,
    "tagFilters" => @tag_filters,
  })
  result.compact
end