Class: AWSCDK::RDS::CfnEventSubscriptionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
rds/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, tags: nil) ⇒ CfnEventSubscriptionProps

Returns a new instance of CfnEventSubscriptionProps.

Parameters:

  • sns_topic_arn (String, AWSCDK::Interfaces::AWSSNS::ITopicRef)

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

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

    Specifies whether to activate the subscription.

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

    A list of event categories for a particular source type ( SourceType ) that you want to subscribe to.

  • source_ids (Array<String, AWSCDK::Interfaces::AWSRDS::IDBClusterRef, AWSCDK::Interfaces::AWSRDS::IDBInstanceRef>, 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.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    An optional array of key-value pairs to apply to this subscription.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'rds/cfn_event_subscription_props.rb', line 16

def initialize(sns_topic_arn:, enabled: nil, event_categories: nil, source_ids: nil, source_type: nil, subscription_name: nil, tags: nil)
  @sns_topic_arn = sns_topic_arn
  Jsii::Type.check_type(@sns_topic_arn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zbnMuSVRvcGljUmVmIn1dfX0=")), "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("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InVuaW9uIjp7InR5cGVzIjpbeyJwcmltaXRpdmUiOiJzdHJpbmcifSx7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX3Jkcy5JREJDbHVzdGVyUmVmIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19yZHMuSURCSW5zdGFuY2VSZWYifV19fSwia2luZCI6ImFycmF5In19")), "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?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#enabledBoolean, ... (readonly)

Note:

Default: - true

Specifies whether to activate the subscription.

If the event notification subscription isn't activated, the subscription is created but not active.



49
50
51
# File 'rds/cfn_event_subscription_props.rb', line 49

def enabled
  @enabled
end

#event_categoriesArray<String>? (readonly)

A list of event categories for a particular source type ( SourceType ) that you want to subscribe to.

You can see a list of the categories for a given source type in the "Amazon RDS event categories and event messages" section of the Amazon RDS User Guide or the Amazon Aurora User Guide . You can also see this list by using the DescribeEventCategories operation.



56
57
58
# File 'rds/cfn_event_subscription_props.rb', line 56

def event_categories
  @event_categories
end

#sns_topic_arnString, AWSCDK::Interfaces::AWSSNS::ITopicRef (readonly)

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

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

RDS doesn't support FIFO (first in, first out) topics. For more information, see Message ordering and deduplication (FIFO topics) in the Amazon Simple Notification Service Developer Guide .



41
42
43
# File 'rds/cfn_event_subscription_props.rb', line 41

def sns_topic_arn
  @sns_topic_arn
end

#source_idsArray<String, AWSCDK::Interfaces::AWSRDS::IDBClusterRef, AWSCDK::Interfaces::AWSRDS::IDBInstanceRef>? (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 supplied, SourceType must also be provided.
  • If the source type is a DB instance, a DBInstanceIdentifier value must be supplied.
  • If the source type is a DB cluster, a DBClusterIdentifier value must be supplied.
  • If the source type is a DB parameter group, a DBParameterGroupName value must be supplied.
  • If the source type is a DB security group, a DBSecurityGroupName value must be supplied.
  • If the source type is a DB snapshot, a DBSnapshotIdentifier value must be supplied.
  • If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier value must be supplied.
  • If the source type is an RDS Proxy, a DBProxyName value must be supplied.


74
75
76
# File 'rds/cfn_event_subscription_props.rb', line 74

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 a DB instance, you set this parameter to db-instance . For RDS Proxy events, specify db-proxy . If this value isn't specified, all events are returned.

Valid Values: db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | custom-engine-version | blue-green-deployment



83
84
85
# File 'rds/cfn_event_subscription_props.rb', line 83

def source_type
  @source_type
end

#subscription_nameString? (readonly)

The name of the subscription.

Constraints: The name must be less than 255 characters.



90
91
92
# File 'rds/cfn_event_subscription_props.rb', line 90

def subscription_name
  @subscription_name
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An optional array of key-value pairs to apply to this subscription.



95
96
97
# File 'rds/cfn_event_subscription_props.rb', line 95

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



97
98
99
100
101
102
103
104
105
106
107
# File 'rds/cfn_event_subscription_props.rb', line 97

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

Instance Method Details

#to_jsiiObject



109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'rds/cfn_event_subscription_props.rb', line 109

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