StartMetadataModelExportAsScript - Amazon Database Migration Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Saves your converted code to a file as a SQL script, and stores this file on your Amazon S3 bucket.

Request Syntax

{ "FileName": "string", "MigrationProjectIdentifier": "string", "Origin": "string", "SelectionRules": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


The name of the model file to create in the Amazon S3 bucket.

Type: String

Required: No


The migration project name or Amazon Resource Name (ARN).

Type: String

Required: Yes


Whether to export the metadata model from the source or the target.

Type: String

Valid Values: SOURCE | TARGET

Required: Yes


A value that specifies the database objects to export.

Type: String

Required: Yes

Response Syntax

{ "RequestIdentifier": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The identifier for the export operation.

Type: String


For information about the errors that are common to all actions, see Common Errors.


Amazon DMS was denied access to the endpoint. Check that the role is correctly configured.

HTTP Status Code: 400


The resource is in a state that prevents it from being used for database migration.

HTTP Status Code: 400


Amazon DMS cannot access the KMS key.

HTTP Status Code: 400


The resource you are attempting to create already exists.

HTTP Status Code: 400


The resource could not be found.

HTTP Status Code: 400


The quota for this resource quota has been exceeded.

HTTP Status Code: 400


Insufficient privileges are preventing access to an Amazon S3 object.

HTTP Status Code: 400


A specified Amazon S3 bucket, bucket folder, or other object can't be found.

HTTP Status Code: 400



This example illustrates one usage of StartMetadataModelExportAsScript.

Sample Request

awsdms start-metadata-model-export-as-script --migration-project-identifier arn:aws:dms:us-east-1:012345678901:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRSTUVWXYZ012345 --selection-rules "{\"rules\": [{\"rule-type\": \"selection\",\"rule-id\": \"1\",\"rule-name\": \"1\",\"object-locator\": {\"server-name\": \"\", \"schema-name\": \"schema1\", \"table-name\": \"Cities\"},\"rule-action\": \"explicit\"} ]}" --origin SOURCE --file-name file

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: