Class: AWSCDK::Events::BaseArchiveProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
events/base_archive_props.rb

Overview

The event archive base properties.

Direct Known Subclasses

ArchiveProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_pattern:, archive_name: nil, description: nil, kms_key: nil, retention: nil) ⇒ BaseArchiveProps

Returns a new instance of BaseArchiveProps.

Parameters:

  • event_pattern (AWSCDK::Events::EventPattern)

    An event pattern to use to filter events sent to the archive.

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

    The name of the archive.

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

    A description for the archive.

  • kms_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The customer managed key that encrypts this archive.

  • retention (AWSCDK::Duration, nil) (defaults to: nil)

    The number of days to retain events for.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'events/base_archive_props.rb', line 12

def initialize(event_pattern:, archive_name: nil, description: nil, kms_key: nil, retention: nil)
  @event_pattern = event_pattern.is_a?(Hash) ? ::AWSCDK::Events::EventPattern.new(**event_pattern.transform_keys(&:to_sym)) : event_pattern
  Jsii::Type.check_type(@event_pattern, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLkV2ZW50UGF0dGVybiJ9")), "eventPattern")
  @archive_name = archive_name
  Jsii::Type.check_type(@archive_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "archiveName") unless @archive_name.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @kms_key = kms_key
  Jsii::Type.check_type(@kms_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "kmsKey") unless @kms_key.nil?
  @retention = retention
  Jsii::Type.check_type(@retention, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "retention") unless @retention.nil?
end

Instance Attribute Details

#archive_nameString? (readonly)

Note:

Default: - Automatically generated

The name of the archive.

Returns:

  • (String, nil)


33
34
35
# File 'events/base_archive_props.rb', line 33

def archive_name
  @archive_name
end

#descriptionString? (readonly)

Note:

Default: - none

A description for the archive.

Returns:

  • (String, nil)


38
39
40
# File 'events/base_archive_props.rb', line 38

def description
  @description
end

#event_patternAWSCDK::Events::EventPattern (readonly)

An event pattern to use to filter events sent to the archive.



28
29
30
# File 'events/base_archive_props.rb', line 28

def event_pattern
  @event_pattern
end

#kms_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - Use an AWS managed key

The customer managed key that encrypts this archive.

Returns:



43
44
45
# File 'events/base_archive_props.rb', line 43

def kms_key
  @kms_key
end

#retentionAWSCDK::Duration? (readonly)

Note:

Default: - Infinite

The number of days to retain events for.

Default value is 0. If set to 0, events are retained indefinitely.

Returns:



50
51
52
# File 'events/base_archive_props.rb', line 50

def retention
  @retention
end

Class Method Details

.jsii_propertiesObject



52
53
54
55
56
57
58
59
60
# File 'events/base_archive_props.rb', line 52

def self.jsii_properties
  {
    :event_pattern => "eventPattern",
    :archive_name => "archiveName",
    :description => "description",
    :kms_key => "kmsKey",
    :retention => "retention",
  }
end

Instance Method Details

#to_jsiiObject



62
63
64
65
66
67
68
69
70
71
72
# File 'events/base_archive_props.rb', line 62

def to_jsii
  result = {}
  result.merge!({
    "eventPattern" => @event_pattern,
    "archiveName" => @archive_name,
    "description" => @description,
    "kmsKey" => @kms_key,
    "retention" => @retention,
  })
  result.compact
end