AddSourceIdentifierToSubscriptionCommand

Adds a source identifier to an existing event notification subscription.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DocDBClient, AddSourceIdentifierToSubscriptionCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, AddSourceIdentifierToSubscriptionCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // AddSourceIdentifierToSubscriptionMessage
  SubscriptionName: "STRING_VALUE", // required
  SourceIdentifier: "STRING_VALUE", // required
};
const command = new AddSourceIdentifierToSubscriptionCommand(input);
const response = await client.send(command);
// { // AddSourceIdentifierToSubscriptionResult
//   EventSubscription: { // EventSubscription
//     CustomerAwsId: "STRING_VALUE",
//     CustSubscriptionId: "STRING_VALUE",
//     SnsTopicArn: "STRING_VALUE",
//     Status: "STRING_VALUE",
//     SubscriptionCreationTime: "STRING_VALUE",
//     SourceType: "STRING_VALUE",
//     SourceIdsList: [ // SourceIdsList
//       "STRING_VALUE",
//     ],
//     EventCategoriesList: [ // EventCategoriesList
//       "STRING_VALUE",
//     ],
//     Enabled: true || false,
//     EventSubscriptionArn: "STRING_VALUE",
//   },
// };

AddSourceIdentifierToSubscriptionCommand Input

Parameter
Type
Description
SourceIdentifier
Required
string | undefined

The identifier of the event source to be added:

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

SubscriptionName
Required
string | undefined

The name of the Amazon DocumentDB event notification subscription that you want to add a source identifier to.

AddSourceIdentifierToSubscriptionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
EventSubscription
EventSubscription | undefined

Detailed information about an event to which you have subscribed.

Throws

Name
Fault
Details
SourceNotFoundFault
client

The requested source could not be found.

SubscriptionNotFoundFault
client

The subscription name does not exist.

DocDBServiceException
Base exception class for all service exceptions from DocDB service.