create_event_subscription
async
¶
create_event_subscription(
subscription_name: String,
sns_topic_arn: String,
*,
config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
source_type: Optional[String] = None,
event_categories: Optional[EventCategoriesList] = None,
source_ids: Optional[SourceIdsList] = None,
enabled: Optional[BooleanOptional] = None,
tags: Optional[TagList] = None,
) -> CreateEventSubscriptionResponse
Creates an DMS event notification subscription.
You can specify the type of source (SourceType) you want to be notified of, provide a list of DMS source IDs (SourceIds) that triggers the events, and provide a list of event categories (EventCategories) for events you want to be notified of. If you specify both the SourceType and SourceIds, such as SourceType = replication-instance and SourceIdentifier = my-replinstance, you will be notified of all the replication instance events for the specified source. If you specify a SourceType but don't specify a SourceIdentifier, you receive notice of the events for that source type for all your DMS sources. If you don't specify either SourceType nor SourceIdentifier, you will be notified of events generated from all DMS sources belonging to your customer account.
For more information about DMS events, see Working with Events and Notifications in the Database Migration Service User Guide.
Parameters:
-
subscription_name(String) –The name of the DMS event notification subscription. This name must be less than 255 characters.
-
sns_topic_arn(String) –The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification. The ARN is created by Amazon SNS when you create a topic and subscribe to it.
-
source_type(Optional[String], default:None) –The type of DMS resource that generates the events. For example, if you want to be notified of events generated by a replication instance, you set this parameter to
replication-instance. If this value isn't specified, all events are returned.Valid values:
replication-instance|replication-task -
event_categories(Optional[EventCategoriesList], default:None) –A list of event categories for a source type that you want to subscribe to. For more information, see Working with Events and Notifications in the Database Migration Service User Guide.
-
source_ids(Optional[SourceIdsList], default:None) –A list of identifiers for which DMS provides notification events.
If you don't specify a value, notifications are provided for all sources.
If you specify multiple values, they must be of the same type. For example, if you specify a database instance ID, then all of the other values must be database instance IDs.
-
enabled(Optional[BooleanOptional], default:None) –A Boolean value; set to
trueto activate the subscription, or set tofalseto create the subscription but not activate it. -
tags(Optional[TagList], default:None) –One or more tags to be assigned to the event subscription.
Raises:
-
KMSAccessDeniedFault–The ciphertext references a key that doesn't exist or that the DMS account doesn't have access to.
-
KMSDisabledFault–The specified KMS key isn't enabled.
-
KMSInvalidStateFault–The state of the specified KMS resource isn't valid for this request.
-
KMSNotFoundFault–The specified KMS entity or resource can't be found.
-
KMSThrottlingFault–This request triggered KMS request throttling.
-
ResourceAlreadyExistsFault–The resource you are attempting to create already exists.
-
ResourceNotFoundFault–The resource could not be found.
-
ResourceQuotaExceededFault–The quota for this resource quota has been exceeded.
-
SNSInvalidTopicFault–The SNS topic is invalid.
-
SNSNoAuthorizationFault–You are not authorized for the SNS subscription.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 | |