Class: AWSCDK::S3::CfnBucket::NotificationConfigurationProperty

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

Overview

Describes the notification configuration for an Amazon S3 bucket.

If you create the target resource and related permissions in the same template, you might have a circular dependency.

For example, you might use the AWS::Lambda::Permission resource to grant the bucket permission to invoke an AWS Lambda function. However, AWS CloudFormation can't create the bucket until the bucket has permission to invoke the function ( AWS CloudFormation checks whether the bucket can invoke the function). If you're using Refs to pass the bucket name, this leads to a circular dependency.

To avoid this dependency, you can create all resources without specifying the notification configuration. Then, update the stack with a notification configuration.

For more information on permissions, see AWS::Lambda::Permission and Granting Permissions to Publish Event Notification Messages to a Destination .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_bridge_configuration: nil, lambda_configurations: nil, queue_configurations: nil, topic_configurations: nil) ⇒ NotificationConfigurationProperty

Returns a new instance of NotificationConfigurationProperty.

Parameters:



2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
# File 's3/cfn_bucket.rb', line 2688

def initialize(event_bridge_configuration: nil, lambda_configurations: nil, queue_configurations: nil, topic_configurations: nil)
  @event_bridge_configuration = event_bridge_configuration.is_a?(Hash) ? ::AWSCDK::S3::CfnBucket::EventBridgeConfigurationProperty.new(**event_bridge_configuration.transform_keys(&:to_sym)) : event_bridge_configuration
  Jsii::Type.check_type(@event_bridge_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zMy5DZm5CdWNrZXQuRXZlbnRCcmlkZ2VDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "eventBridgeConfiguration") unless @event_bridge_configuration.nil?
  @lambda_configurations = lambda_configurations
  Jsii::Type.check_type(@lambda_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LkxhbWJkYUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "lambdaConfigurations") unless @lambda_configurations.nil?
  @queue_configurations = queue_configurations
  Jsii::Type.check_type(@queue_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LlF1ZXVlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "queueConfigurations") unless @queue_configurations.nil?
  @topic_configurations = topic_configurations
  Jsii::Type.check_type(@topic_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQ2ZuQnVja2V0LlRvcGljQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "topicConfigurations") unless @topic_configurations.nil?
end

Instance Attribute Details

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

Enables delivery of events to Amazon EventBridge.



2703
2704
2705
# File 's3/cfn_bucket.rb', line 2703

def event_bridge_configuration
  @event_bridge_configuration
end

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

Describes the AWS Lambda functions to invoke and the events for which to invoke them.



2708
2709
2710
# File 's3/cfn_bucket.rb', line 2708

def lambda_configurations
  @lambda_configurations
end

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

The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.



2713
2714
2715
# File 's3/cfn_bucket.rb', line 2713

def queue_configurations
  @queue_configurations
end

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

The topic to which notifications are sent and the events for which notifications are generated.



2718
2719
2720
# File 's3/cfn_bucket.rb', line 2718

def topic_configurations
  @topic_configurations
end

Class Method Details

.jsii_propertiesObject



2720
2721
2722
2723
2724
2725
2726
2727
# File 's3/cfn_bucket.rb', line 2720

def self.jsii_properties
  {
    :event_bridge_configuration => "eventBridgeConfiguration",
    :lambda_configurations => "lambdaConfigurations",
    :queue_configurations => "queueConfigurations",
    :topic_configurations => "topicConfigurations",
  }
end

Instance Method Details

#to_jsiiObject



2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
# File 's3/cfn_bucket.rb', line 2729

def to_jsii
  result = {}
  result.merge!({
    "eventBridgeConfiguration" => @event_bridge_configuration,
    "lambdaConfigurations" => @lambda_configurations,
    "queueConfigurations" => @queue_configurations,
    "topicConfigurations" => @topic_configurations,
  })
  result.compact
end