create_replication_task
¶
create_replication_task(
replication_task_identifier: String,
source_endpoint_arn: String,
target_endpoint_arn: String,
replication_instance_arn: String,
migration_type: MigrationTypeValue,
table_mappings: String,
*,
config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
replication_task_settings: Optional[String] = None,
cdc_start_time: Optional[TStamp] = None,
cdc_start_position: Optional[String] = None,
cdc_stop_position: Optional[String] = None,
tags: Optional[TagList] = None,
task_data: Optional[String] = None,
resource_identifier: Optional[String] = None,
) -> CreateReplicationTaskResponse
Creates a replication task using the specified parameters.
Parameters:
-
replication_task_identifier(String) –An identifier for the replication task.
Constraints:
-
Must contain 1-255 alphanumeric characters or hyphens.
-
First character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
-
-
source_endpoint_arn(String) –An Amazon Resource Name (ARN) that uniquely identifies the source endpoint.
-
target_endpoint_arn(String) –An Amazon Resource Name (ARN) that uniquely identifies the target endpoint.
-
replication_instance_arn(String) –The Amazon Resource Name (ARN) of a replication instance.
-
migration_type(MigrationTypeValue) –The migration type. Valid values:
full-load|cdc|full-load-and-cdc -
table_mappings(String) –The table mappings for the task, in JSON format. For more information, see Using Table Mapping to Specify Task Settings in the Database Migration Service User Guide.
-
replication_task_settings(Optional[String], default:None) –Overall settings for the task, in JSON format. For more information, see Specifying Task Settings for Database Migration Service Tasks in the Database Migration Service User Guide.
-
cdc_start_time(Optional[TStamp], default:None) –Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime or CdcStartPosition to specify when you want a CDC operation to start. Specifying both values results in an error.
Timestamp Example: --cdc-start-time “2018-03-08T12:12:12”
-
cdc_start_position(Optional[String], default:None) –Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition or CdcStartTime to specify when you want a CDC operation to start. Specifying both values results in an error.
The value can be in date, checkpoint, or LSN/SCN format.
Date Example: --cdc-start-position “2018-03-08T12:12:12”
Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93"
LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373”
When you use this task setting with a source PostgreSQL database, a logical replication slot should already be created and associated with the source endpoint. You can verify this by setting the
slotNameextra connection attribute to the name of this logical replication slot. For more information, see Extra Connection Attributes When Using PostgreSQL as a Source for DMS. -
cdc_stop_position(Optional[String], default:None) –Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or commit time.
Server time example: --cdc-stop-position “server_time:2018-02-09T12:12:12”
Commit time example: --cdc-stop-position “commit_time:2018-02-09T12:12:12“
-
tags(Optional[TagList], default:None) –One or more tags to be assigned to the replication task.
-
task_data(Optional[String], default:None) –Supplemental information that the task requires to migrate the data for certain source and target endpoints. For more information, see Specifying Supplemental Data for Task Settings in the Database Migration Service User Guide.
-
resource_identifier(Optional[String], default:None) –A friendly name for the resource identifier at the end of the
EndpointArnresponse parameter that is returned in the createdEndpointobject. The value for this parameter can have up to 31 characters. It can contain only ASCII letters, digits, and hyphen ('-'). Also, it can't end with a hyphen or contain two consecutive hyphens, and can only begin with a letter, such asExample-App-ARN1. For example, this value might result in theEndpointArnvaluearn:aws:dms:eu-west-1:012345678901:rep:Example-App-ARN1. If you don't specify aResourceIdentifiervalue, DMS generates a default identifier value for the end ofEndpointArn.
Raises:
-
AccessDeniedFault–DMS was denied access to the endpoint. Check that the role is correctly configured.
-
InvalidResourceStateFault–The resource is in a state that prevents it from being used for database migration.
-
KMSKeyNotAccessibleFault–DMS cannot access the KMS key.
-
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.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create replication task Creates a replication task using the specified parameters.
>>> client.create_replication_task(replication_task_identifier='task1', source_endpoint_arn='arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE', target_endpoint_arn='arn:aws:dms:us-east-1:123456789012:endpoint:ASXWXJZLNWNT5HTWCGV2BUJQ7E', replication_instance_arn='arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ', migration_type='full-load', table_mappings='file://mappingfile.json', replication_task_settings='', cdc_start_time='2016-12-14T18:25:43Z', tags=[{'Key': 'Acount', 'Value': '24352226'}])
Source code in docs_src/capo_database_migration_service/_services/database_migration_service.py
1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 | |