Class: AWSCDK::DocDB::CfnEventSubscriptionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
doc_db/cfn_event_subscription_props.rb

Overview

Properties for defining a CfnEventSubscription.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sns_topic_arn:, enabled: nil, event_categories: nil, source_ids: nil, source_type: nil, subscription_name: nil) ⇒ CfnEventSubscriptionProps

Returns a new instance of CfnEventSubscriptionProps.

Parameters:

  • sns_topic_arn (String)

    The Amazon Resource Name (ARN) of the SNS topic created for event notification.

  • enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    A Boolean value;

  • event_categories (Array<String>, nil) (defaults to: nil)

    A list of event categories for a SourceType that you want to subscribe to.

  • source_ids (Array<String>, nil) (defaults to: nil)

    The list of identifiers of the event sources for which events are returned.

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

    The type of source that is generating the events.

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

    The name of the subscription.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'doc_db/cfn_event_subscription_props.rb', line 15

def initialize(sns_topic_arn:, enabled: nil, event_categories: nil, source_ids: nil, source_type: nil, subscription_name: nil)
  @sns_topic_arn = sns_topic_arn
  Jsii::Type.check_type(@sns_topic_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "snsTopicArn")
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled") unless @enabled.nil?
  @event_categories = event_categories
  Jsii::Type.check_type(@event_categories, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "eventCategories") unless @event_categories.nil?
  @source_ids = source_ids
  Jsii::Type.check_type(@source_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "sourceIds") unless @source_ids.nil?
  @source_type = source_type
  Jsii::Type.check_type(@source_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceType") unless @source_type.nil?
  @subscription_name = subscription_name
  Jsii::Type.check_type(@subscription_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subscriptionName") unless @subscription_name.nil?
end

Instance Attribute Details

#enabledBoolean, ... (readonly)

A Boolean value;

set to true to activate the subscription, set to false to create the subscription but not active it.



43
44
45
# File 'doc_db/cfn_event_subscription_props.rb', line 43

def enabled
  @enabled
end

#event_categoriesArray<String>? (readonly)

A list of event categories for a SourceType that you want to subscribe to.



48
49
50
# File 'doc_db/cfn_event_subscription_props.rb', line 48

def event_categories
  @event_categories
end

#sns_topic_arnString (readonly)

The Amazon Resource Name (ARN) of the SNS topic created for event notification.

Amazon SNS creates the ARN when you create a topic and subscribe to it.



36
37
38
# File 'doc_db/cfn_event_subscription_props.rb', line 36

def sns_topic_arn
  @sns_topic_arn
end

#source_idsArray<String>? (readonly)

The list of identifiers of the event sources for which events are returned.

If not specified, then all sources are included in the response. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens.

Constraints:

  • If SourceIds are provided, SourceType must also be provided.
  • If the source type is an instance, a DBInstanceIdentifier must be provided.
  • If the source type is a security group, a DBSecurityGroupName must be provided.
  • If the source type is a parameter group, a DBParameterGroupName must be provided.
  • If the source type is a snapshot, a DBSnapshotIdentifier must be provided.


63
64
65
# File 'doc_db/cfn_event_subscription_props.rb', line 63

def source_ids
  @source_ids
end

#source_typeString? (readonly)

The type of source that is generating the events.

For example, if you want to be notified of events generated by an instance, you would set this parameter to db-instance . If this value is not specified, all events are returned.

Valid values: db-instance , db-cluster , db-parameter-group , db-security-group , db-cluster-snapshot



72
73
74
# File 'doc_db/cfn_event_subscription_props.rb', line 72

def source_type
  @source_type
end

#subscription_nameString? (readonly)

The name of the subscription.

Constraints: The name must be fewer than 255 characters.



79
80
81
# File 'doc_db/cfn_event_subscription_props.rb', line 79

def subscription_name
  @subscription_name
end

Class Method Details

.jsii_propertiesObject



81
82
83
84
85
86
87
88
89
90
# File 'doc_db/cfn_event_subscription_props.rb', line 81

def self.jsii_properties
  {
    :sns_topic_arn => "snsTopicArn",
    :enabled => "enabled",
    :event_categories => "eventCategories",
    :source_ids => "sourceIds",
    :source_type => "sourceType",
    :subscription_name => "subscriptionName",
  }
end

Instance Method Details

#to_jsiiObject



92
93
94
95
96
97
98
99
100
101
102
103
# File 'doc_db/cfn_event_subscription_props.rb', line 92

def to_jsii
  result = {}
  result.merge!({
    "snsTopicArn" => @sns_topic_arn,
    "enabled" => @enabled,
    "eventCategories" => @event_categories,
    "sourceIds" => @source_ids,
    "sourceType" => @source_type,
    "subscriptionName" => @subscription_name,
  })
  result.compact
end