You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::RDS::EventSubscription

Inherits:
Aws::Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Aws::Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Aws::Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Aws::Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(name, options = {}) ⇒ Object

    Parameters:

    • name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :name (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#cust_subscription_idString (readonly)

The RDS event notification subscription Id.

Returns:

  • (String)

    The RDS event notification subscription Id.

#customer_aws_idString (readonly)

The AWS customer account associated with the RDS event notification subscription.

Returns:

  • (String)

    The AWS customer account associated with the RDS event notification subscription.

#enabledBoolean (readonly)

A Boolean value indicating if the subscription is enabled. True indicates the subscription is enabled.

Returns:

  • (Boolean)

    A Boolean value indicating if the subscription is enabled.

#event_categories_listArray<String> (readonly)

A list of event categories for the RDS event notification subscription.

Returns:

  • (Array<String>)

    A list of event categories for the RDS event notification subscription.

#event_subscription_arnString (readonly)

The Amazon Resource Name (ARN) for the event subscription.

Returns:

  • (String)

    The Amazon Resource Name (ARN) for the event subscription.

#nameString (readonly)

Returns:

  • (String)

#sns_topic_arnString (readonly)

The topic ARN of the RDS event notification subscription.

Returns:

  • (String)

    The topic ARN of the RDS event notification subscription.

#source_ids_listArray<String> (readonly)

A list of source IDs for the RDS event notification subscription.

Returns:

  • (Array<String>)

    A list of source IDs for the RDS event notification subscription.

#source_typeString (readonly)

The source type for the RDS event notification subscription.

Returns:

  • (String)

    The source type for the RDS event notification subscription.

#statusString (readonly)

The status of the RDS event notification subscription.

Constraints:

Can be one of the following: creating | modifying | deleting | active | no-permission | topic-not-exist

The status \"no-permission\" indicates that RDS no longer has permission to post to the SNS topic. The status \"topic-not-exist\" indicates that the topic was deleted after the subscription was created.

Returns:

  • (String)

    The status of the RDS event notification subscription.

#subscription_creation_timeString (readonly)

The time the RDS event notification subscription was created.

Returns:

  • (String)

    The time the RDS event notification subscription was created.

Instance Method Details

#add_subscriber(options = {}) ⇒ EventSubscription

Examples:

Request syntax example with placeholder values


eventsubscription.add_subscriber({
  source_identifier: "String", # required
})

Basic usage

eventsubscription = eventsubscription.add_subscriber(options)
eventsubscription.name
#=> "eventsubscription-name"

Options Hash (options):

  • :source_identifier (required, String)

    The identifier of the event source to be added.

    Constraints:

    • 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.

Returns:

See Also:

#create(options = {}) ⇒ EventSubscription

Examples:

Request syntax example with placeholder values


eventsubscription.create({
  sns_topic_arn: "String", # required
  source_type: "String",
  event_categories: ["String"],
  source_ids: ["String"],
  enabled: false,
  tags: [
    {
      key: "String",
      value: "String",
    },
  ],
})

Basic usage

eventsubscription = eventsubscription.create(options)
eventsubscription.name
#=> "eventsubscription-name"

Options Hash (options):

  • :sns_topic_arn (required, String)

    The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.

  • :source_type (String)

    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. 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

  • :event_categories (Array<String>)

    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 Events in the Amazon RDS User Guide or by using the DescribeEventCategories operation.

  • :source_ids (Array<String>)

    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 a SourceIds value is 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.

  • :enabled (Boolean)

    A value that indicates whether to activate the subscription. If the event notification subscription isn\'t activated, the subscription is created but not active.

  • :tags (Array<Types::Tag>)

    A list of tags. For more information, see Tagging Amazon RDS Resources in the Amazon RDS User Guide.

Returns:

See Also:

#deleteEventSubscription

Examples:

Request syntax example with placeholder values


eventsubscription.delete()

Basic usage

eventsubscription = eventsubscription.delete(options)
eventsubscription.name
#=> "eventsubscription-name"

Returns:

See Also:

#modify(options = {}) ⇒ EventSubscription

Examples:

Request syntax example with placeholder values


eventsubscription.modify({
  sns_topic_arn: "String",
  source_type: "String",
  event_categories: ["String"],
  enabled: false,
})

Basic usage

eventsubscription = eventsubscription.modify(options)
eventsubscription.name
#=> "eventsubscription-name"

Options Hash (options):

  • :sns_topic_arn (String)

    The Amazon Resource Name (ARN) of the SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.

  • :source_type (String)

    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 would set this parameter to db-instance. 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

  • :event_categories (Array<String>)

    A list of event categories for a source type (SourceType) that you want to subscribe to. You can see a list of the categories for a given source type in Events in the Amazon RDS User Guide or by using the DescribeEventCategories operation.

  • :enabled (Boolean)

    A value that indicates whether to activate the subscription.

Returns:

See Also:

#remove_subscriber(options = {}) ⇒ EventSubscription

Examples:

Request syntax example with placeholder values


eventsubscription.remove_subscriber({
  source_identifier: "String", # required
})

Basic usage

eventsubscription = eventsubscription.remove_subscriber(options)
eventsubscription.name
#=> "eventsubscription-name"

Options Hash (options):

  • :source_identifier (required, String)

    The source identifier to be removed from the subscription, such as the DB instance identifier for a DB instance or the name of a security group.

Returns:

See Also: