DatabaseMigrationService / Client / create_data_migration
create_data_migration¶
- DatabaseMigrationService.Client.create_data_migration(**kwargs)¶
- Creates a data migration using the provided settings. - See also: AWS API Documentation - Request Syntax- response = client.create_data_migration( DataMigrationName='string', MigrationProjectIdentifier='string', DataMigrationType='full-load'|'cdc'|'full-load-and-cdc', ServiceAccessRoleArn='string', EnableCloudwatchLogs=True|False, SourceDataSettings=[ { 'CDCStartPosition': 'string', 'CDCStartTime': datetime(2015, 1, 1), 'CDCStopTime': datetime(2015, 1, 1), 'SlotName': 'string' }, ], TargetDataSettings=[ { 'TablePreparationMode': 'do-nothing'|'truncate'|'drop-tables-on-target' }, ], NumberOfJobs=123, Tags=[ { 'Key': 'string', 'Value': 'string', 'ResourceArn': 'string' }, ], SelectionRules='string' ) - Parameters:
- DataMigrationName (string) – - A user-friendly name for the data migration. Data migration names have the following constraints: - Must begin with a letter, and can only contain ASCII letters, digits, and hyphens. 
- Can’t end with a hyphen or contain two consecutive hyphens. 
- Length must be from 1 to 255 characters. 
 
- MigrationProjectIdentifier (string) – - [REQUIRED] - An identifier for the migration project. 
- DataMigrationType (string) – - [REQUIRED] - Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC. 
- ServiceAccessRoleArn (string) – - [REQUIRED] - The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration. 
- EnableCloudwatchLogs (boolean) – Specifies whether to enable CloudWatch logs for the data migration. 
- SourceDataSettings (list) – - Specifies information about the source data provider. - (dict) – - Defines settings for a source data provider for a data migration. - CDCStartPosition (string) – - The change data capture (CDC) start position for the source data provider. 
- CDCStartTime (datetime) – - The change data capture (CDC) start time for the source data provider. 
- CDCStopTime (datetime) – - The change data capture (CDC) stop time for the source data provider. 
- SlotName (string) – - The name of the replication slot on the source data provider. This attribute is only valid for a PostgreSQL or Aurora PostgreSQL source. 
 
 
- TargetDataSettings (list) – - Specifies information about the target data provider. - (dict) – - Defines settings for a target data provider for a data migration. - TablePreparationMode (string) – - This setting determines how DMS handles the target tables before starting a data migration, either by leaving them untouched, dropping and recreating them, or truncating the existing data in the target tables. 
 
 
- NumberOfJobs (integer) – The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target. 
- Tags (list) – - One or more tags to be assigned to the data migration. - (dict) – - A user-defined key-value pair that describes metadata added to an DMS resource and that is used by operations such as the following: - AddTagsToResource
- ListTagsForResource
- RemoveTagsFromResource
 - Key (string) – - A key is the required name of the tag. The string value can be 1-128 Unicode characters in length and can’t be prefixed with “aws:” or “dms:”. The string can only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘/’, ‘=’, ‘+’, ‘-’ (Java regular expressions: “^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$”). 
- Value (string) – - A value is the optional value of the tag. The string value can be 1-256 Unicode characters in length and can’t be prefixed with “aws:” or “dms:”. The string can only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘/’, ‘=’, ‘+’, ‘-’ (Java regular expressions: “^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$”). 
- ResourceArn (string) – - The Amazon Resource Name (ARN) string that uniquely identifies the resource for which the tag is created. 
 
 
- SelectionRules (string) – An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration. 
 
- Return type:
- dict 
- Returns:
- Response Syntax- { 'DataMigration': { 'DataMigrationName': 'string', 'DataMigrationArn': 'string', 'DataMigrationCreateTime': datetime(2015, 1, 1), 'DataMigrationStartTime': datetime(2015, 1, 1), 'DataMigrationEndTime': datetime(2015, 1, 1), 'ServiceAccessRoleArn': 'string', 'MigrationProjectArn': 'string', 'DataMigrationType': 'full-load'|'cdc'|'full-load-and-cdc', 'DataMigrationSettings': { 'NumberOfJobs': 123, 'CloudwatchLogsEnabled': True|False, 'SelectionRules': 'string' }, 'SourceDataSettings': [ { 'CDCStartPosition': 'string', 'CDCStartTime': datetime(2015, 1, 1), 'CDCStopTime': datetime(2015, 1, 1), 'SlotName': 'string' }, ], 'TargetDataSettings': [ { 'TablePreparationMode': 'do-nothing'|'truncate'|'drop-tables-on-target' }, ], 'DataMigrationStatistics': { 'TablesLoaded': 123, 'ElapsedTimeMillis': 123, 'TablesLoading': 123, 'FullLoadPercentage': 123, 'CDCLatency': 123, 'TablesQueued': 123, 'TablesErrored': 123, 'StartTime': datetime(2015, 1, 1), 'StopTime': datetime(2015, 1, 1) }, 'DataMigrationStatus': 'string', 'PublicIpAddresses': [ 'string', ], 'DataMigrationCidrBlocks': [ 'string', ], 'LastFailureMessage': 'string', 'StopReason': 'string' } } - Response Structure- (dict) – - DataMigration (dict) – - Information about the created data migration. - DataMigrationName (string) – - The user-friendly name for the data migration. 
- DataMigrationArn (string) – - The Amazon Resource Name (ARN) that identifies this replication. 
- DataMigrationCreateTime (datetime) – - The UTC time when DMS created the data migration. 
- DataMigrationStartTime (datetime) – - The UTC time when DMS started the data migration. 
- DataMigrationEndTime (datetime) – - The UTC time when data migration ended. 
- ServiceAccessRoleArn (string) – - The IAM role that the data migration uses to access Amazon Web Services resources. 
- MigrationProjectArn (string) – - The Amazon Resource Name (ARN) of the data migration’s associated migration project. 
- DataMigrationType (string) – - Specifies whether the data migration is full-load only, change data capture (CDC) only, or full-load and CDC. 
- DataMigrationSettings (dict) – - Specifies CloudWatch settings and selection rules for the data migration. - NumberOfJobs (integer) – - The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target. 
- CloudwatchLogsEnabled (boolean) – - Whether to enable CloudWatch logging for the data migration. 
- SelectionRules (string) – - A JSON-formatted string that defines what objects to include and exclude from the migration. 
 
- SourceDataSettings (list) – - Specifies information about the data migration’s source data provider. - (dict) – - Defines settings for a source data provider for a data migration. - CDCStartPosition (string) – - The change data capture (CDC) start position for the source data provider. 
- CDCStartTime (datetime) – - The change data capture (CDC) start time for the source data provider. 
- CDCStopTime (datetime) – - The change data capture (CDC) stop time for the source data provider. 
- SlotName (string) – - The name of the replication slot on the source data provider. This attribute is only valid for a PostgreSQL or Aurora PostgreSQL source. 
 
 
- TargetDataSettings (list) – - Specifies information about the data migration’s target data provider. - (dict) – - Defines settings for a target data provider for a data migration. - TablePreparationMode (string) – - This setting determines how DMS handles the target tables before starting a data migration, either by leaving them untouched, dropping and recreating them, or truncating the existing data in the target tables. 
 
 
- DataMigrationStatistics (dict) – - Provides information about the data migration’s run, including start and stop time, latency, and data migration progress. - TablesLoaded (integer) – - The number of tables loaded in the current data migration run. 
- ElapsedTimeMillis (integer) – - The elapsed duration of the data migration run. 
- TablesLoading (integer) – - The data migration’s table loading progress. 
- FullLoadPercentage (integer) – - The data migration’s progress in the full-load migration phase. 
- CDCLatency (integer) – - The current latency of the change data capture (CDC) operation. 
- TablesQueued (integer) – - The number of tables that are waiting for processing. 
- TablesErrored (integer) – - The number of tables that DMS failed to process. 
- StartTime (datetime) – - The time when the migration started. 
- StopTime (datetime) – - The time when the migration stopped or failed. 
 
- DataMigrationStatus (string) – - The current status of the data migration. 
- PublicIpAddresses (list) – - The IP addresses of the endpoints for the data migration. - (string) – 
 
- DataMigrationCidrBlocks (list) – - The CIDR blocks of the endpoints for the data migration. - (string) – 
 
- LastFailureMessage (string) – - Information about the data migration’s most recent error or failure. 
- StopReason (string) – - The reason the data migration last stopped. 
 
 
 
 - Exceptions- DatabaseMigrationService.Client.exceptions.ResourceQuotaExceededFault
- DatabaseMigrationService.Client.exceptions.ResourceNotFoundFault
- DatabaseMigrationService.Client.exceptions.ResourceAlreadyExistsFault
- DatabaseMigrationService.Client.exceptions.InvalidOperationFault
- DatabaseMigrationService.Client.exceptions.FailedDependencyFault