View a markdown version of this page

AWS DMS を使用した の例 AWS CLI - AWS SDK コードの例

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

AWS DMS を使用した の例 AWS CLI

次のコード例は、 AWS Command Line Interface で を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています AWS DMS。

アクションはより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。

トピック

アクション

次のコード例は、add-tags-to-resource を使用する方法を示しています。

AWS CLI

リソースにタグを追加するには

次の add-tags-to-resource の例では、タグをレプリケーション インスタンスに追加しています。

aws dms add-tags-to-resource \ --resource-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE \ --tags Key=Environment,Value=PROD Key=Project,Value=dbMigration

このコマンドでは何も出力されません。

詳細については、「AWS Database Migration Service ユーザーガイド」の「Tagging Resources」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「AddTagsToResource」を参照してください。

次の例は、cancel-metadata-model-conversion を使用する方法を説明しています。

AWS CLI

メタデータモデル変換をキャンセルするには

次の のcancel-metadata-model-conversion例では、メタデータモデル変換オペレーションをキャンセルします。

aws dms cancel-metadata-model-conversion \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --request-identifier a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "Request": { "Status": "CANCELING", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" } }

詳細については、「 Database AWS Migration Service ユーザーガイド」の「データベーススキーマの変換」を参照してください。

次の例は、cancel-metadata-model-creation を使用する方法を説明しています。

AWS CLI

メタデータモデルの作成をキャンセルするには

次の のcancel-metadata-model-creation例では、メタデータモデル作成オペレーションをキャンセルします。

aws dms cancel-metadata-model-creation \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --request-identifier a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

出力:

{ "Request": { "Status": "CANCELING", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「ステートメントメタデータモデルの作成」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のCancelMetadataModelCreation」を参照してください。

次の例は、create-data-provider を使用する方法を説明しています。

AWS CLI

例 1: Microsoft SQL Server データプロバイダーを作成するには

次の のcreate-data-provider例では、Microsoft SQL Server データプロバイダーを作成します。

aws dms create-data-provider \ --data-provider-name example-data-provider \ --engine sqlserver \ --description "Example data provider for documentation" \ --settings MicrosoftSqlServerSettings={ServerName=example-source-server.us-east-1.rds.amazonaws.com,Port=1433,DatabaseName=ExampleDatabase,SslMode=verify-full,CertificateArn=arn:aws:dms:us-east-1:123456789012:cert:EXAMPLEABCDEFGHIJKLMNOPQRS}

出力:

{ "DataProvider": { "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS", "DataProviderCreationTime": "2026-01-09T12:30:00.000000+00:00", "Description": "Example data provider for documentation", "Engine": "sqlserver", "Settings": { "MicrosoftSqlServerSettings": { "ServerName": "example-source-server.us-east-1.rds.amazonaws.com", "Port": 1433, "DatabaseName": "ExampleDatabase", "SslMode": "verify-full", "CertificateArn": "arn:aws:dms:us-east-1:123456789012:cert:EXAMPLEABCDEFGHIJKLMNOPQRS" } } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「データプロバイダーの使用」を参照してください。

例 2: 仮想データプロバイダーを作成するには

次のcreate-data-provider例では、データベースへの接続を必要としない仮想データプロバイダーを作成します。

aws dms create-data-provider \ --data-provider-name example-virtual-data-provider \ --engine aurora-postgresql \ --description "Example data provider for documentation" \ --virtual \ --settings PostgreSqlSettings={ServerName=virtual,Port=5432,DatabaseName=virtual,SslMode=none}

出力:

{ "DataProvider": { "DataProviderName": "example-virtual-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS", "DataProviderCreationTime": "2026-01-09T12:30:00.000000+00:00", "Description": "Example data provider for documentation", "Engine": "aurora-postgresql", "Virtual": true, "Settings": { "PostgreSqlSettings": { "ServerName": "virtual", "Port": 5432, "DatabaseName": "virtual", "SslMode": "none" } } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「仮想データプロバイダーの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のCreateDataProvider」を参照してください。

次の例は、create-endpoint を使用する方法を説明しています。

AWS CLI

エンドポイントを作成するには

次の create-endpoint の例では、Amazon S3 ソースのエンドポイントを作成しています。

aws dms create-endpoint \ --endpoint-type source \ --engine-name s3 \ --endpoint-identifier src-endpoint \ --s3-settings file://s3-settings.json

s3-settings.json の内容:

{ "BucketName":"my-corp-data", "BucketFolder":"sourcedata", "ServiceAccessRoleArn":"arn:aws:iam::123456789012:role/my-s3-access-role" }

出力:

{ "Endpoint": { "EndpointIdentifier": "src-endpoint", "EndpointType": "SOURCE", "EngineName": "s3", "EngineDisplayName": "Amazon S3", "ExtraConnectionAttributes": "bucketFolder=sourcedata;bucketName=my-corp-data;compressionType=NONE;csvDelimiter=,;csvRowDelimiter=\\n;", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:GUVAFG34EECUOJ6QVZ56DAHT3U", "SslMode": "none", "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "S3Settings": { "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "CsvRowDelimiter": "\\n", "CsvDelimiter": ",", "BucketFolder": "sourcedata", "BucketName": "my-corp-data", "CompressionType": "NONE", "EnableStatistics": true } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「DMS AWS エンドポイントの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateEndpoint」を参照してください。

次のコード例は、create-event-subscription を使用する方法を示しています。

AWS CLI

イベントサブスクリプションを一覧表示するには

次の create-event-subscription の例では、Amazon SNS トピック (my-sns-topic) へのイベントサブスクリプションを作成しています。

aws dms create-event-subscription \ --subscription-name my-dms-events \ --sns-topic-arn arn:aws:sns:us-east-1:123456789012:my-sns-topic

出力:

{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "creating", "SubscriptionCreationTime": "2020-05-21 21:58:38.598", "Enabled": true } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Working with Events and Notifications」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateEventSubscription」を参照してください。

次の例は、create-instance-profile を使用する方法を説明しています。

AWS CLI

インスタンスプロファイルを作成するには

次の のcreate-instance-profile例では、インスタンスプロファイルを作成します。

aws dms create-instance-profile \ --instance-profile-name example-instance-profile \ --description "Example instance profile for documentation" \ --subnet-group-identifier example-replication-subnet-group \ --vpc-security-groups "sg-0123456789abcdef0" \ --kms-key-arn arn:aws:kms:us-east-1:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ --network-type IPV4 \ --no-publicly-accessible

出力:

{ "InstanceProfile": { "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "PubliclyAccessible": false, "NetworkType": "IPV4", "InstanceProfileName": "example-instance-profile", "Description": "Example instance profile for documentation", "InstanceProfileCreationTime": "2026-01-09T12:30:00.000000+00:00", "SubnetGroupIdentifier": "example-replication-subnet-group", "VpcSecurityGroups": [ "sg-0123456789abcdef0" ] } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「インスタンスプロファイルの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateInstanceProfile」を参照してください。

次の例は、create-migration-project を使用する方法を説明しています。

AWS CLI

移行プロジェクトを作成するには

次の のcreate-migration-project例では、移行プロジェクトを作成します。

aws dms 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:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS,SecretsManagerSecretId=arn:aws:secretsmanager:us-east-1:123456789012:secret:example-source-secret-A1B2C3,SecretsManagerAccessRoleArn=arn:aws:iam::123456789012:role/example-secrets-manager-role \ --target-data-provider-descriptors DataProviderIdentifier=arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS,SecretsManagerSecretId=arn:aws:secretsmanager:us-east-1:123456789012:secret:example-target-secret-A1B2C3,SecretsManagerAccessRoleArn=arn:aws:iam::123456789012:role/example-secrets-manager-role \ --instance-profile-identifier arn:aws:dms:us-east-1:123456789012: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::123456789012:role/example-s3-access-role

出力:

{ "MigrationProject": { "MigrationProjectName": "example-migration-project", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "MigrationProjectCreationTime": "2026-01-09T12:30:00.000000+00:00", "SourceDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-source-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "TargetDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-target-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "InstanceProfileName": "example-instance-profile", "TransformationRules": "{\"rules\":[{\"rule-type\":\"transformation\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"rule-target\":\"schema\",\"rule-action\":\"rename\",\"object-locator\":{\"schema-name\":\"ExampleSchema\"},\"value\":\"TargetSchema\"}]}", "Description": "Example migration project for documentation", "SchemaConversionApplicationAttributes": { "S3BucketPath": "s3://amzn-s3-demo-bucket", "S3BucketRoleArn": "arn:aws:iam::123456789012:role/example-s3-access-role" } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「移行プロジェクトの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のCreateMigrationProject」を参照してください。

次の例は、create-replication-instance を使用する方法を説明しています。

AWS CLI

レプリケーションインスタンスを作成するには

次の create-replication-instance の例では、レプリケーションインスタンスを作成しています。

aws dms create-replication-instance \ --replication-instance-identifier my-repl-instance \ --replication-instance-class dms.t2.micro \ --allocated-storage 5

出力:

{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "creating", "AllocatedStorage": 5, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-f839b688", "Status": "active" } ], "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "default", "ReplicationSubnetGroupDescription": "default", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-42599426", "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-6746046b", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbfff283", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "sat:12:35-sat:13:05", "PendingModifiedValues": {}, "MultiAZ": false, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:ZK2VQBUWFDBAWHIXHAYG5G2PKY", "PubliclyAccessible": true } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS レプリケーションインスタンスの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateReplicationInstance」を参照してください。

次のコード例は、create-replication-subnet-group を使用する方法を示しています。

AWS CLI

サブネットグループを作成するには

次の create-replication-subnet-group の例では、3 つのサブネットで構成されるグループを作成しています。

aws dms create-replication-subnet-group \ --replication-subnet-group-identifier my-subnet-group \ --replication-subnet-group-description "my subnet group" \ --subnet-ids subnet-da327bf6 subnet-bac383e0 subnet-d7c825e8

出力:

{ "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "my-subnet-group", "ReplicationSubnetGroupDescription": "my subnet group", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" } ] } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Setting Up a Network for a Replication Instance」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateReplicationSubnetGroup」を参照してください。

次のコード例は、create-replication-task を使用する方法を示しています。

AWS CLI

レプリケーションタスクを作成するには

次の create-replication-task の例では、レプリケーションタスクを作成しています。

aws dms create-replication-task \ --replication-task-identifier movedata \ --source-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA \ --target-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U \ --replication-instance-arn $RI_ARN \ --migration-type full-load \ --table-mappings file://table-mappings.json

table-mappings.json の内容:

{ "rules": [ { "rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": { "schema-name": "prodrep", "table-name": "%" }, "rule-action": "include", "filters": [] } ] }

出力:

{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted... , "ReplicationTaskSettings": ...output omitted... , "Status": "creating", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS タスクの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「CreateReplicationTask」を参照してください。

次のコード例は、delete-connection を使用する方法を示しています。

AWS CLI

接続を削除するには

次の delete-connection の例では、レプリケーションインスタンスからエンドポイントの関連付けを解除しています。

aws dms delete-connection \ --endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA \ --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE

出力:

{ "Connection": { "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "Status": "deleting", "EndpointIdentifier": "src-database-1", "ReplicationInstanceIdentifier": "my-repl-instance" } }

詳細については、「AWS Database Migration Service ユーザーガイド」の https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Endpoints.Creating.html を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteConnection」を参照してください。

次の例は、delete-data-provider を使用する方法を説明しています。

AWS CLI

データプロバイダーを削除するには

次の のdelete-data-provider例では、ARN によって識別されるデータプロバイダーを削除します。

aws dms delete-data-provider \ --data-provider-identifier arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "DataProvider": { "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS", "DataProviderCreationTime": "2026-01-09T12:30:00.000000+00:00", "Description": "Example data provider for documentation", "Engine": "sqlserver", "Settings": { "MicrosoftSqlServerSettings": { "ServerName": "example-source-server.us-east-1.rds.amazonaws.com", "Port": 1433, "DatabaseName": "ExampleDatabase", "SslMode": "verify-full", "CertificateArn": "arn:aws:dms:us-east-1:123456789012:cert:EXAMPLEABCDEFGHIJKLMNOPQRS" } } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「データプロバイダーの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDeleteDataProvider」を参照してください。

次の例は、delete-endpoint を使用する方法を説明しています。

AWS CLI

エンドポイントを削除するには

次の delete-endpoint の例では、エンドポイントを削除しています。

aws dms delete-endpoint \ --endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:OUJJVXO4XZ4CYTSEG5XGMN2R3Y

出力:

{ "Endpoint": { "EndpointIdentifier": "src-endpoint", "EndpointType": "SOURCE", "EngineName": "s3", "EngineDisplayName": "Amazon S3", "ExtraConnectionAttributes": "bucketFolder=sourcedata;bucketName=my-corp-data;compressionType=NONE;csvDelimiter=,;csvRowDelimiter=\\n;", "Status": "deleting", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:OUJJVXO4XZ4CYTSEG5XGMN2R3Y", "SslMode": "none", "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "S3Settings": { "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "CsvRowDelimiter": "\\n", "CsvDelimiter": ",", "BucketFolder": "sourcedata", "BucketName": "my-corp-data", "CompressionType": "NONE", "EnableStatistics": true } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「DMS AWS エンドポイントの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteEndpoint」を参照してください。

次のコード例は、delete-event-subscription を使用する方法を示しています。

AWS CLI

イベントサブスクリプションを削除するには

次の delete-event-subscription の例では、Amazon SNS トピックへのサブスクリプションを削除しています。

aws dms delete-event-subscription \ --subscription-name "my-dms-events"

出力:

{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "deleting", "SubscriptionCreationTime": "2020-05-21 21:58:38.598", "Enabled": true } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Working with Events and Notifications」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteEventSubscription」を参照してください。

次の例は、delete-instance-profile を使用する方法を説明しています。

AWS CLI

インスタンスプロファイルを削除するには

次の のdelete-instance-profile例では、ARN によって識別されるインスタンスプロファイルを削除します。

aws dms delete-instance-profile \ --instance-profile-identifier arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "InstanceProfile": { "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "PubliclyAccessible": false, "NetworkType": "IPV4", "InstanceProfileName": "example-instance-profile", "Description": "Example instance profile for documentation", "InstanceProfileCreationTime": "2026-01-09T12:30:00.000000+00:00", "SubnetGroupIdentifier": "example-replication-subnet-group", "VpcSecurityGroups": [ "sg-0123456789abcdef0" ] } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「インスタンスプロファイルの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteInstanceProfile」を参照してください。

次の例は、delete-migration-project を使用する方法を説明しています。

AWS CLI

移行プロジェクトを削除するには

次の のdelete-migration-project例では、ARN によって識別される移行プロジェクトを削除します。

aws dms delete-migration-project \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "MigrationProject": { "MigrationProjectName": "example-migration-project", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "MigrationProjectCreationTime": "2026-01-09T12:30:00.000000+00:00", "SourceDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-source-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "TargetDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-target-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "InstanceProfileName": "example-instance-profile", "TransformationRules": "{\"rules\":[{\"rule-type\":\"transformation\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"rule-target\":\"schema\",\"rule-action\":\"rename\",\"object-locator\":{\"schema-name\":\"ExampleSchema\"},\"value\":\"TargetSchema\"}]}", "Description": "Example migration project for documentation", "SchemaConversionApplicationAttributes": { "S3BucketPath": "s3://amzn-s3-demo-bucket", "S3BucketRoleArn": "arn:aws:iam::123456789012:role/example-s3-access-role" } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「移行プロジェクトの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDeleteMigrationProject」を参照してください。

次の例は、delete-replication-instance を使用する方法を説明しています。

AWS CLI

レプリケーションインスタンスを削除するには

次の delete-replication-instance の例では、レプリケーション インスタンスを削除します。

aws dms delete-replication-instance \ --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE

出力:

{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "deleting", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-f839b688", "Status": "active" } ], "AvailabilityZone": "us-east-1e", "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "default", "ReplicationSubnetGroupDescription": "default", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-42599426", "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-6746046b", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbfff283", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "wed:11:42-wed:12:12", "PendingModifiedValues": {}, "MultiAZ": true, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "ReplicationInstancePublicIpAddress": "54.225.120.92", "ReplicationInstancePrivateIpAddress": "172.31.30.121", "ReplicationInstancePublicIpAddresses": [ "54.225.120.92", "3.230.18.248" ], "ReplicationInstancePrivateIpAddresses": [ "172.31.30.121", "172.31.75.90" ], "PubliclyAccessible": true, "SecondaryAvailabilityZone": "us-east-1b" } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS レプリケーションインスタンスの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteReplicationInstance」を参照してください。

次のコード例は、delete-replication-subnet-group を使用する方法を示しています。

AWS CLI

サブネットグループを削除するには

次の delete-replication-subnet-group の例では、サブネットグループを削除しています。

aws dms delete-replication-subnet-group \ --replication-subnet-group-identifier my-subnet-group

出力:

(none)

詳細については、「AWS Database Migration Service ユーザーガイド」の「Setting Up a Network for a Replication Instance」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteReplicationSubnetGroup」を参照してください。

次のコード例は、delete-replication-task を使用する方法を示しています。

AWS CLI

レプリケーションタスクを削除するには

次の delete-replication-task の例では、レプリケーションタスクを削除しています。

aws dms delete-replication-task \ --replication-task-arn arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII

出力:

{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "deleting", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789988.677, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS タスクの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteReplicationTask」を参照してください。

次のコード例は、describe-account-attributes を使用する方法を示しています。

AWS CLI

アカウントの属性を記述するには

次の のdescribe-account-attributes例では、 AWS アカウントの属性を一覧表示します。

aws dms describe-account-attributes

出力:

{ "AccountQuotas": [ { "AccountQuotaName": "ReplicationInstances", "Used": 1, "Max": 20 }, { "AccountQuotaName": "AllocatedStorage", "Used": 5, "Max": 10000 }, ...remaining output omitted... ], "UniqueAccountIdentifier": "cqahfbfy5xee" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeAccountAttributes」を参照してください。

次のコード例は、describe-certificates を使用する方法を示しています。

AWS CLI

使用可能な証明書を一覧表示するには

次の のdescribe-certificates例では、 AWS アカウントで使用可能な証明書を一覧表示します。

aws dms describe-certificates

出力:

{ "Certificates": [ { "CertificateIdentifier": "my-cert", "CertificateCreationDate": 1543259542.506, "CertificatePem": "-----BEGIN CERTIFICATE-----\nMIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQ ...U" ... remaining output omittted ... } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Using SSL」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeCertificates」を参照してください。

次のコード例は、describe-connections を使用する方法を示しています。

AWS CLI

接続を記述するには

次の describe-connections の例では、レプリケーションインスタンスとエンドポイント間でテストした接続を一覧表示しています。

aws dms describe-connections

出力:

{ "Connections": [ { "Status": "successful", "ReplicationInstanceIdentifier": "test", "EndpointArn": "arn:aws:dms:us-east-arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE", "EndpointIdentifier": "testsrc1", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ" } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Creating Source and Target Endpoints」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeConnections」を参照してください。

次の例は、describe-conversion-configuration を使用する方法を説明しています。

AWS CLI

変換設定を記述するには

次の のdescribe-conversion-configuration例では、移行プロジェクトの変換設定を取得します。

aws dms describe-conversion-configuration \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "MigrationProjectIdentifier": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "ConversionConfiguration": "{\"Common project settings\":{\"ShowSeverityLevelInSql\":\"CRITICAL\",\"EnableGenAiConversion\":false},\"MSSQL_TO_AURORA_POSTGRESQL\":{\"ConvertProceduresToFunction\":true,\"UniqueIndexGeneration\":true,\"CaseSensitivityNames\":false},\"Conversion version\":{\"MSSQL_TO_AURORA_POSTGRESQL_target_engine_version\":\"15\"}}" }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「スキーマ変換設定の指定」を参照してください。

次の例は、describe-data-providers を使用する方法を説明しています。

AWS CLI

データプロバイダーを記述するには

次の のdescribe-data-providers例では、ARN によって識別されるデータプロバイダーの詳細を取得します。

aws dms describe-data-providers \ --filters Name=data-provider-identifier,Values=arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "DataProviders": [ { "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS", "DataProviderCreationTime": "2026-01-09T12:30:00.000000+00:00", "Description": "Example data provider for documentation", "Engine": "sqlserver", "Settings": { "MicrosoftSqlServerSettings": { "ServerName": "example-source-server.us-east-1.rds.amazonaws.com", "Port": 1433, "DatabaseName": "ExampleDatabase", "SslMode": "verify-full", "CertificateArn": "arn:aws:dms:us-east-1:123456789012:cert:EXAMPLEABCDEFGHIJKLMNOPQRS" } } } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「データプロバイダーの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDescribeDataProviders」を参照してください。

次の例は、describe-endpoint-types を使用する方法を説明しています。

AWS CLI

使用可能なエンドポイントタイプを一覧表示するには

次の describe-endpoint-types の例では、使用可能な MySQL エンドポイントタイプを一覧表示しています。

aws dms describe-endpoint-types \ --filters "Name=engine-name,Values=mysql"

出力:

{ "SupportedEndpointTypes": [ { "EngineName": "mysql", "SupportsCDC": true, "EndpointType": "source", "EngineDisplayName": "MySQL" }, { "EngineName": "mysql", "SupportsCDC": true, "EndpointType": "target", "EngineDisplayName": "MySQL" } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「Working with AWS DMS Endpoints <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Endpoints.html>`__」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEndpointTypes」を参照してください。

次のコード例は、describe-endpoints を使用する方法を示しています。

AWS CLI

エンドポイントを記述するには

次の のdescribe-endpoints例では、 AWS アカウントのエンドポイントを一覧表示します。

aws dms describe-endpoints

出力:

{ "Endpoints": [ { "Username": "dms", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:SF2WOFLWYWKVEOHID2EKLP3SJI", "ServerName": "ec2-52-32-48-61.us-west-2.compute.amazonaws.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/94d5c4e7-4e4c-44be-b58a-c8da7adf57cd", "DatabaseName": "test", "EngineName": "mysql", "EndpointIdentifier": "pri100", "Port": 8193 }, { "Username": "admin", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:TJJZCIH3CJ24TJRU4VC32WEWFR", "ServerName": "test.example.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/2431021b-1cf2-a2d4-77b2-59a9e4bce323", "DatabaseName": "EMPL", "EngineName": "oracle", "EndpointIdentifier": "test", "Port": 1521 } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「DMS AWS エンドポイントの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEndpoints」を参照してください。

次のコード例は、describe-event-categories を使用する方法を示しています。

AWS CLI

イベントカテゴリを記述するには

次の describe-event-categories の例では、使用可能なイベントカテゴリを一覧表示しています。

aws dms describe-event-categories

出力:

{ "EventCategoryGroupList": [ { "SourceType": "replication-instance", "EventCategories": [ "low storage", "configuration change", "maintenance", "deletion", "creation", "failover", "failure" ] }, { "SourceType": "replication-task", "EventCategories": [ "configuration change", "state change", "deletion", "creation", "failure" ] } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Working with Events and Notifications」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEventCategories」を参照してください。

次のコード例は、describe-event-subscriptions を使用する方法を示しています。

AWS CLI

イベントサブスクリプションを記述するには

次の describe-event-subscriptions の例では、Amazon SNS トピックへのイベントサブスクリプションを一覧表示しています。

aws dms describe-event-subscriptions

出力:

{ "EventSubscriptionsList": [ { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "deleting", "SubscriptionCreationTime": "2020-05-21 22:28:51.924", "Enabled": true } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Working with Events and Notifications」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEventSubscriptions」を参照してください。

次のコード例は、describe-events を使用する方法を示しています。

AWS CLI

DMS イベントを一覧表示するには

次の describe-events の例では、レプリケーションインスタンスから発生したイベントを一覧表示しています。

aws dms describe-events \ --source-type "replication-instance"

出力:

{ "Events": [ { "SourceIdentifier": "my-repl-instance", "SourceType": "replication-instance", "Message": "Replication application shutdown", "EventCategories": [], "Date": 1590771645.776 } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Working with Events and Notifications」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEvents」を参照してください。

次の例は、describe-extension-pack-associations を使用する方法を説明しています。

AWS CLI

拡張パックの関連付けを記述するには

次の のdescribe-extension-pack-associations例では、拡張パックをターゲットデータベースに適用するオペレーションのステータスを取得し、リクエスト IDs。

aws dms describe-extension-pack-associations \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Progress": { "ProgressPercent": 50.0, "ProgressStep": "IN_PROGRESS" } }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "The database user in your target secret does not have sufficient privileges. Grant the required privileges and try again." } } } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「拡張機能パックの使用」を参照してください。

次の例は、describe-instance-profiles を使用する方法を説明しています。

AWS CLI

インスタンスプロファイルを記述するには

次の のdescribe-instance-profiles例では、ARN によって識別されるインスタンスプロファイルの詳細を取得します。

aws dms describe-instance-profiles \ --filters Name=instance-profile-identifier,Values=arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "InstanceProfiles": [ { "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "PubliclyAccessible": false, "NetworkType": "IPV4", "InstanceProfileName": "example-instance-profile", "Description": "Example instance profile for documentation", "InstanceProfileCreationTime": "2026-01-09T12:30:00.000000+00:00", "SubnetGroupIdentifier": "example-replication-subnet-group", "VpcSecurityGroups": [ "sg-0123456789abcdef0" ] } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「インスタンスプロファイルの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDescribeInstanceProfiles」を参照してください。

次の例は、describe-metadata-model-assessments を使用する方法を説明しています。

AWS CLI

メタデータモデル評価を記述するには

次の のdescribe-metadata-model-assessments例では、リクエスト IDs で識別されるメタデータモデル評価オペレーションのステータスを取得します。

aws dms describe-metadata-model-assessments \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Progress": { "ProgressPercent": 50.0, "TotalObjects": 100, "ProgressStep": "ANALYZING", "ProcessedObject": { "Name": "ExampleTable", "Type": "table", "EndpointType": "SOURCE" } } }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "No objects were found according to the specified selection rules. Please review your selection rules and try again." } } } ] }

詳細については、「 Database Migration AWS Service ユーザーガイド」の「データベース移行評価レポートの作成」を参照してください。

次の例は、describe-metadata-model-children を使用する方法を説明しています。

AWS CLI

メタデータモデルの子を記述するには

次の のdescribe-metadata-model-children例では、ソースメタデータツリーからExampleSchemaスキーマの子メタデータモデルを取得します。

aws dms describe-metadata-model-children \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"}, "rule-action": "explicit"}]}' \ --origin SOURCE

出力:

{ "MetadataModelChildren": [ { "MetadataModelName": "Tables", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"1\", \"rule-name\": \"1\", \"object-locator\": {\"server-name\": \"example-source-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"ExampleSchema\", \"category-name\": \"Tables\"}, \"rule-action\": \"explicit\"}]}" }, { "MetadataModelName": "Views", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"2\", \"rule-name\": \"2\", \"object-locator\": {\"server-name\": \"example-source-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"ExampleSchema\", \"category-name\": \"Views\"}, \"rule-action\": \"explicit\"}]}" }, { "MetadataModelName": "Functions", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"3\", \"rule-name\": \"3\", \"object-locator\": {\"server-name\": \"example-source-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"ExampleSchema\", \"category-name\": \"Functions\"}, \"rule-action\": \"explicit\"}]}" }, { "MetadataModelName": "Sequences", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"4\", \"rule-name\": \"4\", \"object-locator\": {\"server-name\": \"example-source-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"ExampleSchema\", \"category-name\": \"Sequences\"}, \"rule-action\": \"explicit\"}]}" } ] }

詳細については、「 Database Migration Service ユーザーガイド」の「メタデータモデルツリーのナビゲート」を参照してください。 AWS

次の例は、describe-metadata-model-conversions を使用する方法を説明しています。

AWS CLI

メタデータモデル変換を記述するには

次の のdescribe-metadata-model-conversions例では、リクエスト IDs で識別されるメタデータモデル変換オペレーションのステータスを取得します。

aws dms describe-metadata-model-conversions \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Progress": { "ProgressPercent": 50.0, "TotalObjects": 100, "ProgressStep": "CONVERTING", "ProcessedObject": { "Name": "ExampleTable", "Type": "table", "EndpointType": "SOURCE" } } }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "No objects were found according to the specified selection rules. Please review your selection rules and try again." } } } ] }

詳細については、「 Database AWS Migration Service ユーザーガイド」の「データベーススキーマの変換」を参照してください。

次の例は、describe-metadata-model-creations を使用する方法を説明しています。

AWS CLI

メタデータモデルの作成を記述するには

次の のdescribe-metadata-model-creations例では、リクエスト IDs で識別されるメタデータモデル作成オペレーションのステータスを取得します。

aws dms describe-metadata-model-creations \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "No objects were found according to the specified selection rules. Please review your selection rules and try again." } } } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「ステートメントメタデータモデルの作成」を参照してください。

次の例は、describe-metadata-model-exports-as-script を使用する方法を説明しています。

AWS CLI

メタデータモデルのエクスポートをスクリプトとして記述するには

次の のdescribe-metadata-model-exports-as-script例では、メタデータモデルをデータ定義言語 (DDL) スクリプトとしてエクスポートするオペレーションのステータスを取得し、リクエスト IDs。

aws dms describe-metadata-model-exports-as-script \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "ExportSqlDetails": { "S3ObjectKey": "s3://amzn-s3-demo-bucket/example-migration-project/ExampleScript.zip", "ObjectURL": "https://amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com/example-migration-project/ExampleScript.zip" } }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Progress": { "ProgressPercent": 50.0, "TotalObjects": 100, "ProgressStep": "IN_PROGRESS", "ProcessedObject": { "EndpointType": "TARGET" } } }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "No objects were found according to the specified selection rules. Please review your selection rules and try again." } } } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「変換したコードを SQL ファイルに保存」を参照してください。

次の例は、describe-metadata-model-exports-to-target を使用する方法を説明しています。

AWS CLI

ターゲットへのメタデータモデルのエクスポートを記述するには

次の のdescribe-metadata-model-exports-to-target例では、変換されたメタデータモデルをターゲットデータベースにエクスポートするオペレーションのステータスを取得し、リクエスト IDs。

aws dms describe-metadata-model-exports-to-target \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Progress": { "ProgressPercent": 50.0, "TotalObjects": 100, "ProgressStep": "APPLYING", "ProcessedObject": { "EndpointType": "TARGET" } } }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "No objects were found according to the specified selection rules. Please review your selection rules and try again." } } } ] }

詳細については、「 Database Migration Service ユーザーガイド」の「変換されたコードの適用」を参照してください。 AWS

次の例は、describe-metadata-model-imports を使用する方法を説明しています。

AWS CLI

メタデータモデルのインポートを記述するには

次の のdescribe-metadata-model-imports例では、リクエスト IDs で識別されるメタデータインポートオペレーションのステータスを取得します。

aws dms describe-metadata-model-imports \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --filters Name=request-id,Values=a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,a1b2c3d4-5678-90ab-cdef-EXAMPLE22222,a1b2c3d4-5678-90ab-cdef-EXAMPLE33333

出力:

{ "Requests": [ { "Status": "SUCCESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }, { "Status": "IN_PROGRESS", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Progress": { "ProgressPercent": 50.0, "TotalObjects": 100, "ProgressStep": "IN_PROGRESS", "ProcessedObject": { "EndpointType": "SOURCE" } } }, { "Status": "FAILED", "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "Error": { "defaultErrorDetails": { "Message": "No objects were found according to the specified selection rules. Please review your selection rules and try again." } } } ] }

詳細については、「 Database Migration Service ユーザーガイド」の「メタデータモデルツリーの操作」を参照してください。 AWS

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDescribeMetadataModelImports」を参照してください。

次の例は、describe-metadata-model を使用する方法を説明しています。

AWS CLI

メタデータモデルを記述するには

次の のdescribe-metadata-model例では、SQL 定義やターゲットデータベース内の対応する変換されたメタデータモデルへの参照など、ExampleSchemaスキーマ内のExampleTableテーブルに関する詳細情報をソースメタデータツリーから取得します。

aws dms describe-metadata-model \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema", "table-name": "ExampleTable"}, "rule-action": "explicit"}]}' \ --origin SOURCE

出力:

{ "MetadataModelName": "ExampleTable", "MetadataModelType": "table", "TargetMetadataModels": [ { "MetadataModelName": "exampletable", "SelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"1\", \"rule-name\": \"1\", \"object-locator\": {\"server-name\": \"example-target-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"exampleschema\", \"table-name\": \"exampletable\"}, \"rule-action\": \"explicit\"}]}" } ], "Definition": "CREATE TABLE ExampleTable (ExampleColumn INTEGER NOT NULL);" }

詳細については、「 Database Migration Service ユーザーガイド」の「メタデータモデルツリーのナビゲート」を参照してください。 AWS

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDescribeMetadataModel」を参照してください。

次の例は、describe-migration-projects を使用する方法を説明しています。

AWS CLI

移行プロジェクトを記述するには

次の のdescribe-migration-projects例では、ARN によって識別される移行プロジェクトの詳細を取得します。

aws dms describe-migration-projects \ --filters Name=migration-project-identifier,Values=arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "MigrationProjects": [ { "MigrationProjectName": "example-migration-project", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "MigrationProjectCreationTime": "2026-01-09T12:30:00.000000+00:00", "SourceDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-source-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "TargetDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-target-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "InstanceProfileName": "example-instance-profile", "TransformationRules": "{\"rules\":[{\"rule-type\":\"transformation\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"rule-target\":\"schema\",\"rule-action\":\"rename\",\"object-locator\":{\"schema-name\":\"ExampleSchema\"},\"value\":\"TargetSchema\"}]}", "Description": "Example migration project for documentation", "SchemaConversionApplicationAttributes": { "S3BucketPath": "s3://amzn-s3-demo-bucket", "S3BucketRoleArn": "arn:aws:iam::123456789012:role/example-s3-access-role" } } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「移行プロジェクトの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のDescribeMigrationProjects」を参照してください。

次の例は、describe-orderable-replication-instances を使用する方法を説明しています。

AWS CLI

指示設定が可能なレプリケーションインスタンスを記述するには

次の describe-orderable-replication-instances の例では、指示設定が可能なレプリケーションインスタンスタイプを一覧表示しています。

aws dms describe-orderable-replication-instances

出力:

{ "OrderableReplicationInstances": [ { "EngineVersion": "3.3.2", "ReplicationInstanceClass": "dms.c4.2xlarge", "StorageType": "gp2", "MinAllocatedStorage": 5, "MaxAllocatedStorage": 6144, "DefaultAllocatedStorage": 100, "IncludedAllocatedStorage": 100, "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ] }, { "EngineVersion": "3.3.2", "ReplicationInstanceClass": "dms.c4.4xlarge", "StorageType": "gp2", "MinAllocatedStorage": 5, "MaxAllocatedStorage": 6144, "DefaultAllocatedStorage": 100, "IncludedAllocatedStorage": 100, "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ] }, ...remaining output omitted... }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS レプリケーションインスタンスの使用」を参照してください。

次のコード例は、describe-refresh-schemas-status を使用する方法を示しています。

AWS CLI

エンドポイントの更新ステータスを一覧表示するには

次の describe-refresh-schemas-status の例では、以前の更新リクエストのステータスを返しています。

aws dms describe-refresh-schemas-status \ --endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA

出力:

{ "RefreshSchemasStatus": { "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "Status": "successful", "LastRefreshDate": 1590786544.605 } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeRefreshSchemasStatus」を参照してください。

次のコード例は、describe-replication-instances を使用する方法を示しています。

AWS CLI

レプリケーションインスタンスを記述するには

次の のdescribe-replication-instances例では、 AWS アカウントのレプリケーションインスタンスを一覧表示します。

aws dms describe-replication-instances

出力:

{ "ReplicationInstances": [ { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "available", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-f839b688", "Status": "active" } ], "AvailabilityZone": "us-east-1e", "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "default", "ReplicationSubnetGroupDescription": "default", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-42599426", "SubnetAvailabilityZone": { "Name": "us-east-1d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-6746046b", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbfff283", "SubnetAvailabilityZone": { "Name": "us-east-1b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "wed:11:42-wed:12:12", "PendingModifiedValues": { "MultiAZ": true }, "MultiAZ": false, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "ReplicationInstancePublicIpAddress": "3.230.18.248", "ReplicationInstancePrivateIpAddress": "172.31.75.90", "ReplicationInstancePublicIpAddresses": [ "3.230.18.248" ], "ReplicationInstancePrivateIpAddresses": [ "172.31.75.90" ], "PubliclyAccessible": true, "FreeUntil": 1590194829.267 } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS レプリケーションインスタンスの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeReplicationInstances」を参照してください。

次のコード例は、describe-replication-subnet-groups を使用する方法を示しています。

AWS CLI

使用可能なサブネットグループを表示するには

次の describe-replication-subnet-groups の例では、使用可能なサブネットグループを一覧表示しています。

aws dms describe-replication-subnet-groups \ --filter "Name=replication-subnet-group-id,Values=my-subnet-group"

出力:

{ "ReplicationSubnetGroups": [ { "ReplicationSubnetGroupIdentifier": "my-subnet-group", "ReplicationSubnetGroupDescription": "my subnet group", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-d7c825e8", "SubnetAvailabilityZone": { "Name": "us-east-1e" }, "SubnetStatus": "Active" } ] } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Setting Up a Network for a Replication Instance」を参照してください。

次のコード例は、describe-replication-task-assessment-results を使用する方法を示しています。

AWS CLI

レプリケーションタスク評価の結果を一覧表示するには

次の describe-replication-task-assessment-results の例では、以前のタスク評価の結果を一覧表示しています。

aws dms describe-replication-task-assessment-results

出力:

{ "ReplicationTaskAssessmentResults": [ { "ReplicationTaskIdentifier": "moveit2", "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII", "ReplicationTaskLastAssessmentDate": 1590790230.0, "AssessmentStatus": "No issues found", "AssessmentResultsFile": "moveit2/2020-05-29-22-10" } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Creating a Task Assessment Report」を参照してください。

次のコード例は、describe-replication-tasks を使用する方法を示しています。

AWS CLI

レプリケーションタスクを記述するには

次の describe-replication-tasks の例では、現在のレプリケーションタスクについて表示しています。

aws dms describe-replication-tasks

出力:

{ "ReplicationTasks": [ { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted... , "ReplicationTaskSettings": ...output omitted... , "Status": "stopped", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590619805.212, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII", "ReplicationTaskStats": { "FullLoadProgressPercent": 100, "ElapsedTimeMillis": 0, "TablesLoaded": 0, "TablesLoading": 0, "TablesQueued": 0, "TablesErrored": 0, "FreshStartDate": 1590619811.528, "StartDate": 1590619811.528, "StopDate": 1590619842.068 } } ] }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS タスクの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeReplicationTasks」を参照してください。

次の例は、describe-schemas を使用する方法を説明しています。

AWS CLI

データベーススキーマについて表示するには

次の describe-schemas の例では、エンドポイントで使用可能なテーブルを一覧表示しています。

aws dms describe-schemas \ --endpoint-arn "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA"

出力:

{ "Schemas": [ "prodrep" ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「This is the topic title」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeSchemas」を参照してください。

次の例は、export-metadata-model-assessment を使用する方法を説明しています。

AWS CLI

変換評価レポートをエクスポートするには

次の のexport-metadata-model-assessment例では、ExampleSchemaスキーマ内のすべてのオブジェクトの変換評価レポートをエクスポートします。

aws dms export-metadata-model-assessment \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"}, "rule-action": "explicit"}]}' \ --file-name example-assessment-report \ --assessment-report-types pdf csv

出力:

{ "PdfReport": { "S3ObjectKey": "example-migration-project/example-assessment-report.pdf", "ObjectURL": "https://amzn-s3-demo-bucket.s3.amazonaws.com/example-migration-project/example-assessment-report.pdf" }, "CsvReport": { "S3ObjectKey": "example-migration-project/example-assessment-report.zip", "ObjectURL": "https://amzn-s3-demo-bucket.s3.amazonaws.com/example-migration-project/example-assessment-report.zip" } }

詳細については、「 Database Migration Service ユーザーガイド」の「データベース移行評価レポートの作成」を参照してください。 AWS

次の例は、get-target-selection-rules を使用する方法を説明しています。

AWS CLI

ソース選択ルールをターゲット選択ルールに変換するには

次のget-target-selection-rules例では、ExampleSchemaスキーマ内のExampleTableテーブルを選択するソース選択ルールを、変換された対応するものを参照するターゲット選択ルールに変換します。

aws dms get-target-selection-rules \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "database-name": "ExampleDatabase", "schema-name": "ExampleSchema", "table-name": "ExampleTable"}, "rule-action": "explicit"}]}'

出力:

{ "TargetSelectionRules": "{\"rules\": [{\"rule-type\": \"selection\", \"rule-id\": \"1\", \"rule-name\": \"1\", \"object-locator\": {\"server-name\": \"example-target-server.us-east-1.rds.amazonaws.com\", \"schema-name\": \"exampledatabase_exampleschema\", \"table-name\": \"exampletable\"}, \"rule-action\": \"explicit\"}]}" }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「選択ルールの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のGetTargetSelectionRules」を参照してください。

次の例は、list-tags-for-resource を使用する方法を説明しています。

AWS CLI

リソースのタグを一覧表示するには

次の list-tags-for-resource の例では、レプリケーションインスタンスのタグを一覧表示しています。

aws dms list-tags-for-resource \ --resource-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE

出力:

{ "TagList": [ { "Key": "Project", "Value": "dbMigration" }, { "Key": "Environment", "Value": "PROD" } ] }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Tagging Resources」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「ListTagsForResource」を参照してください。

次の例は、modify-conversion-configuration を使用する方法を説明しています。

AWS CLI

変換設定を変更するには

次のmodify-conversion-configuration例では、生成 AI アシスト変換を有効にし、移行プロジェクトの変換パス設定を更新します。

aws dms modify-conversion-configuration \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --conversion-configuration '{"Common project settings":{"EnableGenAiConversion":true},"MSSQL_TO_AURORA_POSTGRESQL":{"ConvertProceduresToFunction":false}}'

出力:

{ "MigrationProjectIdentifier": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS" }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「スキーマ変換設定の指定」を参照してください。

次の例は、modify-data-provider を使用する方法を説明しています。

AWS CLI

データプロバイダーを変更するには

次の のmodify-data-provider例では、データプロバイダーの説明とサーバー名を更新します。

aws dms modify-data-provider \ --data-provider-identifier arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS \ --description "Updated data provider description" \ --engine sqlserver \ --settings MicrosoftSqlServerSettings={ServerName=new-source-server.us-east-1.rds.amazonaws.com}

出力:

{ "DataProvider": { "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS", "DataProviderCreationTime": "2026-01-09T12:30:00.000000+00:00", "Description": "Updated data provider description", "Engine": "sqlserver", "Settings": { "MicrosoftSqlServerSettings": { "ServerName": "new-source-server.us-east-1.rds.amazonaws.com", "Port": 1433, "DatabaseName": "ExampleDatabase", "SslMode": "verify-full", "CertificateArn": "arn:aws:dms:us-east-1:123456789012:cert:EXAMPLEABCDEFGHIJKLMNOPQRS" } } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「データプロバイダーの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のModifyDataProvider」を参照してください。

次の例は、modify-endpoint を使用する方法を説明しています。

AWS CLI

エンドポイントを変更するには

次の modify-endpoint の例では、エンドポイントに追加の接続属性を設定しています。

aws dms modify-endpoint \ --endpoint-arn "arn:aws:dms:us-east-1:123456789012:endpoint:GUVAFG34EECUOJ6QVZ56DAHT3U" \ --extra-connection-attributes "compressionType=GZIP"

出力:

{ "Endpoint": { "EndpointIdentifier": "src-endpoint", "EndpointType": "SOURCE", "EngineName": "s3", "EngineDisplayName": "Amazon S3", "ExtraConnectionAttributes": "compressionType=GZIP;csvDelimiter=,;csvRowDelimiter=\\n;", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:GUVAFG34EECUOJ6QVZ56DAHT3U", "SslMode": "none", "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "S3Settings": { "ServiceAccessRoleArn": "arn:aws:iam::123456789012:role/my-s3-access-role", "CsvRowDelimiter": "\\n", "CsvDelimiter": ",", "BucketFolder": "", "BucketName": "", "CompressionType": "GZIP", "EnableStatistics": true } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「Working with AWS DMS Endpoints <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Endpoints.html>`__」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyEndpoint」を参照してください。

次のコード例は、modify-event-subscription を使用する方法を示しています。

AWS CLI

イベントサブスクリプションを変更するには

次の modify-event-subscription の例では、イベントサブスクリプションのソースタイプを変更しています。

aws dms modify-event-subscription \ --subscription-name "my-dms-events" \ --source-type replication-task

出力:

{ "EventSubscription": { "CustomerAwsId": "123456789012", "CustSubscriptionId": "my-dms-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:my-sns-topic", "Status": "modifying", "SubscriptionCreationTime": "2020-05-29 17:04:40.262", "SourceType": "replication-task", "Enabled": true } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Working with Events and Notifications」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyEventSubscription」を参照してください。

次の例は、modify-instance-profile を使用する方法を説明しています。

AWS CLI

インスタンスプロファイルを変更するには

次の のmodify-instance-profile例では、インスタンスプロファイルの説明とネットワークタイプを更新します。

aws dms modify-instance-profile \ --instance-profile-identifier arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS \ --description "Updated instance profile description" \ --network-type DUAL

出力:

{ "InstanceProfile": { "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "PubliclyAccessible": false, "NetworkType": "DUAL", "InstanceProfileName": "example-instance-profile", "Description": "Updated instance profile description", "InstanceProfileCreationTime": "2026-01-09T12:30:00.000000+00:00", "SubnetGroupIdentifier": "example-replication-subnet-group", "VpcSecurityGroups": [ "sg-0123456789abcdef0" ] } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「インスタンスプロファイルの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のModifyInstanceProfile」を参照してください。

次の例は、modify-migration-project を使用する方法を説明しています。

AWS CLI

移行プロジェクトを変更するには

次の のmodify-migration-project例では、ソースデータプロバイダーと移行プロジェクトの説明を更新します。

aws dms modify-migration-project \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --description "Updated migration project description" \ --source-data-provider-descriptors DataProviderIdentifier=arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "MigrationProject": { "MigrationProjectName": "example-migration-project", "MigrationProjectArn": "arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS", "MigrationProjectCreationTime": "2026-01-09T12:30:00.000000+00:00", "SourceDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-source-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "TargetDataProviderDescriptors": [ { "SecretsManagerSecretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-target-secret-A1B2C3", "SecretsManagerAccessRoleArn": "arn:aws:iam::123456789012:role/example-secrets-manager-role", "DataProviderName": "example-data-provider", "DataProviderArn": "arn:aws:dms:us-east-1:123456789012:data-provider:EXAMPLEABCDEFGHIJKLMNOPQRS" } ], "InstanceProfileArn": "arn:aws:dms:us-east-1:123456789012:instance-profile:EXAMPLEABCDEFGHIJKLMNOPQRS", "InstanceProfileName": "example-instance-profile", "TransformationRules": "{\"rules\":[{\"rule-type\":\"transformation\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"rule-target\":\"schema\",\"rule-action\":\"rename\",\"object-locator\":{\"schema-name\":\"ExampleSchema\"},\"value\":\"TargetSchema\"}]}", "Description": "Updated migration project description", "SchemaConversionApplicationAttributes": { "S3BucketPath": "s3://amzn-s3-demo-bucket", "S3BucketRoleArn": "arn:aws:iam::123456789012:role/example-s3-access-role" } } }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「移行プロジェクトの使用」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のModifyMigrationProject」を参照してください。

次の例は、modify-replication-instance を使用する方法を説明しています。

AWS CLI

レプリケーションインスタンスを変更するには

次の modify-replication-instance の例では、マルチ AZ 配置を使用するようにレプリケーションインスタンスを変更しています。

aws dms modify-replication-instance \ --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE \ --multi-az

出力:

{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "available", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, ...output omitted... "PendingModifiedValues": { "MultiAZ": true }, "MultiAZ": false, "EngineVersion": "3.3.2", "AutoMinorVersionUpgrade": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/f7bc0f8e-1a3a-4ace-9faa-e8494fa3921a", ...output omitted... } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS レプリケーションインスタンスの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyReplicationInstance」を参照してください。

次のコード例は、modify-replication-subnet-group を使用する方法を示しています。

AWS CLI

サブネットグループを変更するには

次の modify-replication-subnet-group の例では、サブネットグループに関連付けられているサブネットのリストを変更しています。

aws dms modify-replication-subnet-group \ --replication-subnet-group-identifier my-subnet-group \ --subnet-id subnet-da327bf6 subnet-bac383e0

出力:

{ "ReplicationSubnetGroup": { "ReplicationSubnetGroupIdentifier": "my-subnet-group", "ReplicationSubnetGroupDescription": "my subnet group", "VpcId": "vpc-136a4c6a", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-da327bf6", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-bac383e0", "SubnetAvailabilityZone": { "Name": "us-east-1c" }, "SubnetStatus": "Active" } ] } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Setting Up a Network for a Replication Instance」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyReplicationSubnetGroup」を参照してください。

次のコード例は、modify-replication-task を使用する方法を示しています。

AWS CLI

レプリケーションタスクを変更するには

次の modify-replication-task の例では、タスクのテーブルマッピングを変更します。

aws dms modify-replication-task \ --replication-task-arn "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" \ --table-mappings file://table-mappings.json

table-mappings.json の内容:

{ "rules": [ { "rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": { "schema-name": "prodrep", "table-name": "ACCT_%" }, "rule-action": "include", "filters": [] } ] }

出力:

{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "modifying", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789424.653, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS タスクの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyReplicationTask」を参照してください。

次のコード例は、reboot-replication-instance を使用する方法を示しています。

AWS CLI

レプリケーションインスタンスを再起動するには

次の reboot-replication-instance の例では、レプリケーション インスタンスを再起動します。

aws dms reboot-replication-instance \ --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE

出力:

{ "ReplicationInstance": { "ReplicationInstanceIdentifier": "my-repl-instance", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationInstanceStatus": "rebooting", "AllocatedStorage": 5, "InstanceCreateTime": 1590011235.952, ... output omitted ... } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS レプリケーションインスタンスの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「RebootReplicationInstance」を参照してください。

次のコード例は、refresh-schemas を使用する方法を示しています。

AWS CLI

データベーススキーマを更新するには

次のrefresh-schemas例では、DMS AWS がエンドポイントのスキーマのリストを更新するようにリクエストします。

aws dms refresh-schemas \ --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE \ --endpoint-arn "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA"

出力:

{ "RefreshSchemasStatus": { "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "Status": "refreshing", "LastRefreshDate": 1590019949.103 } }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「RefreshSchemas」を参照してください。

次のコード例は、reload-tables を使用する方法を示しています。

AWS CLI

エンドポイントで使用可能なテーブルのリストを更新するには

次の reload-tables の例では、エンドポイントで使用可能なテーブルのリストを再ロードしています。

aws dms reload-tables \ --replication-task-arn "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" \ --tables-to-reload "SchemaName=prodrep,TableName=ACCT_BAL"

出力:

{ "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" }
  • API の詳細については、「AWS CLI コマンドリファレンス」の「ReloadTables」を参照してください。

次のコード例は、remove-tags-from-resource を使用する方法を示しています。

AWS CLI

レプリケーションインスタンスからタグを削除するには

次の remove-tags-from-resource の例では、レプリケーションインスタンスからタグを削除しています。

aws dms remove-tags-from-resource \ --resource-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE \ --tag-keys Environment Project

このコマンドでは何も出力されません。

詳細については、「AWS Database Migration Service ユーザーガイド」の「Tagging Resources」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveTagsFromResource」を参照してください。

次の例は、start-extension-pack-association を使用する方法を説明しています。

AWS CLI

拡張パックをターゲットデータベースに適用するには

次の のstart-extension-pack-association例では、拡張パックのアプリケーションをターゲットデータベースにキューに入れます。

aws dms start-extension-pack-association \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「拡張パックの使用」を参照してください。

次の例は、start-metadata-model-assessment を使用する方法を説明しています。

AWS CLI

スキーマ内のすべてのオブジェクトを評価するには

次のstart-metadata-model-assessment例では、ExampleSchemaスキーマ内のすべてのオブジェクトの変換の複雑さの評価をキューに入れます。

aws dms start-metadata-model-assessment \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}'

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、「 Database Migration AWS Service ユーザーガイド」の「データベース移行評価レポートの作成」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のStartMetadataModelAssessment」を参照してください。

次の例は、start-metadata-model-conversion を使用する方法を説明しています。

AWS CLI

スキーマ内のすべてのオブジェクトを変換するには

次のstart-metadata-model-conversion例では、ExampleSchemaスキーマ内のすべてのオブジェクトをターゲットデータベース形式に変換します。

aws dms start-metadata-model-conversion \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}'

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、「 Database AWS Migration Service ユーザーガイド」の「データベーススキーマの変換」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のStartMetadataModelConversion」を参照してください。

次の例は、start-metadata-model-creation を使用する方法を説明しています。

AWS CLI

SQL ステートメントのメタデータモデルを作成するには

次の のstart-metadata-model-creation例では、SQL ステートメントのメタデータモデルの作成をキューに入れます。選択ルールは、メタデータモデルが配置されるスキーマを指定し、後続のオペレーションで使用する一意の識別子--metadata-model-nameを提供します。

aws dms start-metadata-model-creation \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection", "rule-id": "1", "rule-name": "1", "object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "database-name": "ExampleDatabase", "schema-name": "ExampleSchema"}, "rule-action": "explicit"}]}' \ --metadata-model-name ExampleStatement \ --properties StatementProperties={Definition="SELECT * FROM ExampleTable;"}

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「ステートメントメタデータモデルの作成」を参照してください。

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のStartMetadataModelCreation」を参照してください。

次の例は、start-metadata-model-export-as-script を使用する方法を説明しています。

AWS CLI

変換されたメタデータモデルを DDL スクリプトとしてエクスポートするには

次の のstart-metadata-model-export-as-script例では、ExampleSchemaスキーマ内のすべてのオブジェクトの変換されたメタデータモデルをデータ定義言語 (DDL) スクリプトとして、移行プロジェクトに関連付けられた Amazon S3 バケットにエクスポートします。

aws dms start-metadata-model-export-as-script \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-target-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}' \ --origin TARGET \ --file-name ExampleScript

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、AWS 「 Database Migration Service ユーザーガイド」の「変換したコードを SQL ファイルに保存」を参照してください。

次の例は、start-metadata-model-export-to-target を使用する方法を説明しています。

AWS CLI

変換されたメタデータモデルをターゲットデータベースにエクスポートするには

次の のstart-metadata-model-export-to-target例では、ExampleSchemaスキーマ内のすべてのオブジェクトの変換されたメタデータモデルのターゲットデータベースへのエクスポートをキューに入れます。

aws dms start-metadata-model-export-to-target \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-target-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}' \ --overwrite-extension-pack

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、「 Database Migration Service ユーザーガイド」の「変換されたコードの適用」を参照してください。 AWS

次の例は、start-metadata-model-import を使用する方法を説明しています。

AWS CLI

ソースデータベースからメタデータをインポートするには

次の のstart-metadata-model-import例では、ソースデータベースからExampleSchemaスキーマ内のすべてのオブジェクトのメタデータインポートをキューに入れます。

aws dms start-metadata-model-import \ --migration-project-identifier arn:aws:dms:us-east-1:123456789012:migration-project:EXAMPLEABCDEFGHIJKLMNOPQRS \ --selection-rules '{"rules": [{"rule-type": "selection","rule-id": "1","rule-name": "1","object-locator": {"server-name": "example-source-server.us-east-1.rds.amazonaws.com", "schema-name": "ExampleSchema"},"rule-action": "explicit"}]}' \ --origin SOURCE \ --no-refresh

出力:

{ "RequestIdentifier": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }

詳細については、「 Database Migration Service ユーザーガイド」の「メタデータモデルツリーのナビゲート」を参照してください。 AWS

  • API の詳細については、AWS CLI 「 コマンドリファレンス」のStartMetadataModelImport」を参照してください。

次の例は、start-replication-task-assessment を使用する方法を説明しています。

AWS CLI

タスク評価を開始するには

次の start-replication-task-assessment の例では、レプリケーションタスクの評価を開始しています。

aws dms start-replication-task-assessment \ --replication-task-arn arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII

出力:

{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "testing", "StopReason": "Stop Reason FULL_LOAD_ONLY_FINISHED", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789988.677, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Creating a Task Assessment Report」を参照してください。

次のコード例は、start-replication-task を使用する方法を示しています。

AWS CLI

レプリケーションタスクを開始するには

次の のcommand-name例では、 AWS アカウントで使用可能なウィジェットを一覧表示します。

aws dms start-replication-task \ --replication-task-arn arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII \ --start-replication-task-type reload-target

出力:

{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted... , "ReplicationTaskSettings": ...output omitted... , "Status": "starting", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590619805.212, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS タスクの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「StartReplicationTask」を参照してください。

次のコード例は、stop-replication-task を使用する方法を示しています。

AWS CLI

タスクを停止するには

次の stop-replication-task の例ではタスクを停止しています。

aws dms stop-replication-task \ --replication-task-arn arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII

出力:

{ "ReplicationTask": { "ReplicationTaskIdentifier": "moveit2", "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:EOM4SFKCZEYHZBFGAGZT3QEC5U", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "MigrationType": "full-load", "TableMappings": ...output omitted..., "ReplicationTaskSettings": ...output omitted..., "Status": "stopping", "ReplicationTaskCreationDate": 1590524772.505, "ReplicationTaskStartDate": 1590789424.653, "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:K55IUCGBASJS5VHZJIINA45FII" } }

詳細については、AWS 「 Database Migration Service ユーザーガイドAWS 」の「DMS タスクの使用」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「StopReplicationTask」を参照してください。

次のコード例は、test-connection を使用する方法を示しています。

AWS CLI

エンドポイントへの接続をテストするには

次の test-connection の例では、レプリケーションインスタンスからエンドポイントにアクセスできるかどうかをテストしています。

aws dms test-connection \ --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE \ --endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA

出力:

{ "Connection": { "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:T3OM7OUB5NM2LCVZF7JPGJRNUE", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:6GGI6YPWWGAYUVLKIB732KEVWA", "Status": "testing", "EndpointIdentifier": "src-database-1", "ReplicationInstanceIdentifier": "my-repl-instance" } }

詳細については、「AWS Database Migration Service ユーザーガイド」の「Creating source and target endpoints」を参照してください。

  • API の詳細については、「AWS CLI コマンドリファレンス」の「TestConnection」を参照してください。