Class: AWSCDK::S3::CfnBucket::TopicConfigurationProperty

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

Overview

A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event:, topic:, filter: nil) ⇒ TopicConfigurationProperty

Returns a new instance of TopicConfigurationProperty.

Parameters:

  • event (String)

    The Amazon S3 bucket event about which to send notifications.

  • topic (String)

    The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.

  • filter (AWSCDK::IResolvable, AWSCDK::S3::CfnBucket::NotificationFilterProperty, nil) (defaults to: nil)

    The filtering rules that determine for which objects to send notifications.



4615
4616
4617
4618
4619
4620
4621
4622
# File 's3/cfn_bucket.rb', line 4615

def initialize(event:, topic:, filter: nil)
  @event = event
  Jsii::Type.check_type(@event, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "event")
  @topic = topic
  Jsii::Type.check_type(@topic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "topic")
  @filter = filter.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::NotificationFilterProperty.new(**filter.transform_keys(&:to_sym)) : filter
  Jsii::Type.check_type(@filter, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuTm90aWZpY2F0aW9uRmlsdGVyUHJvcGVydHkifV19fQ==")), "filter") unless @filter.nil?
end

Instance Attribute Details

#eventString (readonly)

The Amazon S3 bucket event about which to send notifications.

For more information, see Supported Event Types in the Amazon S3 User Guide .



4630
4631
4632
# File 's3/cfn_bucket.rb', line 4630

def event
  @event
end

#filterAWSCDK::IResolvable, ... (readonly)

The filtering rules that determine for which objects to send notifications.

For example, you can create a filter so that Amazon S3 sends notifications only when image files with a .jpg extension are added to the bucket.



4642
4643
4644
# File 's3/cfn_bucket.rb', line 4642

def filter
  @filter
end

#topicString (readonly)

The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.



4635
4636
4637
# File 's3/cfn_bucket.rb', line 4635

def topic
  @topic
end

Class Method Details

.jsii_propertiesObject



4644
4645
4646
4647
4648
4649
4650
# File 's3/cfn_bucket.rb', line 4644

def self.jsii_properties
  {
    :event => "event",
    :topic => "topic",
    :filter => "filter",
  }
end

Instance Method Details

#to_jsiiObject



4652
4653
4654
4655
4656
4657
4658
4659
4660
# File 's3/cfn_bucket.rb', line 4652

def to_jsii
  result = {}
  result.merge!({
    "event" => @event,
    "topic" => @topic,
    "filter" => @filter,
  })
  result.compact
end