Class: AWSCDK::Events::ArchiveProps

Inherits:
BaseArchiveProps
  • Object
show all
Defined in:
events/archive_props.rb

Overview

The event archive properties.

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, source_event_bus:) ⇒ ArchiveProps

Returns a new instance of ArchiveProps.

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.

  • source_event_bus (AWSCDK::Interfaces::AWSEvents::IEventBusRef)

    The event source associated with the archive.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'events/archive_props.rb', line 13

def initialize(event_pattern:, archive_name: nil, description: nil, kms_key: nil, retention: nil, source_event_bus:)
  @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?
  @source_event_bus = source_event_bus
  Jsii::Type.check_type(@source_event_bus, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmVudHMuSUV2ZW50QnVzUmVmIn0=")), "sourceEventBus")
end

Instance Attribute Details

#archive_nameString? (readonly)

Note:

Default: - Automatically generated

The name of the archive.

Returns:

  • (String, nil)


36
37
38
# File 'events/archive_props.rb', line 36

def archive_name
  @archive_name
end

#descriptionString? (readonly)

Note:

Default: - none

A description for the archive.

Returns:

  • (String, nil)


41
42
43
# File 'events/archive_props.rb', line 41

def description
  @description
end

#event_patternAWSCDK::Events::EventPattern (readonly)

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



31
32
33
# File 'events/archive_props.rb', line 31

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:



46
47
48
# File 'events/archive_props.rb', line 46

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:



53
54
55
# File 'events/archive_props.rb', line 53

def retention
  @retention
end

#source_event_busAWSCDK::Interfaces::AWSEvents::IEventBusRef (readonly)

The event source associated with the archive.



57
58
59
# File 'events/archive_props.rb', line 57

def source_event_bus
  @source_event_bus
end

Class Method Details

.jsii_propertiesObject



59
60
61
62
63
64
65
66
67
68
# File 'events/archive_props.rb', line 59

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

Instance Method Details

#to_jsiiObject



70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'events/archive_props.rb', line 70

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