Skip to content

create_migration_project async

create_migration_project(
    source_data_provider_descriptors: DataProviderDescriptorDefinitionList,
    target_data_provider_descriptors: DataProviderDescriptorDefinitionList,
    instance_profile_identifier: String,
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    migration_project_name: Optional[String] = None,
    transformation_rules: Optional[String] = None,
    description: Optional[String] = None,
    tags: Optional[TagList] = None,
    schema_conversion_application_attributes: Optional[SCApplicationAttributes] = None,
) -> CreateMigrationProjectResponse

Creates the migration project using the specified parameters.

You can run this action only after you create an instance profile and data providers using CreateInstanceProfile and CreateDataProvider.

Required permissions: dms:CreateMigrationProject. For more information, see Actions, resources, and condition keys for Database Migration Service.

Parameters:

  • migration_project_name (Optional[String], default: None ) –

    A user-friendly name for the migration project.

  • source_data_provider_descriptors (DataProviderDescriptorDefinitionList) –

    Information about the source data provider, including the name, ARN, and Secrets Manager parameters.

  • target_data_provider_descriptors (DataProviderDescriptorDefinitionList) –

    Information about the target data provider, including the name, ARN, and Amazon Web Services Secrets Manager parameters.

  • instance_profile_identifier (String) –

    The identifier of the associated instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.

  • transformation_rules (Optional[String], default: None ) –

    A JSON string that specifies the transformation rules for the migration project. Transformation rules let you customize how DMS Schema Conversion converts your source database objects, including renaming, adding prefixes or suffixes, and changing data types. For the transformation rule format and examples, see Transformation rules in DMS Schema Conversion.

    Homogeneous data migrations do not support transformation rules.

  • description (Optional[String], default: None ) –

    A user-friendly description of the migration project.

  • tags (Optional[TagList], default: None ) –

    One or more tags to be assigned to the migration project.

  • schema_conversion_application_attributes (Optional[SCApplicationAttributes], default: None ) –

    The schema conversion application attributes, including the Amazon S3 bucket name and Amazon S3 role ARN.

Raises:

Examples:

Create a migration project The following example creates a migration project.

>>> await client.create_migration_project(migration_project_name='example-migration-project', description='Example migration project for documentation', source_data_provider_descriptors=[{'DataProviderIdentifier': 'arn:aws:dms:us-east-1:111122223333:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS', 'SecretsManagerSecretId': 'arn:aws:secretsmanager:us-east-1:111122223333:secret:example-source-secret-A1B2C3', 'SecretsManagerAccessRoleArn': 'arn:aws:iam::111122223333:role/example-secrets-manager-role'}], target_data_provider_descriptors=[{'DataProviderIdentifier': 'arn:aws:dms:us-east-1:111122223333:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS', 'SecretsManagerSecretId': 'arn:aws:secretsmanager:us-east-1:111122223333:secret:example-target-secret-A1B2C3', 'SecretsManagerAccessRoleArn': 'arn:aws:iam::111122223333:role/example-secrets-manager-role'}], instance_profile_identifier='arn:aws:dms:us-east-1:111122223333:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS', transformation_rules='{"rules":[{"rule-type":"transformation","rule-id":"1","rule-name":"1","rule-target":"schema","rule-action":"rename","object-locator":{"schema-name":"ExampleSchema"},"value":"TargetSchema"}]}', schema_conversion_application_attributes={'S3BucketPath': 's3://amzn-s3-demo-bucket', 'S3BucketRoleArn': 'arn:aws:iam::111122223333:role/example-s3-access-role'})
Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
async def create_migration_project(
    self,
    source_data_provider_descriptors: "capo_database_migration_service.types.data_provider_descriptor_definition_list.DataProviderDescriptorDefinitionList",
    target_data_provider_descriptors: "capo_database_migration_service.types.data_provider_descriptor_definition_list.DataProviderDescriptorDefinitionList",
    instance_profile_identifier: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
    migration_project_name: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    transformation_rules: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    description: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
    tags: Optional["capo_database_migration_service.types.tag_list.TagList"] = None,
    schema_conversion_application_attributes: Optional[
        "capo_database_migration_service.types.sc_application_attributes.SCApplicationAttributes"
    ] = None,
) -> "capo_database_migration_service.types.create_migration_project_response.CreateMigrationProjectResponse":
    """<p>Creates the migration project using the specified parameters.</p> <p>You can run this action only after you create an instance profile and data providers using <a href="https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateInstanceProfile.html">CreateInstanceProfile</a> and <a href="https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateDataProvider.html">CreateDataProvider</a>.</p> <p> <b>Required permissions:</b> <code>dms:CreateMigrationProject</code>. For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsdatabasemigrationservice.html">Actions, resources, and condition keys for Database Migration Service</a>.</p>

    Args:
        migration_project_name: <p>A user-friendly name for the migration project.</p>
        source_data_provider_descriptors: <p>Information about the source data provider, including the name, ARN, and Secrets Manager parameters.</p>
        target_data_provider_descriptors: <p>Information about the target data provider, including the name, ARN, and Amazon Web Services Secrets Manager parameters.</p>
        instance_profile_identifier: <p>The identifier of the associated instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.</p>
        transformation_rules: <p>A JSON string that specifies the transformation rules for the migration project. Transformation rules let you customize how DMS Schema Conversion converts your source database objects, including renaming, adding prefixes or suffixes, and changing data types. For the transformation rule format and examples, see <a href="https://docs.aws.amazon.com/dms/latest/userguide/sc-transformation-rules.html">Transformation rules in DMS Schema Conversion</a>.</p> <note> <p>Homogeneous data migrations do not support transformation rules.</p> </note>
        description: <p>A user-friendly description of the migration project.</p>
        tags: <p>One or more tags to be assigned to the migration project.</p>
        schema_conversion_application_attributes: <p>The schema conversion application attributes, including the Amazon S3 bucket name and Amazon S3 role ARN.</p>

    Raises:
        capo_database_migration_service.errors.access_denied_fault.AccessDeniedFault: <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
        capo_database_migration_service.errors.failed_dependency_fault.FailedDependencyFault: <p>A dependency threw an exception.</p>
        capo_database_migration_service.errors.resource_already_exists_fault.ResourceAlreadyExistsFault: <p>The resource you are attempting to create already exists.</p>
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.resource_quota_exceeded_fault.ResourceQuotaExceededFault: <p>The quota for this resource quota has been exceeded.</p>
        capo_database_migration_service.errors.s3_access_denied_fault.S3AccessDeniedFault: <p>Insufficient privileges are preventing access to an Amazon S3 object.</p>
        capo_database_migration_service.errors.s3_resource_not_found_fault.S3ResourceNotFoundFault: <p>A specified Amazon S3 bucket, bucket folder, or other object can't be found.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Create a migration project
        The following example creates a migration project.

        >>> await client.create_migration_project(migration_project_name='example-migration-project', description='Example migration project for documentation', source_data_provider_descriptors=[{'DataProviderIdentifier': 'arn:aws:dms:us-east-1:111122223333:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS', 'SecretsManagerSecretId': 'arn:aws:secretsmanager:us-east-1:111122223333:secret:example-source-secret-A1B2C3', 'SecretsManagerAccessRoleArn': 'arn:aws:iam::111122223333:role/example-secrets-manager-role'}], target_data_provider_descriptors=[{'DataProviderIdentifier': 'arn:aws:dms:us-east-1:111122223333:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS', 'SecretsManagerSecretId': 'arn:aws:secretsmanager:us-east-1:111122223333:secret:example-target-secret-A1B2C3', 'SecretsManagerAccessRoleArn': 'arn:aws:iam::111122223333:role/example-secrets-manager-role'}], instance_profile_identifier='arn:aws:dms:us-east-1:111122223333:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS', transformation_rules='{"rules":[{"rule-type":"transformation","rule-id":"1","rule-name":"1","rule-target":"schema","rule-action":"rename","object-locator":{"schema-name":"ExampleSchema"},"value":"TargetSchema"}]}', schema_conversion_application_attributes={'S3BucketPath': 's3://amzn-s3-demo-bucket', 'S3BucketRoleArn': 'arn:aws:iam::111122223333:role/example-s3-access-role'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_database_migration_service.types.create_migration_project_message.CreateMigrationProjectMessage]",
    ) -> AsyncOperationResponse[
        "capo_database_migration_service.types.create_migration_project_response.CreateMigrationProjectResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.create_migration_project

        (
            output,
            http_response,
        ) = await capo_database_migration_service._operations.amazon_dm_sv20160101.create_migration_project.async_create_migration_project(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMigrationProject")
    )
    input_: capo_database_migration_service.types.create_migration_project_message.CreateMigrationProjectMessage = {
        "source_data_provider_descriptors": source_data_provider_descriptors,
        "target_data_provider_descriptors": target_data_provider_descriptors,
        "instance_profile_identifier": instance_profile_identifier,
    }
    if migration_project_name is not None:
        input_["migration_project_name"] = migration_project_name
    if transformation_rules is not None:
        input_["transformation_rules"] = transformation_rules
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if schema_conversion_application_attributes is not None:
        input_["schema_conversion_application_attributes"] = (
            schema_conversion_application_attributes
        )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output