Class: AWSCDK::DLM::CfnLifecyclePolicy::EventParametersProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dlm/cfn_lifecycle_policy.rb

Overview

[Event-based policies only] Specifies an event that activates an event-based policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type:, snapshot_owner:, description_regex: nil) ⇒ EventParametersProperty

Returns a new instance of EventParametersProperty.

Parameters:

  • event_type (String)

    The type of event.

  • snapshot_owner (Array<String>)

    The IDs of the AWS accounts that can trigger policy by sharing snapshots with your account.

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

    The snapshot description that can trigger the policy.



1286
1287
1288
1289
1290
1291
1292
1293
# File 'dlm/cfn_lifecycle_policy.rb', line 1286

def initialize(event_type:, snapshot_owner:, description_regex: nil)
  @event_type = event_type
  Jsii::Type.check_type(@event_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "eventType")
  @snapshot_owner = snapshot_owner
  Jsii::Type.check_type(@snapshot_owner, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "snapshotOwner")
  @description_regex = description_regex
  Jsii::Type.check_type(@description_regex, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "descriptionRegex") unless @description_regex.nil?
end

Instance Attribute Details

#description_regexString? (readonly)

The snapshot description that can trigger the policy.

The description pattern is specified using a regular expression. The policy runs only if a snapshot with a description that matches the specified pattern is shared with your account.

For example, specifying ^.*Created for policy: policy-1234567890abcdef0.*$ configures the policy to run only if snapshots created by policy policy-1234567890abcdef0 are shared with your account.



1317
1318
1319
# File 'dlm/cfn_lifecycle_policy.rb', line 1317

def description_regex
  @description_regex
end

#event_typeString (readonly)

The type of event.

Currently, only snapshot sharing events are supported.



1301
1302
1303
# File 'dlm/cfn_lifecycle_policy.rb', line 1301

def event_type
  @event_type
end

#snapshot_ownerArray<String> (readonly)

The IDs of the AWS accounts that can trigger policy by sharing snapshots with your account.

The policy only runs if one of the specified AWS accounts shares a snapshot with your account.



1308
1309
1310
# File 'dlm/cfn_lifecycle_policy.rb', line 1308

def snapshot_owner
  @snapshot_owner
end

Class Method Details

.jsii_propertiesObject



1319
1320
1321
1322
1323
1324
1325
# File 'dlm/cfn_lifecycle_policy.rb', line 1319

def self.jsii_properties
  {
    :event_type => "eventType",
    :snapshot_owner => "snapshotOwner",
    :description_regex => "descriptionRegex",
  }
end

Instance Method Details

#to_jsiiObject



1327
1328
1329
1330
1331
1332
1333
1334
1335
# File 'dlm/cfn_lifecycle_policy.rb', line 1327

def to_jsii
  result = {}
  result.merge!({
    "eventType" => @event_type,
    "snapshotOwner" => @snapshot_owner,
    "descriptionRegex" => @description_regex,
  })
  result.compact
end