Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
を使用した Amazon RDS の例 AWS CLI
次のコード例は、Amazon RDS AWS Command Line Interface で を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。
アクションはより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。
各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。
トピック
アクション
次の例は、add-option-to-option-group を使用する方法を説明しています。
- AWS CLI
-
オプショングループにオプションを追加するには
次の
add-option-to-option-groupの例では、オプションを指定したオプショングループに追加します。aws rds add-option-to-option-group \ --option-group-namemyoptiongroup\ --optionsOptionName=OEM,Port=5500,DBSecurityGroupMemberships=default\ --apply-immediately出力:
{ "OptionGroup": { "OptionGroupName": "myoptiongroup", "OptionGroupDescription": "Test Option Group", "EngineName": "oracle-ee", "MajorEngineVersion": "12.1", "Options": [ { "OptionName": "Timezone", "OptionDescription": "Change time zone", "Persistent": true, "Permanent": false, "OptionSettings": [ { "Name": "TIME_ZONE", "Value": "Australia/Sydney", "DefaultValue": "UTC", "Description": "Specifies the timezone the user wants to change the system time to", "ApplyType": "DYNAMIC", "DataType": "STRING", "AllowedValues": "Africa/Cairo,Africa/Casablanca,Africa/Harare,Africa/Lagos,Africa/Luanda,Africa/Monrovia,Africa/Nairobi,Africa/Tripoli,Africa/Windhoek,America/Araguaina,America/Argentina/Buenos_Aires,America/Asuncion,America/Bogota,America/Caracas,America/Chicago,America/Chihuahua,America/Cuiaba,America/Denver,America/Detroit,America/Fortaleza,America/Godthab,America/Guatemala,America/Halifax,America/Lima,America/Los_Angeles,America/Manaus,America/Matamoros,America/Mexico_City,America/Monterrey,America/Montevideo,America/New_York,America/Phoenix,America/Santiago,America/Sao_Paulo,America/Tijuana,America/Toronto,Asia/Amman,Asia/Ashgabat,Asia/Baghdad,Asia/Baku,Asia/Bangkok,Asia/Beirut,Asia/Calcutta,Asia/Damascus,Asia/Dhaka,Asia/Hong_Kong,Asia/Irkutsk,Asia/Jakarta,Asia/Jerusalem,Asia/Kabul,Asia/Karachi,Asia/Kathmandu,Asia/Kolkata,Asia/Krasnoyarsk,Asia/Magadan,Asia/Manila,Asia/Muscat,Asia/Novosibirsk,Asia/Rangoon,Asia/Riyadh,Asia/Seoul,Asia/Shanghai,Asia/Singapore,Asia/Taipei,Asia/Tehran,Asia/Tokyo,Asia/Ulaanbaatar,Asia/Vladivostok,Asia/Yakutsk,Asia/Yerevan,Atlantic/Azores,Atlantic/Cape_Verde,Australia/Adelaide,Australia/Brisbane,Australia/Darwin,Australia/Eucla,Australia/Hobart,Australia/Lord_Howe,Australia/Perth,Australia/Sydney,Brazil/DeNoronha,Brazil/East,Canada/Newfoundland,Canada/Saskatchewan,Etc/GMT-3,Europe/Amsterdam,Europe/Athens,Europe/Berlin,Europe/Dublin,Europe/Helsinki,Europe/Kaliningrad,Europe/London,Europe/Madrid,Europe/Moscow,Europe/Paris,Europe/Prague,Europe/Rome,Europe/Sarajevo,Pacific/Apia,Pacific/Auckland,Pacific/Chatham,Pacific/Fiji,Pacific/Guam,Pacific/Honolulu,Pacific/Kiritimati,Pacific/Marquesas,Pacific/Samoa,Pacific/Tongatapu,Pacific/Wake,US/Alaska,US/Central,US/East-Indiana,US/Eastern,US/Pacific,UTC", "IsModifiable": true, "IsCollection": false } ], "DBSecurityGroupMemberships": [], "VpcSecurityGroupMemberships": [] }, { "OptionName": "OEM", "OptionDescription": "Oracle 12c EM Express", "Persistent": false, "Permanent": false, "Port": 5500, "OptionSettings": [], "DBSecurityGroupMemberships": [ { "DBSecurityGroupName": "default", "Status": "authorized" } ], "VpcSecurityGroupMemberships": [] } ], "AllowsVpcAndNonVpcInstanceMemberships": false, "OptionGroupArn": "arn:aws:rds:us-east-1:123456789012:og:myoptiongroup" } }詳細については、「Amazon RDS ユーザーガイド」の「オプショングループにオプションを追加する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AddOptionToOptionGroup
」を参照してください。
-
次の例は、add-role-to-db-cluster を使用する方法を説明しています。
- AWS CLI
-
AWS Identity and Access Management (IAM) ロールを DB クラスターに関連付けるには
次の
add-role-to-db-clusterの例では、DB クラスターにロールを関連付けます。aws rds add-role-to-db-cluster \ --db-cluster-identifiermydbcluster\ --role-arnarn:aws:iam::123456789012:role/RDSLoadFromS3このコマンドでは何も出力されません。
詳細については、「Amazon Aurora ユーザーガイド」の「IAM ロールと Amazon Aurora MySQL DB クラスターの関連付け」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AddRoleToDbCluster
」を参照してください。
-
次の例は、add-role-to-db-instance を使用する方法を説明しています。
- AWS CLI
-
AWS Identity and Access Management (IAM) ロールを DB インスタンスに関連付けるには
次の
add-role-to-db-instanceの例では、test-instanceという名前の Oracle DB インスタンスにこのロールを追加します。aws rds add-role-to-db-instance \ --db-instance-identifiertest-instance\ --feature-nameS3_INTEGRATION\ --role-arnarn:aws:iam::111122223333:role/rds-s3-integration-roleこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS Oracle と Amazon S3 を統合する前提条件」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AddRoleToDbInstance
」を参照してください。
-
次の例は、add-source-identifier-to-subscription を使用する方法を説明しています。
- AWS CLI
-
ソース識別子をサブスクリプションに追加するには
次の
add-source-identifierの例では、別のソース識別子を既存のサブスクリプションに追加します。aws rds add-source-identifier-to-subscription \ --subscription-namemy-instance-events\ --source-identifiertest-instance-repl出力:
{ "EventSubscription": { "SubscriptionCreationTime": "Tue Jul 31 23:22:01 UTC 2018", "CustSubscriptionId": "my-instance-events", "EventSubscriptionArn": "arn:aws:rds:us-east-1:123456789012:es:my-instance-events", "Enabled": false, "Status": "modifying", "EventCategoriesList": [ "backup", "recovery" ], "CustomerAwsId": "123456789012", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:interesting-events", "SourceType": "db-instance", "SourceIdsList": [ "test-instance", "test-instance-repl" ] } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「AddSourceIdentifierToSubscription
」を参照してください。
-
次の例は、add-tags-to-resource を使用する方法を説明しています。
- AWS CLI
-
リソースにタグを追加するには
次の
add-tags-to-resourceの例では、RDS データベースにタグを追加します。aws rds add-tags-to-resource \ --resource-namearn:aws:rds:us-east-1:123456789012:db:database-mysql\ --tags "[{\"Key\": \"Name\",\"Value\": \"MyDatabase\"},{\"Key\": \"Environment\",\"Value\": \"test\"}]"このコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS リソースのタグ付け」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AddTagsToResource
」を参照してください。
-
次の例は、apply-pending-maintenance-action を使用する方法を説明しています。
- AWS CLI
-
保留中のメンテナンスアクションを適用するには
次の
apply-pending-maintenance-actionの例では、DB クラスターの保留中のメンテナンスアクションを適用します。aws rds apply-pending-maintenance-action \ --resource-identifierarn:aws:rds:us-east-1:123456789012:cluster:my-db-cluster\ --apply-actionsystem-update\ --opt-in-typeimmediate出力:
{ "ResourcePendingMaintenanceActions": { "ResourceIdentifier": "arn:aws:rds:us-east-1:123456789012:cluster:my-db-cluster", "PendingMaintenanceActionDetails": [ { "Action": "system-update", "OptInStatus": "immediate", "CurrentApplyDate": "2021-01-23T01:07:36.100Z", "Description": "Upgrade to Aurora PostgreSQL 3.3.2" } ] } }詳細については、「Amazon RDS ユーザーガイド」の「DB インスタンスのメンテナンス」および「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB インスタンスのメンテナンス」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ApplyPendingMaintenanceAction
」を参照してください。
-
次の例は、authorize-db-security-group-ingress を使用する方法を説明しています。
- AWS CLI
-
AWS Identity and Access Management (IAM) ロールを DB インスタンスに関連付けるには
次の
authorize-db-security-group-ingressの例では、CIDR IP 範囲 192.0.2.0/24 の進入ルールを使用してデフォルトのセキュリティグループを設定します。aws rds authorize-db-security-group-ingress \ --db-security-group-namedefault\ --cidrip192.0.2.0/24出力:
{ "DBSecurityGroup": { "OwnerId": "123456789012", "DBSecurityGroupName": "default", "DBSecurityGroupDescription": "default", "EC2SecurityGroups": [], "IPRanges": [ { "Status": "authorizing", "CIDRIP": "192.0.2.0/24" } ], "DBSecurityGroupArn": "arn:aws:rds:us-east-1:111122223333:secgrp:default" } }詳細については、「Amazon RDS ユーザーガイド」の「IP 範囲からのネットワークアクセスを DB セキュリティグループに許可する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「AuthorizeDbSecurityGroupIngress
」を参照してください。
-
次の例は、backtrack-db-cluster を使用する方法を説明しています。
- AWS CLI
-
Aurora DB クラスターをバックトラックするには
次の
backtrack-db-clusterの例では、指定された DB クラスター sample-cluster を 2018 年 3 月 19 日午前 10 時までバックトラックします。aws rds backtrack-db-cluster --db-cluster-identifiersample-cluster--backtrack-to2018-03-19T10:00:00+00:00このコマンドは、RDS リソースの変更を承認する JSON ブロックを出力します。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「BacktrackDbCluster
」を参照してください。
-
次の例は、cancel-export-task を使用する方法を説明しています。
- AWS CLI
-
Amazon S3 に対するスナップショットのエクスポートをキャンセルするには
次の
cancel-export-taskの例では、スナップショットを Amazon S3 にエクスポートする進行中のエクスポートタスクをキャンセルします。aws rds cancel-export-task \ --export-task-identifiermy-s3-export-1出力:
{ "ExportTaskIdentifier": "my-s3-export-1", "SourceArn": "arn:aws:rds:us-east-1:123456789012:snapshot:publisher-final-snapshot", "SnapshotTime": "2019-03-24T20:01:09.815Z", "S3Bucket": "amzn-s3-demo-bucket", "S3Prefix": "", "IamRoleArn": "arn:aws:iam::123456789012:role/service-role/export-snap-S3-role", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcd0000-7bfd-4594-af38-aabbccddeeff", "Status": "CANCELING", "PercentProgress": 0, "TotalExtractedDataInGB": 0 }詳細については、「Amazon RDS ユーザーガイド」の「スナップショットエクスポートタスクのキャンセル」または「Amazon Aurora ユーザーガイド」の「スナップショットエクスポートタスクのキャンセル」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CancelExportTask
」を参照してください。
-
次の例は、copy-db-cluster-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB クラスターパラメータグループをコピーするには
次の
copy-db-cluster-parameter-groupの例では、DB クラスターパラメータグループのコピーを作成します。aws rds copy-db-cluster-parameter-group \ --source-db-cluster-parameter-group-identifiermydbclusterpg\ --target-db-cluster-parameter-group-identifiermydbclusterpgcopy\ --target-db-cluster-parameter-group-description"Copy of mydbclusterpg parameter group"出力:
{ "DBClusterParameterGroup": { "DBClusterParameterGroupName": "mydbclusterpgcopy", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:mydbclusterpgcopy", "DBParameterGroupFamily": "aurora-mysql5.7", "Description": "Copy of mydbclusterpg parameter group" } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスターパラメータグループのコピー」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CopyDbClusterParameterGroup
」を参照してください。
-
次の例は、copy-db-cluster-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB クラスタースナップショットをコピーするには
次の
copy-db-cluster-snapshotの例では、タグを含む DB クラスタースナップショットのコピーを作成します。aws rds copy-db-cluster-snapshot \ --source-db-cluster-snapshot-identifierarn:aws:rds:us-east-1:123456789012:cluster-snapshot:rds:myaurora-2019-06-04-09-16--target-db-cluster-snapshot-identifiermyclustersnapshotcopy\ --copy-tags出力:
{ "DBClusterSnapshot": { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "DBClusterSnapshotIdentifier": "myclustersnapshotcopy", "DBClusterIdentifier": "myaurora", "SnapshotCreateTime": "2019-06-04T09:16:42.649Z", "Engine": "aurora-mysql", "AllocatedStorage": 0, "Status": "available", "Port": 0, "VpcId": "vpc-6594f31c", "ClusterCreateTime": "2019-04-15T14:18:42.785Z", "MasterUsername": "myadmin", "EngineVersion": "5.7.mysql_aurora.2.04.2", "LicenseModel": "aurora-mysql", "SnapshotType": "manual", "PercentProgress": 100, "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:myclustersnapshotcopy", "IAMDatabaseAuthenticationEnabled": false } }詳細については、「Amazon Aurora ユーザーガイドの「スナップショットのコピー」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CopyDbClusterSnapshot
」を参照してください。
-
次の例は、copy-db-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB クラスターパラメータグループをコピーするには
次の
copy-db-parameter-groupの例では、DB パラメータグループのコピーを作成します。aws rds copy-db-parameter-group \ --source-db-parameter-group-identifiermydbpg\ --target-db-parameter-group-identifiermydbpgcopy\ --target-db-parameter-group-description"Copy of mydbpg parameter group"出力:
{ "DBParameterGroup": { "DBParameterGroupName": "mydbpgcopy", "DBParameterGroupArn": "arn:aws:rds:us-east-1:814387698303:pg:mydbpgcopy", "DBParameterGroupFamily": "mysql5.7", "Description": "Copy of mydbpg parameter group" } }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループをコピーする」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CopyDbParameterGroup
」を参照してください。
-
次の例は、copy-db-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB スナップショットをコピーするには
次の
copy-db-snapshotの例では、DB スナップショットのコピーを作成します。aws rds copy-db-snapshot \ --source-db-snapshot-identifierrds:database-mysql-2019-06-06-08-38--target-db-snapshot-identifiermydbsnapshotcopy出力:
{ "DBSnapshot": { "VpcId": "vpc-6594f31c", "Status": "creating", "Encrypted": true, "SourceDBSnapshotIdentifier": "arn:aws:rds:us-east-1:123456789012:snapshot:rds:database-mysql-2019-06-06-08-38", "MasterUsername": "admin", "Iops": 1000, "Port": 3306, "LicenseModel": "general-public-license", "DBSnapshotArn": "arn:aws:rds:us-east-1:123456789012:snapshot:mydbsnapshotcopy", "EngineVersion": "5.6.40", "OptionGroupName": "default:mysql-5-6", "ProcessorFeatures": [], "Engine": "mysql", "StorageType": "io1", "DbiResourceId": "db-ZI7UJ5BLKMBYFGX7FDENCKADC4", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "SnapshotType": "manual", "IAMDatabaseAuthenticationEnabled": false, "SourceRegion": "us-east-1", "DBInstanceIdentifier": "database-mysql", "InstanceCreateTime": "2019-04-30T15:45:53.663Z", "AvailabilityZone": "us-east-1f", "PercentProgress": 0, "AllocatedStorage": 100, "DBSnapshotIdentifier": "mydbsnapshotcopy" } }詳細については、「Amazon RDS ユーザーガイドの「スナップショットのコピー」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CopyDbSnapshot
」を参照してください。
-
次の例は、copy-option-group を使用する方法を説明しています。
- AWS CLI
-
オプショングループをコピーするには
次の
copy-option-groupの例では、オプショングループのコピーを作成します。aws rds copy-option-group \ --source-option-group-identifiermyoptiongroup\ --target-option-group-identifiernew-option-group\ --target-option-group-description"My option group copy"出力:
{ "OptionGroup": { "Options": [], "OptionGroupName": "new-option-group", "MajorEngineVersion": "11.2", "OptionGroupDescription": "My option group copy", "AllowsVpcAndNonVpcInstanceMemberships": true, "EngineName": "oracle-ee", "OptionGroupArn": "arn:aws:rds:us-east-1:123456789012:og:new-option-group" } }詳細については、「Amazon RDS ユーザーガイド」の「オプショングループのコピーの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CopyOptionGroup
」を参照してください。
-
次の例は、create-blue-green-deployment を使用する方法を説明しています。
- AWS CLI
-
例 1: RDS for MySQL DB インスタンス用にブルー/グリーンデプロイを作成するには
次の
create-blue-green-deploymentの例では、MySQL DB インスタンスのブルー/グリーンデプロイを作成します。aws rds create-blue-green-deployment \ --blue-green-deployment-namebgd-cli-test-instance\ --sourcearn:aws:rds:us-east-1:123456789012:db:my-db-instance\ --target-engine-version8.0\ --target-db-parameter-group-namemysql-80-group出力:
{ "BlueGreenDeployment": { "BlueGreenDeploymentIdentifier": "bgd-v53303651eexfake", "BlueGreenDeploymentName": "bgd-cli-test-instance", "Source": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "PENDING" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "PENDING" }, { "Name": "CONFIGURE_BACKUPS", "Status": "PENDING" }, { "Name": "CREATING_TOPOLOGY_OF_SOURCE", "Status": "PENDING" } ], "Status": "PROVISIONING", "CreateTime": "2022-02-25T21:18:51.183000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「ブルー/グリーンデプロイの作成」を参照してください。
例 2: Aurora MySQL DB クラスター用にブルー/グリーンデプロイを作成するには
次の
create-blue-green-deploymentの例では、Aurora MySQL DB クラスターのブルー/グリーンデプロイを作成します。aws rds create-blue-green-deployment \ --blue-green-deployment-namemy-blue-green-deployment\ --sourcearn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster\ --target-engine-version8.0\ --target-db-cluster-parameter-group-nameams-80-binlog-enabled\ --target-db-parameter-group-namemysql-80-cluster-group出力:
{ "BlueGreenDeployment": { "BlueGreenDeploymentIdentifier": "bgd-wi89nwzglccsfake", "BlueGreenDeploymentName": "my-blue-green-deployment", "Source": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "Status": "PROVISIONING" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1", "Status": "PROVISIONING" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2", "Status": "PROVISIONING" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3", "Status": "PROVISIONING" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint", "Status": "PROVISIONING" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint", "Status": "PROVISIONING" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "PENDING" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "PENDING" }, { "Name": "CREATE_DB_INSTANCES_FOR_CLUSTER", "Status": "PENDING" }, { "Name": "CREATE_CUSTOM_ENDPOINTS", "Status": "PENDING" } ], "Status": "PROVISIONING", "CreateTime": "2022-02-25T21:12:00.288000+00:00" } }詳細については、「Amazon Aurora ユーザーガイド」の「ブルー/グリーンデプロイの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateBlueGreenDeployment
」を参照してください。
-
次の例は、create-db-cluster-endpoint を使用する方法を説明しています。
- AWS CLI
-
カスタム DB クラスターエンドポイントを作成するには
次の
create-db-cluster-endpointの例では、カスタム DB クラスターエンドポイントを作成し、指定された Aurora DB クラスターに関連付けます。aws rds create-db-cluster-endpoint \ --db-cluster-endpoint-identifiermycustomendpoint\ --endpoint-typereader\ --db-cluster-identifiermydbcluster\ --static-membersdbinstance1dbinstance2出力:
{ "DBClusterEndpointIdentifier": "mycustomendpoint", "DBClusterIdentifier": "mydbcluster", "DBClusterEndpointResourceIdentifier": "cluster-endpoint-ANPAJ4AE5446DAEXAMPLE", "Endpoint": "mycustomendpoint.cluster-custom-cnpexample.us-east-1.rds.amazonaws.com", "Status": "creating", "EndpointType": "CUSTOM", "CustomEndpointType": "READER", "StaticMembers": [ "dbinstance1", "dbinstance2" ], "ExcludedMembers": [], "DBClusterEndpointArn": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:mycustomendpoint" }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora 接続管理」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbClusterEndpoint
」を参照してください。
-
次の例は、create-db-cluster-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB クラスターパラメータグループを作成するには
次の
create-db-cluster-parameter-groupの例は、DB クラスターパラメータグループを作成します。aws rds create-db-cluster-parameter-group \ --db-cluster-parameter-group-namemydbclusterparametergroup\ --db-parameter-group-familyaurora5.6\ --description"My new cluster parameter group"出力:
{ "DBClusterParameterGroup": { "DBClusterParameterGroupName": "mydbclusterparametergroup", "DBParameterGroupFamily": "aurora5.6", "Description": "My new cluster parameter group", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:mydbclusterparametergroup" } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスターパラメータグループの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbClusterParameterGroup
」を参照してください。
-
次の例は、create-db-cluster-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB クラスタースナップショットを作成するには
次の
create-db-cluster-snapshotの例は、DB クラスタースナップショットを作成します。aws rds create-db-cluster-snapshot \ --db-cluster-identifiermydbcluster\ --db-cluster-snapshot-identifiermydbclustersnapshot出力:
{ "DBClusterSnapshot": { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "DBClusterSnapshotIdentifier": "mydbclustersnapshot", "DBClusterIdentifier": "mydbcluster", "SnapshotCreateTime": "2019-06-18T21:21:00.469Z", "Engine": "aurora-mysql", "AllocatedStorage": 1, "Status": "creating", "Port": 0, "VpcId": "vpc-6594f31c", "ClusterCreateTime": "2019-04-15T14:18:42.785Z", "MasterUsername": "myadmin", "EngineVersion": "5.7.mysql_aurora.2.04.2", "LicenseModel": "aurora-mysql", "SnapshotType": "manual", "PercentProgress": 0, "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:mydbclustersnapshot", "IAMDatabaseAuthenticationEnabled": false } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスタースナップショットの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbClusterSnapshot
」を参照してください。
-
次の例は、create-db-cluster を使用する方法を説明しています。
- AWS CLI
-
例 1: MySQL 5.7 互換 DB クラスターを作成するには
次の
create-db-clusterの例は、デフォルトのエンジンバージョンを使用して MySQL 5.7 互換 DB クラスターを作成します。サンプルパスワードsecret99を安全なパスワードに置き換えます。コンソールを使用して DB クラスターを作成する場合、Amazon RDS は DB クラスターのライター DB インスタンスを自動作成します。ただし、CLI を使用して DB AWS クラスターを作成する場合は、create-db-instanceAWS CLI コマンドを使用して DB クラスターのライター DB インスタンスを明示的に作成する必要があります。aws rds create-db-cluster \ --db-cluster-identifiersample-cluster\ --engineaurora-mysql\ --engine-version5.7\ --master-usernameadmin\ --master-user-passwordsecret99\ --db-subnet-group-namedefault\ --vpc-security-group-idssg-0b9130572daf3dc16出力:
{ "DBCluster": { "DBSubnetGroup": "default", "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-0b9130572daf3dc16", "Status": "active" } ], "AllocatedStorage": 1, "AssociatedRoles": [], "PreferredBackupWindow": "09:12-09:42", "ClusterCreateTime": "2023-02-27T23:21:33.048Z", "DeletionProtection": false, "IAMDatabaseAuthenticationEnabled": false, "ReadReplicaIdentifiers": [], "EngineMode": "provisioned", "Engine": "aurora-mysql", "StorageEncrypted": false, "MultiAZ": false, "PreferredMaintenanceWindow": "mon:04:31-mon:05:01", "HttpEndpointEnabled": false, "BackupRetentionPeriod": 1, "DbClusterResourceId": "cluster-ANPAJ4AE5446DAEXAMPLE", "DBClusterIdentifier": "sample-cluster", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "MasterUsername": "master", "EngineVersion": "5.7.mysql_aurora.2.11.1", "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-cluster", "DBClusterMembers": [], "Port": 3306, "Status": "creating", "Endpoint": "sample-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com", "DBClusterParameterGroup": "default.aurora-mysql5.7", "HostedZoneId": "Z2R2ITUGPM61AM", "ReaderEndpoint": "sample-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "CopyTagsToSnapshot": false } }例 2: PostgreSQL 互換 DB クラスターを作成するには
次の
create-db-clusterの例では、デフォルトのエンジンバージョンを使用して PostgreSQL 互換 DB クラスターを作成します。例のパスワードsecret99を安全なパスワードに置き換えます。コンソールを使用して DB クラスターを作成する場合、Amazon RDS は DB クラスターのライター DB インスタンスを自動作成します。ただし、CLI を使用して DB AWS クラスターを作成する場合は、create-db-instanceAWS CLI コマンドを使用して DB クラスターのライター DB インスタンスを明示的に作成する必要があります。aws rds create-db-cluster \ --db-cluster-identifiersample-pg-cluster\ --engineaurora-postgresql\ --master-username master \ --master-user-passwordsecret99\ --db-subnet-group-namedefault\ --vpc-security-group-idssg-0b9130572daf3dc16出力:
{ "DBCluster": { "Endpoint": "sample-pg-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com", "HttpEndpointEnabled": false, "DBClusterMembers": [], "EngineMode": "provisioned", "CopyTagsToSnapshot": false, "HostedZoneId": "Z2R2ITUGPM61AM", "IAMDatabaseAuthenticationEnabled": false, "AllocatedStorage": 1, "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-0b9130572daf3dc16", "Status": "active" } ], "DeletionProtection": false, "StorageEncrypted": false, "BackupRetentionPeriod": 1, "PreferredBackupWindow": "09:56-10:26", "ClusterCreateTime": "2023-02-27T23:26:08.371Z", "DBClusterParameterGroup": "default.aurora-postgresql13", "EngineVersion": "13.7", "Engine": "aurora-postgresql", "Status": "creating", "DBClusterIdentifier": "sample-pg-cluster", "MultiAZ": false, "Port": 5432, "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-pg-cluster", "AssociatedRoles": [], "DbClusterResourceId": "cluster-ANPAJ4AE5446DAEXAMPLE", "PreferredMaintenanceWindow": "wed:03:33-wed:04:03", "ReaderEndpoint": "sample-pg-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "MasterUsername": "master", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c" ], "ReadReplicaIdentifiers": [], "DBSubnetGroup": "default" } }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスターの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbCluster
」を参照してください。
-
次の例は、create-db-instance-read-replica を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスのリードレプリカを作成するには
この例では、
test-instanceという名前の既存の DB インスタンスのリードレプリカを作成します。リードレプリカの名前はtest-instance-replです。aws rds create-db-instance-read-replica \ --db-instance-identifiertest-instance-repl\ --source-db-instance-identifiertest-instance出力:
{ "DBInstance": { "IAMDatabaseAuthenticationEnabled": false, "MonitoringInterval": 0, "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:test-instance-repl", "ReadReplicaSourceDBInstanceIdentifier": "test-instance", "DBInstanceIdentifier": "test-instance-repl", ...some output truncated... } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbInstanceReadReplica
」を参照してください。
-
次の例は、create-db-instance を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスを作成するには
次の
create-db-instanceの例は、必須のオプションを使用して新しい DB インスタンスを起動します。aws rds create-db-instance \ --db-instance-identifiertest-mysql-instance\ --db-instance-classdb.t3.micro\ --enginemysql\ --master-usernameadmin\ --master-user-passwordsecret99\ --allocated-storage20出力:
{ "DBInstance": { "DBInstanceIdentifier": "test-mysql-instance", "DBInstanceClass": "db.t3.micro", "Engine": "mysql", "DBInstanceStatus": "creating", "MasterUsername": "admin", "AllocatedStorage": 20, "PreferredBackupWindow": "12:55-13:25", "BackupRetentionPeriod": 1, "DBSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-12345abc", "Status": "active" } ], "DBParameterGroups": [ { "DBParameterGroupName": "default.mysql5.7", "ParameterApplyStatus": "in-sync" } ], "DBSubnetGroup": { "DBSubnetGroupName": "default", "DBSubnetGroupDescription": "default", "VpcId": "vpc-2ff2ff2f", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-west-2c" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-west-2d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-west-2a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-west-2b" }, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "sun:08:07-sun:08:37", "PendingModifiedValues": { "MasterUserPassword": "****" }, "MultiAZ": false, "EngineVersion": "5.7.22", "AutoMinorVersionUpgrade": true, "ReadReplicaDBInstanceIdentifiers": [], "LicenseModel": "general-public-license", "OptionGroupMemberships": [ { "OptionGroupName": "default:mysql-5-7", "Status": "in-sync" } ], "PubliclyAccessible": true, "StorageType": "gp2", "DbInstancePort": 0, "StorageEncrypted": false, "DbiResourceId": "db-5555EXAMPLE44444444EXAMPLE", "CACertificateIdentifier": "rds-ca-2019", "DomainMemberships": [], "CopyTagsToSnapshot": false, "MonitoringInterval": 0, "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:test-mysql-instance", "IAMDatabaseAuthenticationEnabled": false, "PerformanceInsightsEnabled": false, "DeletionProtection": false, "AssociatedRoles": [] } }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS DB インスタンスの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDBInstance
」を参照してください。
-
次の例は、create-db-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB パラメータグループを作成するには
次の
create-db-parameter-groupの例は、DB パラメータグループを作成します。aws rds create-db-parameter-group \ --db-parameter-group-namemydbparametergroup\ --db-parameter-group-familyMySQL5.6\ --description"My new parameter group"出力:
{ "DBParameterGroup": { "DBParameterGroupName": "mydbparametergroup", "DBParameterGroupFamily": "mysql5.6", "Description": "My new parameter group", "DBParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:pg:mydbparametergroup" } }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを作成する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDBParameterGroup
」を参照してください。
-
次の例は、create-db-proxy-endpoint を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシエンドポイントを作成するには
次の
create-db-proxy-endpointの例では、DB プロキシエンドポイントを作成します。aws rds create-db-proxy-endpoint \ --db-proxy-nameproxyExample\ --db-proxy-endpoint-name"proxyep1"\ --vpc-subnet-idssubnetgroup1subnetgroup2出力:
{ "DBProxyEndpoint": { "DBProxyEndpointName": "proxyep1", "DBProxyEndpointArn": "arn:aws:rds:us-east-1:123456789012:db-proxy-endpoint:prx-endpoint-0123a01b12345c0ab", "DBProxyName": "proxyExample", "Status": "creating", "VpcId": "vpc-1234567", "VpcSecurityGroupIds": [ "sg-1234", "sg-5678" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Endpoint": "proxyep1.endpoint.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "TargetRole": "READ_WRITE", "IsDefault": false } }詳細については、「Amazon RDS ユーザーガイド」の「プロキシエンドポイントの作成」および「Amazon Aurora ユーザーガイド」の「プロキシエンドポイントの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbProxyEndpoint
」を参照してください。
-
次の例は、create-db-proxy を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシを作成するには
次の
create-db-proxyの例では、DB プロキシを作成します。aws rds create-db-proxy \ --db-proxy-nameproxyExample\ --engine-familyMYSQL\ --auth Description="proxydescription1",AuthScheme="SECRETS",SecretArn="arn:aws:secretsmanager:us-west-2:123456789123:secret:secretName-1234f",IAMAuth="DISABLED",ClientPasswordAuthType="MYSQL_NATIVE_PASSWORD" \ --role-arnarn:aws:iam::123456789123:role/ProxyRole\ --vpc-subnet-idssubnetgroup1subnetgroup2出力:
{ "DBProxy": { "DBProxyName": "proxyExample", "DBProxyArn": "arn:aws:rds:us-east-1:123456789012:db-proxy:prx-0123a01b12345c0ab", "EngineFamily": "MYSQL", "VpcId": "vpc-1234567", "VpcSecuritytGroupIds": [ "sg-1234", "sg-5678", "sg-9101" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Auth": "[ { "Description": "proxydescription1", "AuthScheme": "SECRETS", "SecretArn": "arn:aws:secretsmanager:us-west-2:123456789123:secret:proxysecret1-Abcd1e", "IAMAuth": "DISABLED" } ]", "RoleArn": "arn:aws:iam::12345678912:role/ProxyRole", "Endpoint": "proxyExample.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "RequireTLS": false, "IdleClientTimeout": 1800, "DebuggingLogging": false, "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "UpdatedDate": "2023-04-13T01:49:38.568000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの作成」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbProxy
」を参照してください。
-
次の例は、create-db-security-group を使用する方法を説明しています。
- AWS CLI
-
Amazon RDS セキュリティグループを作成するには
次の
create-db-security-groupコマンドは、新しい Amazon RDS DB セキュリティグループを作成します。aws rds create-db-security-group --db-security-group-namemysecgroup--db-security-group-description"My Test Security Group"この例では、新しい DB セキュリティグループに
mysecgroupという名前が付けられ、説明があります。出力:
{ "DBSecurityGroup": { "OwnerId": "123456789012", "DBSecurityGroupName": "mysecgroup", "DBSecurityGroupDescription": "My Test Security Group", "VpcId": "vpc-a1b2c3d4", "EC2SecurityGroups": [], "IPRanges": [], "DBSecurityGroupArn": "arn:aws:rds:us-west-2:123456789012:secgrp:mysecgroup" } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbSecurityGroup
」を参照してください。
-
次の例は、create-db-shard-group を使用する方法を説明しています。
- AWS CLI
-
例 1: Aurora PostgreSQL プライマリ DB クラスターを作成するには
次の
create-db-clusterの例では、Aurora Serverless v2 および Aurora Limitless Database と互換性のある Aurora PostgreSQL SQL プライマリ DB クラスターを作成します。aws rds create-db-cluster \ --db-cluster-identifiermy-sv2-cluster\ --engineaurora-postgresql\ --engine-version15.2-limitless\ --storage-typeaurora-iopt1\ --serverless-v2-scaling-configurationMinCapacity=2,MaxCapacity=16\ --enable-limitless-database \ --master-usernamemyuser\ --master-user-passwordmypassword\ --enable-cloudwatch-logs-exportspostgresql出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-east-2b", "us-east-2c", "us-east-2a" ], "BackupRetentionPeriod": 1, "DBClusterIdentifier": "my-sv2-cluster", "DBClusterParameterGroup": "default.aurora-postgresql15", "DBSubnetGroup": "default", "Status": "creating", "Endpoint": "my-sv2-cluster.cluster-cekycexample.us-east-2.rds.amazonaws.com", "ReaderEndpoint": "my-sv2-cluster.cluster-ro-cekycexample.us-east-2.rds.amazonaws.com", "MultiAZ": false, "Engine": "aurora-postgresql", "EngineVersion": "15.2-limitless", "Port": 5432, "MasterUsername": "myuser", "PreferredBackupWindow": "06:05-06:35", "PreferredMaintenanceWindow": "mon:08:25-mon:08:55", "ReadReplicaIdentifiers": [], "DBClusterMembers": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-########", "Status": "active" } ], "HostedZoneId": "Z2XHWR1EXAMPLE", "StorageEncrypted": false, "DbClusterResourceId": "cluster-XYEDT6ML6FHIXH4Q2J1EXAMPLE", "DBClusterArn": "arn:aws:rds:us-east-2:123456789012:cluster:my-sv2-cluster", "AssociatedRoles": [], "IAMDatabaseAuthenticationEnabled": false, "ClusterCreateTime": "2024-02-19T16:24:07.771000+00:00", "EnabledCloudwatchLogsExports": [ "postgresql" ], "EngineMode": "provisioned", "DeletionProtection": false, "HttpEndpointEnabled": false, "CopyTagsToSnapshot": false, "CrossAccountClone": false, "DomainMemberships": [], "TagList": [], "StorageType": "aurora-iopt1", "AutoMinorVersionUpgrade": true, "ServerlessV2ScalingConfiguration": { "MinCapacity": 2.0, "MaxCapacity": 16.0 }, "NetworkType": "IPV4", "IOOptimizedNextAllowedModificationTime": "2024-03-21T16:24:07.781000+00:00", "LimitlessDatabase": { "Status": "not-in-use", "MinRequiredACU": 96.0 } } }例 2: プライマリ (ライター) DB インスタンスを作成するには
次の
create-db-instanceの例では、Aurora Serverless v2 プライマリ (ライター) DB インスタンスを作成します。コンソールを使用して DB クラスターを作成する場合、Amazon RDS は DB クラスターのライター DB インスタンスを自動作成します。ただし、CLI を使用して DB AWS クラスターを作成する場合は、create-db-instanceAWS CLI コマンドを使用して DB クラスターのライター DB インスタンスを明示的に作成する必要があります。aws rds create-db-instance \ --db-instance-identifiermy-sv2-instance\ --db-cluster-identifiermy-sv2-cluster\ --engineaurora-postgresql\ --db-instance-classdb.serverless出力:
{ "DBInstance": { "DBInstanceIdentifier": "my-sv2-instance", "DBInstanceClass": "db.serverless", "Engine": "aurora-postgresql", "DBInstanceStatus": "creating", "MasterUsername": "myuser", "AllocatedStorage": 1, "PreferredBackupWindow": "06:05-06:35", "BackupRetentionPeriod": 1, "DBSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-########", "Status": "active" } ], "DBParameterGroups": [ { "DBParameterGroupName": "default.aurora-postgresql15", "ParameterApplyStatus": "in-sync" } ], "DBSubnetGroup": { "DBSubnetGroupName": "default", "DBSubnetGroupDescription": "default", "VpcId": "vpc-########", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-east-2c" }, "SubnetOutpost": {}, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-east-2a" }, "SubnetOutpost": {}, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-########", "SubnetAvailabilityZone": { "Name": "us-east-2b" }, "SubnetOutpost": {}, "SubnetStatus": "Active" } ] }, "PreferredMaintenanceWindow": "fri:09:01-fri:09:31", "PendingModifiedValues": { "PendingCloudwatchLogsExports": { "LogTypesToEnable": [ "postgresql" ] } }, "MultiAZ": false, "EngineVersion": "15.2-limitless", "AutoMinorVersionUpgrade": true, "ReadReplicaDBInstanceIdentifiers": [], "LicenseModel": "postgresql-license", "OptionGroupMemberships": [ { "OptionGroupName": "default:aurora-postgresql-15", "Status": "in-sync" } ], "PubliclyAccessible": false, "StorageType": "aurora-iopt1", "DbInstancePort": 0, "DBClusterIdentifier": "my-sv2-cluster", "StorageEncrypted": false, "DbiResourceId": "db-BIQTE3B3K3RM7M74SK5EXAMPLE", "CACertificateIdentifier": "rds-ca-rsa2048-g1", "DomainMemberships": [], "CopyTagsToSnapshot": false, "MonitoringInterval": 0, "PromotionTier": 1, "DBInstanceArn": "arn:aws:rds:us-east-2:123456789012:db:my-sv2-instance", "IAMDatabaseAuthenticationEnabled": false, "PerformanceInsightsEnabled": false, "DeletionProtection": false, "AssociatedRoles": [], "TagList": [], "CustomerOwnedIpEnabled": false, "BackupTarget": "region", "NetworkType": "IPV4", "StorageThroughput": 0, "CertificateDetails": { "CAIdentifier": "rds-ca-rsa2048-g1" }, "DedicatedLogVolume": false } }例 3: DB シャードグループを作成するには
次の
create-db-shard-groupの例では、Aurora PostgreSQL プライマリ DB クラスターに DB シャードグループを作成します。aws rds create-db-shard-group \ --db-shard-group-identifiermy-db-shard-group\ --db-cluster-identifiermy-sv2-cluster\ --max-acu768出力:
{ "DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890", "DBShardGroupIdentifier": "my-db-shard-group", "DBClusterIdentifier": "my-sv2-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "creating", "PubliclyAccessible": false, "Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora Serverless v2 を使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbShardGroup
」を参照してください。
-
次の例は、create-db-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB スナップショットを作成するには
次の
create-db-snapshotの例は、DB スナップショットを作成します。aws rds create-db-snapshot \ --db-instance-identifierdatabase-mysql\ --db-snapshot-identifiermydbsnapshot出力:
{ "DBSnapshot": { "DBSnapshotIdentifier": "mydbsnapshot", "DBInstanceIdentifier": "database-mysql", "Engine": "mysql", "AllocatedStorage": 100, "Status": "creating", "Port": 3306, "AvailabilityZone": "us-east-1b", "VpcId": "vpc-6594f31c", "InstanceCreateTime": "2019-04-30T15:45:53.663Z", "MasterUsername": "admin", "EngineVersion": "5.6.40", "LicenseModel": "general-public-license", "SnapshotType": "manual", "Iops": 1000, "OptionGroupName": "default:mysql-5-6", "PercentProgress": 0, "StorageType": "io1", "Encrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "DBSnapshotArn": "arn:aws:rds:us-east-1:123456789012:snapshot:mydbsnapshot", "IAMDatabaseAuthenticationEnabled": false, "ProcessorFeatures": [], "DbiResourceId": "db-AKIAIOSFODNN7EXAMPLE" } }詳細については、「Amazon RDS ユーザーガイド」の「DB スナップショットの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDBSnapshot
」を参照してください。
-
次の例は、create-db-subnet-group を使用する方法を説明しています。
- AWS CLI
-
DB サブネットグループを作成するには
次の
create-db-subnet-groupの例では、既存のサブネットを使用してmysubnetgroupという名前の DB サブネットグループを作成します。aws rds create-db-subnet-group \ --db-subnet-group-namemysubnetgroup\ --db-subnet-group-description"test DB subnet group"\ --subnet-ids '["subnet-0a1dc4e1a6f123456","subnet-070dd7ecb3aaaaaaa","subnet-00f5b198bc0abcdef"]'出力:
{ "DBSubnetGroup": { "DBSubnetGroupName": "mysubnetgroup", "DBSubnetGroupDescription": "test DB subnet group", "VpcId": "vpc-0f08e7610a1b2c3d4", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-070dd7ecb3aaaaaaa", "SubnetAvailabilityZone": { "Name": "us-west-2b" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-00f5b198bc0abcdef", "SubnetAvailabilityZone": { "Name": "us-west-2d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-0a1dc4e1a6f123456", "SubnetAvailabilityZone": { "Name": "us-west-2b" }, "SubnetStatus": "Active" } ], "DBSubnetGroupArn": "arn:aws:rds:us-west-2:0123456789012:subgrp:mysubnetgroup" } }詳細については、「Amazon RDS ユーザーガイド」の「VPC に DB インスタンスを作成する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateDbSubnetGroup
」を参照してください。
-
次の例は、create-event-subscription を使用する方法を説明しています。
- AWS CLI
-
イベントサブスクリプションを作成するには
次の の
create-event-subscription例では、現在の AWS アカウントの DB インスタンスのバックアップイベントとリカバリイベントのサブスクリプションを作成します。通知は、--sns-topic-arnで指定された Amazon Simple Notification Service のトピックに送信されます。aws rds create-event-subscription \ --subscription-namemy-instance-events\ --source-typedb-instance\ --event-categories '["backup","recovery"]' \ --sns-topic-arnarn:aws:sns:us-east-1:123456789012:interesting-events出力:
{ "EventSubscription": { "Status": "creating", "CustSubscriptionId": "my-instance-events", "SubscriptionCreationTime": "Tue Jul 31 23:22:01 UTC 2018", "EventCategoriesList": [ "backup", "recovery" ], "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:interesting-events", "CustomerAwsId": "123456789012", "EventSubscriptionArn": "arn:aws:rds:us-east-1:123456789012:es:my-instance-events", "SourceType": "db-instance", "Enabled": true } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateEventSubscription
」を参照してください。
-
次の例は、create-global-cluster を使用する方法を説明しています。
- AWS CLI
-
グローバル DB クラスターを作成するには
次の
create-global-clusterの例では、新しい Aurora MySQL 互換のグローバル DB クラスターを作成します。aws rds create-global-cluster \ --global-cluster-identifiermyglobalcluster\ --engineaurora-mysql出力:
{ "GlobalCluster": { "GlobalClusterIdentifier": "myglobalcluster", "GlobalClusterResourceId": "cluster-f0e523bfe07aabb", "GlobalClusterArn": "arn:aws:rds::123456789012:global-cluster:myglobalcluster", "Status": "available", "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.07.2", "StorageEncrypted": false, "DeletionProtection": false, "GlobalClusterMembers": [] } }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora グローバルデータベースの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateGlobalCluster
」を参照してください。
-
次の例は、create-option-group を使用する方法を説明しています。
- AWS CLI
-
Amazon RDS オプショングループを作成するには
次の
create-option-groupコマンドは、Oracle Enterprise Editionバージョン11.2`, is named ``MyOptionGroupの新しい Amazon RDS オプショングループを作成し、説明を含めます。aws rds create-option-group \ --option-group-nameMyOptionGroup\ --engine-nameoracle-ee\ --major-engine-version11.2\ --option-group-description"Oracle Database Manager Database Control"出力:
{ "OptionGroup": { "OptionGroupName": "myoptiongroup", "OptionGroupDescription": "Oracle Database Manager Database Control", "EngineName": "oracle-ee", "MajorEngineVersion": "11.2", "Options": [], "AllowsVpcAndNonVpcInstanceMemberships": true, "OptionGroupArn": "arn:aws:rds:us-west-2:123456789012:og:myoptiongroup" } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「CreateOptionGroup
」を参照してください。
-
次の例は、delete-blue-green-deployment を使用する方法を説明しています。
- AWS CLI
-
例 1: RDS for MySQL DB インスタンスのグリーン環境でリソースを削除するには
次の
delete-blue-green-deploymentの例では、RDS for MySQL DB インスタンスのグリーン環境内のリソースを削除します。aws rds delete-blue-green-deployment \ --blue-green-deployment-identifierbgd-v53303651eexfake\ --delete-target出力:
{ "BlueGreenDeployment": { "BlueGreenDeploymentIdentifier": "bgd-v53303651eexfake", "BlueGreenDeploymentName": "bgd-cli-test-instance", "Source": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "Target": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-green-rkfbpe", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-green-rkfbpe", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1-green-j382ha", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2-green-ejv4ao", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3-green-vlpz3t", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CONFIGURE_BACKUPS", "Status": "COMPLETED" }, { "Name": "CREATING_TOPOLOGY_OF_SOURCE", "Status": "COMPLETED" } ], "Status": "DELETING", "CreateTime": "2022-02-25T21:18:51.183000+00:00", "DeleteTime": "2022-02-25T22:25:31.331000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「ブルー/グリーンデプロイの削除」を参照してください。
例 2: Aurora MySQL DB クラスターのグリーン環境でリソースを削除するには
次の
delete-blue-green-deploymentの例では、Aurora MySQL DB クラスターのグリーン環境内のリソースを削除します。aws rds delete-blue-green-deployment \ --blue-green-deployment-identifierbgd-wi89nwzglccsfake\ --delete-target出力:
{ "BlueGreenDeployment": { "BlueGreenDeploymentIdentifier": "bgd-wi89nwzglccsfake", "BlueGreenDeploymentName": "my-blue-green-deployment", "Source": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "Target": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3rnukl", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3rnukl", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1-green-gpmaxf", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2-green-j2oajq", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3-green-mkxies", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint-green-4sqjrq", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint-green-gwwzlg", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CREATE_DB_INSTANCES_FOR_CLUSTER", "Status": "COMPLETED" }, { "Name": "CREATE_CUSTOM_ENDPOINTS", "Status": "COMPLETED" } ], "Status": "DELETING", "CreateTime": "2022-02-25T21:12:00.288000+00:00", "DeleteTime": "2022-02-25T22:29:11.336000+00:00" } }詳細については、「Amazon Aurora ユーザーガイド」の「ブルー/グリーンデプロイの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteBlueGreenDeployment
」を参照してください。
-
次の例は、delete-db-cluster-endpoint を使用する方法を説明しています。
- AWS CLI
-
カスタム DB クラスターエンドポイントを削除するには
次の
delete-db-cluster-endpointの例では、指定されたカスタム DB クラスターエンドポイントを削除します。aws rds delete-db-cluster-endpoint \ --db-cluster-endpoint-identifiermycustomendpoint出力:
{ "DBClusterEndpointIdentifier": "mycustomendpoint", "DBClusterIdentifier": "mydbcluster", "DBClusterEndpointResourceIdentifier": "cluster-endpoint-ANPAJ4AE5446DAEXAMPLE", "Endpoint": "mycustomendpoint.cluster-custom-cnpexample.us-east-1.rds.amazonaws.com", "Status": "deleting", "EndpointType": "CUSTOM", "CustomEndpointType": "READER", "StaticMembers": [ "dbinstance1", "dbinstance2", "dbinstance3" ], "ExcludedMembers": [], "DBClusterEndpointArn": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:mycustomendpoint" }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora 接続管理」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbClusterEndpoint
」を参照してください。
-
次の例は、delete-db-cluster-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB クラスターパラメータグループを削除するには
次の
delete-db-cluster-parameter-groupの例では、指定された DB クラスターパラメータグループを削除します。aws rds delete-db-cluster-parameter-group \ --db-cluster-parameter-group-namemydbclusterparametergroupこのコマンドでは何も出力されません。
詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbClusterParameterGroup
」を参照してください。
-
次の例は、delete-db-cluster-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB クラスタースナップショットを削除するには
次の
delete-db-cluster-snapshotの例では、指定したクラスタースナップショットを削除します。aws rds delete-db-cluster-snapshot \ --db-cluster-snapshot-identifiermydbclustersnapshot出力:
{ "DBClusterSnapshot": { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "DBClusterSnapshotIdentifier": "mydbclustersnapshot", "DBClusterIdentifier": "mydbcluster", "SnapshotCreateTime": "2019-06-18T21:21:00.469Z", "Engine": "aurora-mysql", "AllocatedStorage": 0, "Status": "available", "Port": 0, "VpcId": "vpc-6594f31c", "ClusterCreateTime": "2019-04-15T14:18:42.785Z", "MasterUsername": "myadmin", "EngineVersion": "5.7.mysql_aurora.2.04.2", "LicenseModel": "aurora-mysql", "SnapshotType": "manual", "PercentProgress": 100, "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:mydbclustersnapshot", "IAMDatabaseAuthenticationEnabled": false } }詳細については、「Amazon Aurora ユーザーガイド」の「スナップショットの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbClusterSnapshot
」を参照してください。
-
次の例は、delete-db-cluster を使用する方法を説明しています。
- AWS CLI
-
例 1: DB クラスター内の DB インスタンスを削除するには
次の
delete-db-instanceの例では、DB クラスター内の最後の DB インスタンスを削除します。削除状態にない DB インスタンスが含まれている DB クラスターは削除できません。DB クラスター内の DB インスタンスを削除するときに、最終的なスナップショットを作成することはできません。aws rds delete-db-instance \ --db-instance-identifierdatabase-3出力:
{ "DBInstance": { "DBInstanceIdentifier": "database-3", "DBInstanceClass": "db.r4.large", "Engine": "aurora-postgresql", "DBInstanceStatus": "deleting", ...output omitted... } }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスターで DB インスタンスを削除する」を参照してください。
例 2: DB クラスターを削除するには
次の
delete-db-clusterの例では、myclusterという名前の DB クラスターを削除し、mycluster-final-snapshotという名前の最終スナップショットを作成します。DB クラスターのステータスは、スナップショットの作成中に表示されるようになります。削除の進行状況を確認するには、describe-db-clustersCLI コマンドを使用します。aws rds delete-db-cluster \ --db-cluster-identifiermycluster\ --no-skip-final-snapshot \ --final-db-snapshot-identifiermycluster-final-snapshot出力:
{ "DBCluster": { "AllocatedStorage": 20, "AvailabilityZones": [ "eu-central-1b", "eu-central-1c", "eu-central-1a" ], "BackupRetentionPeriod": 7, "DBClusterIdentifier": "mycluster", "DBClusterParameterGroup": "default.aurora-postgresql10", "DBSubnetGroup": "default-vpc-aa11bb22", "Status": "available", ...output omitted... } }詳細については、「Amazon Aurora ユーザーガイド」の「単一 DB インスタンスの Aurora クラスター」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbCluster
」を参照してください。
-
次の例は、delete-db-instance-automated-backup を使用する方法を説明しています。
- AWS CLI
-
リージョンからレプリケートされた自動バックアップを削除するには
次の
delete-db-instance-automated-backupの例では、指定された Amazon リソースネーム (ARN) で自動バックアップを削除します。aws rds delete-db-instance-automated-backup \ --db-instance-automated-backups-arn"arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example"出力:
{ "DBInstanceAutomatedBackup": { "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:new-orcl-db", "DbiResourceId": "db-JKIB2GFQ5RV7REPLZA4EXAMPLE", "Region": "us-east-1", "DBInstanceIdentifier": "new-orcl-db", "RestoreWindow": {}, "AllocatedStorage": 20, "Status": "deleting", "Port": 1521, "AvailabilityZone": "us-east-1b", "VpcId": "vpc-########", "InstanceCreateTime": "2020-12-04T15:28:31Z", "MasterUsername": "admin", "Engine": "oracle-se2", "EngineVersion": "12.1.0.2.v21", "LicenseModel": "bring-your-own-license", "OptionGroupName": "default:oracle-se2-12-1", "Encrypted": false, "StorageType": "gp2", "IAMDatabaseAuthenticationEnabled": false, "BackupRetentionPeriod": 7, "DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example" } }詳細については、「Amazon RDS ユーザーガイド」の「レプリケーションされたバックアップの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbInstanceAutomatedBackup
」を参照してください。
-
次の例は、delete-db-instance を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスを削除するには
次の
delete-db-instanceの例は、test-instance-final-snapという名前の最終 DB スナップショットを作成した後に、指定された DB インスタンスを削除します。aws rds delete-db-instance \ --db-instance-identifiertest-instance\ --final-db-snapshot-identifiertest-instance-final-snap出力:
{ "DBInstance": { "DBInstanceIdentifier": "test-instance", "DBInstanceStatus": "deleting", ...some output truncated... } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDBInstance
」を参照してください。
-
次の例は、delete-db-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB パラメータグループを削除するには
次の
commandの例は、DB パラメータグループを削除します。aws rds delete-db-parameter-group \ --db-parameter-group-namemydbparametergroupこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDBParameterGroup
」を参照してください。
-
次の例は、delete-db-proxy-endpoint を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシエンドポイントを削除するには
次の
delete-db-proxy-endpointの例では、ターゲットデータベースの DB プロキシエンドポイントを削除します。aws rds delete-db-proxy-endpoint \ --db-proxy-endpoint-nameproxyEP1出力:
{ "DBProxyEndpoint": { "DBProxyEndpointName": "proxyEP1", "DBProxyEndpointArn": "arn:aws:rds:us-east-1:123456789012:db-proxy-endpoint:prx-endpoint-0123a01b12345c0ab", "DBProxyName": "proxyExample", "Status": "deleting", "VpcId": "vpc-1234567", "VpcSecurityGroupIds": [ "sg-1234", "sg-5678" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Endpoint": "proxyEP1.endpoint.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "CreatedDate": "2023-04-13T01:49:38.568000+00:00", "TargetRole": "READ_ONLY", "IsDefault": false } }詳細については、「Amazon RDS ユーザーガイド」の「プロキシエンドポイントの削除」および「Amazon Aurora ユーザーガイド」の「プロキシエンドポイントの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbProxyEndpoint
」を参照してください。
-
次の例は、delete-db-proxy を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシを削除するには
次の
delete-db-proxyの例は、DB プロキシを削除します。aws rds delete-db-proxy \ --db-proxy-nameproxyExample出力:
{ "DBProxy": { "DBProxyName": "proxyExample", "DBProxyArn": "arn:aws:rds:us-east-1:123456789012:db-proxy:prx-0123a01b12345c0ab", "Status": "deleting", "EngineFamily": "PostgreSQL", "VpcId": "vpc-1234567", "VpcSecurityGroupIds": [ "sg-1234", "sg-5678" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Auth": "[ { "Description": "proxydescription`" "AuthScheme": "SECRETS", "SecretArn": "arn:aws:secretsmanager:us-west-2:123456789123:secret:proxysecret1-Abcd1e", "IAMAuth": "DISABLED" } ], "RoleArn": "arn:aws:iam::12345678912:role/ProxyPostgreSQLRole", "Endpoint": "proxyExample.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "RequireTLS": false, "IdleClientTimeout": 1800, "DebuggingLogging": false, "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "UpdatedDate": "2023-04-13T01:49:38.568000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの削除」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbProxy
」を参照してください。
-
次の例は、delete-db-security-group を使用する方法を説明しています。
- AWS CLI
-
DB セキュリティグループを削除するには
次の
delete-db-security-groupの例では、mysecuritygroupという名前の DB セキュリティプロファイルを削除します。aws rds delete-db-security-group \ --db-security-group-namemysecuritygroupこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「DB セキュリティグループの操作 (EC2-Classic プラットフォーム)」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbSecurityGroup
」を参照してください。
-
次の例は、delete-db-shard-group を使用する方法を説明しています。
- AWS CLI
-
例 1: DB シャードグループの削除に失敗するには
次の
delete-db-shard-groupの例は、すべてのデータベースとスキーマを削除する前に DB シャードグループを削除しようとすると発生するエラーを示しています。aws rds delete-db-shard-group \ --db-shard-group-identifierlimitless-test-shard-grp出力:
An error occurred (InvalidDBShardGroupState) when calling the DeleteDBShardGroup operation: Unable to delete the DB shard group limitless-test-db-shard-group. Delete all of your Limitless Database databases and schemas, then try again.例 2: DB シャードグループを正常に削除するには
次の
delete-db-shard-group例では、publicスキーマを含むすべてのデータベースとスキーマを削除した後、DB シャードグループを削除します。aws rds delete-db-shard-group \ --db-shard-group-identifierlimitless-test-shard-grp出力:
{ "DBShardGroupResourceId": "shardgroup-7bb446329da94788b3f957746example", "DBShardGroupIdentifier": "limitless-test-shard-grp", "DBClusterIdentifier": "limitless-test-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "deleting", "PubliclyAccessible": true, "Endpoint": "limitless-test-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora DB クラスターと DB インスタンスを削除する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbShardGroup
」を参照してください。
-
次の例は、delete-db-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB スナップショットを削除するには
次の
delete-db-snapshotの例では、指定した DB スナップショットを削除します。aws rds delete-db-snapshot \ --db-snapshot-identifiermydbsnapshot出力:
{ "DBSnapshot": { "DBSnapshotIdentifier": "mydbsnapshot", "DBInstanceIdentifier": "database-mysql", "SnapshotCreateTime": "2019-06-18T22:08:40.702Z", "Engine": "mysql", "AllocatedStorage": 100, "Status": "deleted", "Port": 3306, "AvailabilityZone": "us-east-1b", "VpcId": "vpc-6594f31c", "InstanceCreateTime": "2019-04-30T15:45:53.663Z", "MasterUsername": "admin", "EngineVersion": "5.6.40", "LicenseModel": "general-public-license", "SnapshotType": "manual", "Iops": 1000, "OptionGroupName": "default:mysql-5-6", "PercentProgress": 100, "StorageType": "io1", "Encrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "DBSnapshotArn": "arn:aws:rds:us-east-1:123456789012:snapshot:mydbsnapshot", "IAMDatabaseAuthenticationEnabled": false, "ProcessorFeatures": [], "DbiResourceId": "db-AKIAIOSFODNN7EXAMPLE" } }詳細については、「Amazon RDS ユーザーガイド」の「スナップショットの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbSnapshot
」を参照してください。
-
次の例は、delete-db-subnet-group を使用する方法を説明しています。
- AWS CLI
-
DB サブネットグループを削除するには
次の
delete-db-subnet-groupの例では、mysubnetgroupという名前の DB サブネットグループを削除します。aws rds delete-db-subnet-group --db-subnet-group-namemysubnetgroupこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「VPC 内の DB インスタンスの使用」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteDbSubnetGroup
」を参照してください。
-
次の例は、delete-event-subscription を使用する方法を説明しています。
- AWS CLI
-
イベントサブスクリプションを削除するには
次の
delete-event-subscriptionの例では、指定したイベントサブスクリプションを削除します。aws rds delete-event-subscription --subscription-namemy-instance-events出力:
{ "EventSubscription": { "EventSubscriptionArn": "arn:aws:rds:us-east-1:123456789012:es:my-instance-events", "CustomerAwsId": "123456789012", "Enabled": false, "SourceIdsList": [ "test-instance" ], "SourceType": "db-instance", "EventCategoriesList": [ "backup", "recovery" ], "SubscriptionCreationTime": "2018-07-31 23:22:01.893", "CustSubscriptionId": "my-instance-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:interesting-events", "Status": "deleting" } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteEventSubscription
」を参照してください。
-
次の例は、delete-global-cluster を使用する方法を説明しています。
- AWS CLI
-
グローバル DB クラスターを削除するには
次の
delete-global-clusterの例では、Aurora MySQL 互換のグローバル DB クラスターを削除します。出力には、削除しているクラスターが表示されますが、後続のdescribe-global-clustersコマンドにはその DB クラスターはリストされません。aws rds delete-global-cluster \ --global-cluster-identifiermyglobalcluster出力:
{ "GlobalCluster": { "GlobalClusterIdentifier": "myglobalcluster", "GlobalClusterResourceId": "cluster-f0e523bfe07aabb", "GlobalClusterArn": "arn:aws:rds::123456789012:global-cluster:myglobalcluster", "Status": "available", "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.07.2", "StorageEncrypted": false, "DeletionProtection": false, "GlobalClusterMembers": [] } }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora グローバルデータベースの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteGlobalCluster
」を参照してください。
-
次の例は、delete-option-group を使用する方法を説明しています。
- AWS CLI
-
オプショングループを削除するには
次の
delete-option-groupの例は、指定されたオプショングループを削除します。aws rds delete-option-group \ --option-group-namemyoptiongroupこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「オプショングループの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeleteOptionGroup
」を参照してください。
-
次の例は、deregister-db-proxy-targets を使用する方法を説明しています。
- AWS CLI
-
DB プロキシターゲットをデータベースターゲットグループから登録解除するには
次の
deregister-db-proxy-targetsの例では、プロキシproxyExampleとそのターゲット間の関連付けを削除します。aws rds deregister-db-proxy-targets \ --db-proxy-nameproxyExample\ --db-instance-identifiersdatabase-1このコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの削除」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DeregisterDbProxyTargets
」を参照してください。
-
次の例は、describe-account-attributes を使用する方法を説明しています。
- AWS CLI
-
アカウントの属性を記述するには
次の の
describe-account-attributes例では、現在の AWS アカウントの属性を取得します。aws rds describe-account-attributes出力:
{ "AccountQuotas": [ { "Max": 40, "Used": 4, "AccountQuotaName": "DBInstances" }, { "Max": 40, "Used": 0, "AccountQuotaName": "ReservedDBInstances" }, { "Max": 100000, "Used": 40, "AccountQuotaName": "AllocatedStorage" }, { "Max": 25, "Used": 0, "AccountQuotaName": "DBSecurityGroups" }, { "Max": 20, "Used": 0, "AccountQuotaName": "AuthorizationsPerDBSecurityGroup" }, { "Max": 50, "Used": 1, "AccountQuotaName": "DBParameterGroups" }, { "Max": 100, "Used": 3, "AccountQuotaName": "ManualSnapshots" }, { "Max": 20, "Used": 0, "AccountQuotaName": "EventSubscriptions" }, { "Max": 50, "Used": 1, "AccountQuotaName": "DBSubnetGroups" }, { "Max": 20, "Used": 1, "AccountQuotaName": "OptionGroups" }, { "Max": 20, "Used": 6, "AccountQuotaName": "SubnetsPerDBSubnetGroup" }, { "Max": 5, "Used": 0, "AccountQuotaName": "ReadReplicasPerMaster" }, { "Max": 40, "Used": 1, "AccountQuotaName": "DBClusters" }, { "Max": 50, "Used": 0, "AccountQuotaName": "DBClusterParameterGroups" }, { "Max": 5, "Used": 0, "AccountQuotaName": "DBClusterRoles" } ] }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeAccountAttributes
」を参照してください。
-
次の例は、describe-blue-green-deployments を使用する方法を説明しています。
- AWS CLI
-
例 1: 作成完了後の RDS DB インスタンスのブルー/グリーンデプロイを記述するには
次の
describe-blue-green-deploymentの例では、作成が完了した後にブルー/グリーンデプロイの詳細を取得します。aws rds describe-blue-green-deployments \ --blue-green-deployment-identifierbgd-v53303651eexfake出力:
{ "BlueGreenDeployments": [ { "BlueGreenDeploymentIdentifier": "bgd-v53303651eexfake", "BlueGreenDeploymentName": "bgd-cli-test-instance", "Source": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "Target": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-green-rkfbpe", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-green-rkfbpe", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1-green-j382ha", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2-green-ejv4ao", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3-green-vlpz3t", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CONFIGURE_BACKUPS", "Status": "COMPLETED" }, { "Name": "CREATING_TOPOLOGY_OF_SOURCE", "Status": "COMPLETED" } ], "Status": "AVAILABLE", "CreateTime": "2022-02-25T21:18:51.183000+00:00" } ] }詳細については、「Amazon RDS ユーザーガイド」の「ブルー/グリーンデプロイの表示」を参照してください。
例 2: Aurora MySQL DB クラスター用にブルー/グリーンデプロイを記述するには
次の
describe-blue-green-deploymentの例では、ブルー/グリーンデプロイの詳細を取得します。aws rds describe-blue-green-deployments \ --blue-green-deployment-identifierbgd-wi89nwzglccsfake出力:
{ "BlueGreenDeployments": [ { "BlueGreenDeploymentIdentifier": "bgd-wi89nwzglccsfake", "BlueGreenDeploymentName": "my-blue-green-deployment", "Source": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "Target": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3rnukl", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3rnukl", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1-green-gpmaxf", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2-green-j2oajq", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3-green-mkxies", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint-green-4sqjrq", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint-green-gwwzlg", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CREATE_DB_INSTANCES_FOR_CLUSTER", "Status": "COMPLETED" }, { "Name": "CREATE_CUSTOM_ENDPOINTS", "Status": "COMPLETED" } ], "Status": "AVAILABLE", "CreateTime": "2022-02-25T21:12:00.288000+00:00" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「ブルー/グリーンデプロイの表示」を参照してください。
例 3: スイッチオーバー後の Aurora MySQL クラスターのブルー/グリーンデプロイを記述するには
次の
describe-blue-green-deploymentの例では、グリーン環境を本番環境に昇格した後のブルー/グリーンデプロイの詳細を取得します。aws rds describe-blue-green-deployments \ --blue-green-deployment-identifierbgd-wi89nwzglccsfake出力:
{ "BlueGreenDeployments": [ { "BlueGreenDeploymentIdentifier": "bgd-wi89nwzglccsfake", "BlueGreenDeploymentName": "my-blue-green-deployment", "Source": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-old1", "Target": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint", "Status": "SWITCHOVER_COMPLETED" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CREATE_DB_INSTANCES_FOR_CLUSTER", "Status": "COMPLETED" }, { "Name": "CREATE_CUSTOM_ENDPOINTS", "Status": "COMPLETED" } ], "Status": "SWITCHOVER_COMPLETED", "CreateTime": "2022-02-25T22:38:49.522000+00:00" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「ブルー/グリーンデプロイの表示」を参照してください。
例 4: ブルーとグリーンを組み合わせたデプロイを記述するには
次の
describe-blue-green-deployment例では、ブルーとグリーンを組み合わせたデプロイの詳細を取得します。aws rds describe-blue-green-deployments出力:
{ "BlueGreenDeployments": [ { "BlueGreenDeploymentIdentifier": "bgd-wi89nwzgfakelccs", "BlueGreenDeploymentName": "my-blue-green-deployment", "Source": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "Target": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3rnukl", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3rnukl", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1-green-gpmaxf", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2-green-j2oajq", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3-green-mkxies", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint-green-4sqjrq", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint-green-gwwzlg", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CREATE_DB_INSTANCES_FOR_CLUSTER", "Status": "COMPLETED" }, { "Name": "CREATE_CUSTOM_ENDPOINTS", "Status": "COMPLETED" } ], "Status": "AVAILABLE", "CreateTime": "2022-02-25T21:12:00.288000+00:00" }, { "BlueGreenDeploymentIdentifier": "bgd-v5330365fake1eex", "BlueGreenDeploymentName": "bgd-cli-test-instance", "Source": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-old1", "Target": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2", "Status": "SWITCHOVER_COMPLETED" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3-old1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3", "Status": "SWITCHOVER_COMPLETED" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CONFIGURE_BACKUPS", "Status": "COMPLETED" }, { "Name": "CREATING_TOPOLOGY_OF_SOURCE", "Status": "COMPLETED" } ], "Status": "SWITCHOVER_COMPLETED", "CreateTime": "2022-02-25T22:33:22.225000+00:00" } ] }詳細については、「Amazon RDS ユーザーガイド」の「ブルー/グリーンデプロイの表示」および「Amazon Aurora ユーザーガイド」の「ブルー/グリーンデプロイの表示」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeBlueGreenDeployments
」を参照してください。
-
次の例は、describe-certificates を使用する方法を説明しています。
- AWS CLI
-
証明書を記述するには
次の
describe-certificatesの例では、ユーザーのデフォルトリージョンに関連付けられた証明書の詳細を取得します。aws rds describe-certificates出力:
{ "Certificates": [ { "CertificateIdentifier": "rds-ca-ecc384-g1", "CertificateType": "CA", "Thumbprint": "2ee3dcc06e50192559b13929e73484354f23387d", "ValidFrom": "2021-05-24T22:06:59+00:00", "ValidTill": "2121-05-24T23:06:59+00:00", "CertificateArn": "arn:aws:rds:us-west-2::cert:rds-ca-ecc384-g1", "CustomerOverride": false }, { "CertificateIdentifier": "rds-ca-rsa4096-g1", "CertificateType": "CA", "Thumbprint": "19da4f2af579a8ae1f6a0fa77aa5befd874b4cab", "ValidFrom": "2021-05-24T22:03:20+00:00", "ValidTill": "2121-05-24T23:03:20+00:00", "CertificateArn": "arn:aws:rds:us-west-2::cert:rds-ca-rsa4096-g1", "CustomerOverride": false }, { "CertificateIdentifier": "rds-ca-rsa2048-g1", "CertificateType": "CA", "Thumbprint": "7c40cb42714b6fdb2b296f9bbd0e8bb364436a76", "ValidFrom": "2021-05-24T21:59:00+00:00", "ValidTill": "2061-05-24T22:59:00+00:00", "CertificateArn": "arn:aws:rds:us-west-2::cert:rds-ca-rsa2048-g1", "CustomerOverride": true, "CustomerOverrideValidTill": "2061-05-24T22:59:00+00:00" }, { "CertificateIdentifier": "rds-ca-2019", "CertificateType": "CA", "Thumbprint": "d40ddb29e3750dffa671c3140bbf5f478d1c8096", "ValidFrom": "2019-08-22T17:08:50+00:00", "ValidTill": "2024-08-22T17:08:50+00:00", "CertificateArn": "arn:aws:rds:us-west-2::cert:rds-ca-2019", "CustomerOverride": false } ], "DefaultCertificateForNewLaunches": "rds-ca-rsa2048-g1" }詳細については、「Amazon RDS ユーザーガイド」の「SSL/TLS を使用して DB インスタンスへの接続を暗号化する」および「Amazon Aurora ユーザーガイド」の「SSL/TLS を使用して DB クラスターへの接続を暗号化する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeCertificates
」を参照してください。
-
次の例は、describe-db-cluster-backtracks を使用する方法を説明しています。
- AWS CLI
-
DB クラスターのバックトラックを記述するには
次の
describe-db-cluster-backtracksの例は、指定された DB クラスターの詳細情報を取得します。aws rds describe-db-cluster-backtracks \ --db-cluster-identifiermydbcluster出力:
{ "DBClusterBacktracks": [ { "DBClusterIdentifier": "mydbcluster", "BacktrackIdentifier": "2f5f5294-0dd2-44c9-9f50-EXAMPLE", "BacktrackTo": "2021-02-12T04:59:22Z", "BacktrackedFrom": "2021-02-12T14:37:31.640Z", "BacktrackRequestCreationTime": "2021-02-12T14:36:18.819Z", "Status": "COMPLETED" }, { "DBClusterIdentifier": "mydbcluster", "BacktrackIdentifier": "3c7a6421-af2a-4ea3-ae95-EXAMPLE", "BacktrackTo": "2021-02-11T22:53:46Z", "BacktrackedFrom": "2021-02-12T00:09:27.006Z", "BacktrackRequestCreationTime": "2021-02-12T00:07:53.487Z", "Status": "COMPLETED" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora DB クラスターのバックトラック」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusterBacktracks
」を参照してください。
-
次の例は、describe-db-cluster-endpoints を使用する方法を説明しています。
- AWS CLI
-
例 1: DB クラスターエンドポイントを記述するには
次の
describe-db-cluster-endpointsの例では、DB クラスターエンドポイントの詳細を取得します。最も一般的な種類の Aurora クラスターには 2 つのエンドポイントがあります。1 つのエンドポイントのタイプはWRITERです。このエンドポイントは、すべての SQL ステートメントに使用できます。もう 1 つのエンドポイントのタイプはREADERです。このエンドポイントは、SELECT およびその他の読み取り専用 SQL ステートメントでのみ使用できます。aws rds describe-db-cluster-endpoints出力:
{ "DBClusterEndpoints": [ { "DBClusterIdentifier": "my-database-1", "Endpoint": "my-database-1.cluster-cnpexample.us-east-1.rds.amazonaws.com", "Status": "creating", "EndpointType": "WRITER" }, { "DBClusterIdentifier": "my-database-1", "Endpoint": "my-database-1.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "Status": "creating", "EndpointType": "READER" }, { "DBClusterIdentifier": "mydbcluster", "Endpoint": "mydbcluster.cluster-cnpexamle.us-east-1.rds.amazonaws.com", "Status": "available", "EndpointType": "WRITER" }, { "DBClusterIdentifier": "mydbcluster", "Endpoint": "mydbcluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "Status": "available", "EndpointType": "READER" } ] }例 2: 単一の DB クラスターの DB クラスターエンドポイントを記述するには
次の
describe-db-cluster-endpointsの例では、単一の指定された DB クラスターの DB クラスターエンドポイントの詳細を取得します。Aurora Serverless クラスターには、WRITERタイプのエンドポイントが 1 つだけあります。aws rds describe-db-cluster-endpoints \ --db-cluster-identifierserverless-cluster出力:
{ "DBClusterEndpoints": [ { "Status": "available", "Endpoint": "serverless-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com", "DBClusterIdentifier": "serverless-cluster", "EndpointType": "WRITER" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora 接続管理」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusterEndpoints
」を参照してください。
-
次の例は、describe-db-cluster-parameter-groups を使用する方法を説明しています。
- AWS CLI
-
DB クラスターパラメータグループを記述するには
次の
describe-db-cluster-parameter-groupsの例では、DB クラスターパラメータグループの詳細を取得します。aws rds describe-db-cluster-parameter-groups出力:
{ "DBClusterParameterGroups": [ { "DBClusterParameterGroupName": "default.aurora-mysql5.7", "DBParameterGroupFamily": "aurora-mysql5.7", "Description": "Default cluster parameter group for aurora-mysql5.7", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:default.aurora-mysql5.7" }, { "DBClusterParameterGroupName": "default.aurora-postgresql9.6", "DBParameterGroupFamily": "aurora-postgresql9.6", "Description": "Default cluster parameter group for aurora-postgresql9.6", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:default.aurora-postgresql9.6" }, { "DBClusterParameterGroupName": "default.aurora5.6", "DBParameterGroupFamily": "aurora5.6", "Description": "Default cluster parameter group for aurora5.6", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:default.aurora5.6" }, { "DBClusterParameterGroupName": "mydbclusterpg", "DBParameterGroupFamily": "aurora-mysql5.7", "Description": "My DB cluster parameter group", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:mydbclusterpg" }, { "DBClusterParameterGroupName": "mydbclusterpgcopy", "DBParameterGroupFamily": "aurora-mysql5.7", "Description": "Copy of mydbclusterpg parameter group", "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:mydbclusterpgcopy" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusterParameterGroups
」を参照してください。
-
次の例は、describe-db-cluster-parameters を使用する方法を説明しています。
- AWS CLI
-
例 1: DB クラスターパラメータグループのパラメータを記述するには
次の
describe-db-cluster-parametersの例では、DB パラメータグループのパラメータに関する詳細を取得します。aws rds describe-db-cluster-parameters \ --db-cluster-parameter-group-namemydbclusterpg出力:
{ "Parameters": [ { "ParameterName": "allow-suspicious-udfs", "Description": "Controls whether user-defined functions that have only an xxx symbol for the main function can be loaded", "Source": "engine-default", "ApplyType": "static", "DataType": "boolean", "AllowedValues": "0,1", "IsModifiable": false, "ApplyMethod": "pending-reboot", "SupportedEngineModes": [ "provisioned" ] }, { "ParameterName": "aurora_lab_mode", "ParameterValue": "0", "Description": "Enables new features in the Aurora engine.", "Source": "engine-default", "ApplyType": "static", "DataType": "boolean", "AllowedValues": "0,1", "IsModifiable": true, "ApplyMethod": "pending-reboot", "SupportedEngineModes": [ "provisioned" ] }, ...some output truncated... ] }例 2: DB クラスターパラメータグループのパラメータ名のみを一覧表示するには
次の
describe-db-cluster-parametersの例では、DB クラスターパラメータグループ内のパラメータの名前のみを取得します。aws rds describe-db-cluster-parameters \ --db-cluster-parameter-group-namedefault.aurora-mysql5.7\ --query 'Parameters[].{ParameterName:ParameterName}'出力:
[ { "ParameterName": "allow-suspicious-udfs" }, { "ParameterName": "aurora_binlog_read_buffer_size" }, { "ParameterName": "aurora_binlog_replication_max_yield_seconds" }, { "ParameterName": "aurora_binlog_use_large_read_buffer" }, { "ParameterName": "aurora_lab_mode" }, ...some output truncated... } ]例 3: DB クラスターパラメータグループ内の変更可能なパラメータのみを記述するには
次の
describe-db-cluster-parametersの例では、DB クラスターパラメータグループで変更できるパラメータの名前のみを取得します。aws rds describe-db-cluster-parameters \ --db-cluster-parameter-group-namedefault.aurora-mysql5.7\ --query 'Parameters[].{ParameterName:ParameterName,IsModifiable:IsModifiable} | [?IsModifiable == `true`]'出力:
[ { "ParameterName": "aurora_binlog_read_buffer_size", "IsModifiable": true }, { "ParameterName": "aurora_binlog_replication_max_yield_seconds", "IsModifiable": true }, { "ParameterName": "aurora_binlog_use_large_read_buffer", "IsModifiable": true }, { "ParameterName": "aurora_lab_mode", "IsModifiable": true }, ...some output truncated... } ]例 4: DB クラスターパラメータグループ内の変更可能なブールパラメータのみを記述するには
次の
describe-db-cluster-parametersの例では、DB クラスターパラメータグループで変更できるパラメータとブール値データ型を持つパラメータの名前のみを取得します。aws rds describe-db-cluster-parameters \ --db-cluster-parameter-group-namedefault.aurora-mysql5.7\ --query 'Parameters[].{ParameterName:ParameterName,DataType:DataType,IsModifiable:IsModifiable} | [?DataType == `boolean`] | [?IsModifiable == `true`]'出力:
[ { "DataType": "boolean", "ParameterName": "aurora_binlog_use_large_read_buffer", "IsModifiable": true }, { "DataType": "boolean", "ParameterName": "aurora_lab_mode", "IsModifiable": true }, { "DataType": "boolean", "ParameterName": "autocommit", "IsModifiable": true }, { "DataType": "boolean", "ParameterName": "automatic_sp_privileges", "IsModifiable": true }, ...some output truncated... } ]詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusterParameters
」を参照してください。
-
次の例は、describe-db-cluster-snapshot-attributes を使用する方法を説明しています。
- AWS CLI
-
DB クラスタースナップショットの属性名と値を記述するには
次の
describe-db-cluster-snapshot-attributesの例では、指定された DB クラスタースナップショットの属性名と値の詳細を取得します。aws rds describe-db-cluster-snapshot-attributes \ --db-cluster-snapshot-identifiermyclustersnapshot出力:
{ "DBClusterSnapshotAttributesResult": { "DBClusterSnapshotIdentifier": "myclustersnapshot", "DBClusterSnapshotAttributes": [ { "AttributeName": "restore", "AttributeValues": [ "123456789012" ] } ] } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスタースナップショットの共有」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusterSnapshotAttributes
」を参照してください。
-
次の例は、describe-db-cluster-snapshots を使用する方法を説明しています。
- AWS CLI
-
DB クラスターの DB クラスタースナップショットを記述するには
次の
describe-db-cluster-snapshotsの例では、指定された DB クラスターの DB クラスタースナップショットの詳細を取得します。aws rds describe-db-cluster-snapshots \ --db-cluster-identifiermydbcluster出力:
{ "DBClusterSnapshots": [ { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "DBClusterSnapshotIdentifier": "myclustersnapshotcopy", "DBClusterIdentifier": "mydbcluster", "SnapshotCreateTime": "2019-06-04T09:16:42.649Z", "Engine": "aurora-mysql", "AllocatedStorage": 0, "Status": "available", "Port": 0, "VpcId": "vpc-6594f31c", "ClusterCreateTime": "2019-04-15T14:18:42.785Z", "MasterUsername": "myadmin", "EngineVersion": "5.7.mysql_aurora.2.04.2", "LicenseModel": "aurora-mysql", "SnapshotType": "manual", "PercentProgress": 100, "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:814387698303:cluster-snapshot:myclustersnapshotcopy", "IAMDatabaseAuthenticationEnabled": false }, { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "DBClusterSnapshotIdentifier": "rds:mydbcluster-2019-06-20-09-16", "DBClusterIdentifier": "mydbcluster", "SnapshotCreateTime": "2019-06-20T09:16:26.569Z", "Engine": "aurora-mysql", "AllocatedStorage": 0, "Status": "available", "Port": 0, "VpcId": "vpc-6594f31c", "ClusterCreateTime": "2019-04-15T14:18:42.785Z", "MasterUsername": "myadmin", "EngineVersion": "5.7.mysql_aurora.2.04.2", "LicenseModel": "aurora-mysql", "SnapshotType": "automated", "PercentProgress": 100, "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:814387698303:key/AKIAIOSFODNN7EXAMPLE", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:rds:mydbcluster-2019-06-20-09-16", "IAMDatabaseAuthenticationEnabled": false } ] }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスタースナップショットの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusterSnapshots
」を参照してください。
-
次の例は、describe-db-clusters を使用する方法を説明しています。
- AWS CLI
-
例 1: DB クラスターを記述するには
次の
describe-db-clustersの例は、指定された DB クラスターの詳細情報を取得します。aws rds describe-db-clusters \ --db-cluster-identifiermydbcluster出力:
{ "DBClusters": [ { "AllocatedStorage": 1, "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1e" ], "BackupRetentionPeriod": 1, "DatabaseName": "mydbcluster", "DBClusterIdentifier": "mydbcluster", "DBClusterParameterGroup": "default.aurora-mysql5.7", "DBSubnetGroup": "default", "Status": "available", "EarliestRestorableTime": "2019-06-19T09:16:28.210Z", "Endpoint": "mydbcluster.cluster-cnpexample.us-east-1.rds.amazonaws.com", "ReaderEndpoint": "mydbcluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "MultiAZ": true, "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.04.2", "LatestRestorableTime": "2019-06-20T22:38:14.908Z", "Port": 3306, "MasterUsername": "myadmin", "PreferredBackupWindow": "09:09-09:39", "PreferredMaintenanceWindow": "sat:04:09-sat:04:39", "ReadReplicaIdentifiers": [], "DBClusterMembers": [ { "DBInstanceIdentifier": "dbinstance3", "IsClusterWriter": false, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 }, { "DBInstanceIdentifier": "dbinstance1", "IsClusterWriter": false, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 }, { "DBInstanceIdentifier": "dbinstance2", "IsClusterWriter": false, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 }, { "DBInstanceIdentifier": "mydbcluster", "IsClusterWriter": false, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 }, { "DBInstanceIdentifier": "mydbcluster-us-east-1b", "IsClusterWriter": false, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 }, { "DBInstanceIdentifier": "mydbcluster", "IsClusterWriter": true, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 } ], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-0b9130572daf3dc16", "Status": "active" } ], "HostedZoneId": "Z2R2ITUGPM61AM", "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-east-1:814387698303:key/AKIAIOSFODNN7EXAMPLE", "DbClusterResourceId": "cluster-AKIAIOSFODNN7EXAMPLE", "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:mydbcluster", "AssociatedRoles": [], "IAMDatabaseAuthenticationEnabled": false, "ClusterCreateTime": "2019-04-15T14:18:42.785Z", "EngineMode": "provisioned", "DeletionProtection": false, "HttpEndpointEnabled": false } ] }例 2: すべての DB クラスターの特定の属性を一覧表示するには
次の の
describe-db-clusters例ではDBClusterIdentifier、現在の AWS リージョン内のすべての DB クラスターの 、Endpoint、およびReaderEndpoint属性のみを取得します。aws rds describe-db-clusters \ --query 'DBClusters[].{DBClusterIdentifier:DBClusterIdentifier,Endpoint:Endpoint,ReaderEndpoint:ReaderEndpoint}'出力:
[ { "Endpoint": "cluster-57-2020-05-01-2270.cluster-cnpexample.us-east-1.rds.amazonaws.com", "ReaderEndpoint": "cluster-57-2020-05-01-2270.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "DBClusterIdentifier": "cluster-57-2020-05-01-2270" }, { "Endpoint": "cluster-57-2020-05-01-4615.cluster-cnpexample.us-east-1.rds.amazonaws.com", "ReaderEndpoint": "cluster-57-2020-05-01-4615.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "DBClusterIdentifier": "cluster-57-2020-05-01-4615" }, { "Endpoint": "pg2-cluster.cluster-cnpexample.us-east-1.rds.amazonaws.com", "ReaderEndpoint": "pg2-cluster.cluster-ro-cnpexample.us-east-1.rds.amazonaws.com", "DBClusterIdentifier": "pg2-cluster" }, ...output omitted... } ]例 3: 特定の属性を持つ DB クラスターを一覧表示するには
次の
describe-db-clustersの例では、aurora-postgresqlDB エンジンを使用する DB クラスターのDBClusterIdentifierおよびEngine属性のみを取得します。aws rds describe-db-clusters \ --query 'DBClusters[].{DBClusterIdentifier:DBClusterIdentifier,Engine:Engine} | [?Engine == `aurora-postgresql`]'出力:
[ { "Engine": "aurora-postgresql", "DBClusterIdentifier": "pg2-cluster" } ]詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスター」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbClusters
」を参照してください。
-
次の例は、describe-db-engine-versions を使用する方法を説明しています。
- AWS CLI
-
MySQL DB エンジンの DB エンジンバージョンを記述するには
次の
describe-db-engine-versionsの例は、指定された DB エンジンの各 DB エンジンバージョンに関する詳細が表示されます。aws rds describe-db-engine-versions \ --enginemysql出力:
{ "DBEngineVersions": [ { "Engine": "mysql", "EngineVersion": "5.5.46", "DBParameterGroupFamily": "mysql5.5", "DBEngineDescription": "MySQL Community Edition", "DBEngineVersionDescription": "MySQL 5.5.46", "ValidUpgradeTarget": [ { "Engine": "mysql", "EngineVersion": "5.5.53", "Description": "MySQL 5.5.53", "AutoUpgrade": false, "IsMajorVersionUpgrade": false }, { "Engine": "mysql", "EngineVersion": "5.5.54", "Description": "MySQL 5.5.54", "AutoUpgrade": false, "IsMajorVersionUpgrade": false }, { "Engine": "mysql", "EngineVersion": "5.5.57", "Description": "MySQL 5.5.57", "AutoUpgrade": false, "IsMajorVersionUpgrade": false }, ...some output truncated... ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon Relational Database Service (Amazon RDS) とは」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンスの「DescribeDBEngineVersions
」を参照してください。
-
次の例は、describe-db-instance-automated-backups を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスの自動バックアップを記述するには
次の
describe-db-instance-automated-backupsの例では、指定された DB インスタンスの自動バックアップの詳細を表示します。詳細には、他の AWS リージョンでのレプリケートされた自動バックアップが含まれます。aws rds describe-db-instance-automated-backups \ --db-instance-identifiernew-orcl-db出力:
{ "DBInstanceAutomatedBackups": [ { "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:new-orcl-db", "DbiResourceId": "db-JKIB2GFQ5RV7REPLZA4EXAMPLE", "Region": "us-east-1", "DBInstanceIdentifier": "new-orcl-db", "RestoreWindow": { "EarliestTime": "2020-12-07T21:05:20.939Z", "LatestTime": "2020-12-07T21:05:20.939Z" }, "AllocatedStorage": 20, "Status": "replicating", "Port": 1521, "InstanceCreateTime": "2020-12-04T15:28:31Z", "MasterUsername": "admin", "Engine": "oracle-se2", "EngineVersion": "12.1.0.2.v21", "LicenseModel": "bring-your-own-license", "OptionGroupName": "default:oracle-se2-12-1", "Encrypted": false, "StorageType": "gp2", "IAMDatabaseAuthenticationEnabled": false, "BackupRetentionPeriod": 14, "DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example" } ] }詳細については、「Amazon RDS ユーザーガイド」の「レプリケーションされたバックアップに関する情報の検索」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbInstanceAutomatedBackups
」を参照してください。
-
次の例は、describe-db-instances を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスを記述するには
次の
describe-db-instancesの例は、指定された DB インスタンスの詳細情報を取得します。aws rds describe-db-instances \ --db-instance-identifiermydbinstancecf出力:
{ "DBInstances": [ { "DBInstanceIdentifier": "mydbinstancecf", "DBInstanceClass": "db.t3.small", "Engine": "mysql", "DBInstanceStatus": "available", "MasterUsername": "masterawsuser", "Endpoint": { "Address": "mydbinstancecf.abcexample.us-east-1.rds.amazonaws.com", "Port": 3306, "HostedZoneId": "Z2R2ITUGPM61AM" }, ...some output truncated... } ] }-
API の詳細については、AWS CLI コマンドリファレンスの「DescribeDBInstances
」を参照してください。
-
次の例は、describe-db-log-files を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスのログファイルを記述するには
次の
describe-db-log-filesの例は、指定された DB インスタンスのログファイルの詳細を取得します。aws rds describe-db-log-files -\-db-instance-identifiertest-instance出力:
{ "DescribeDBLogFiles": [ { "Size": 0, "LastWritten": 1533060000000, "LogFileName": "error/mysql-error-running.log" }, { "Size": 2683, "LastWritten": 1532994300000, "LogFileName": "error/mysql-error-running.log.0" }, { "Size": 107, "LastWritten": 1533057300000, "LogFileName": "error/mysql-error-running.log.18" }, { "Size": 13105, "LastWritten": 1532991000000, "LogFileName": "error/mysql-error-running.log.23" }, { "Size": 0, "LastWritten": 1533061200000, "LogFileName": "error/mysql-error.log" }, { "Size": 3519, "LastWritten": 1532989252000, "LogFileName": "mysqlUpgrade" } ] }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbLogFiles
」を参照してください。
-
次の例は、describe-db-parameter-groups を使用する方法を説明しています。
- AWS CLI
-
DB パラメータグループを記述するには
次の
describe-db-parameter-groupsの例では、DB パラメータグループに関する詳細を取得します。aws rds describe-db-parameter-groups出力:
{ "DBParameterGroups": [ { "DBParameterGroupName": "default.aurora-mysql5.7", "DBParameterGroupFamily": "aurora-mysql5.7", "Description": "Default parameter group for aurora-mysql5.7", "DBParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:pg:default.aurora-mysql5.7" }, { "DBParameterGroupName": "default.aurora-postgresql9.6", "DBParameterGroupFamily": "aurora-postgresql9.6", "Description": "Default parameter group for aurora-postgresql9.6", "DBParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:pg:default.aurora-postgresql9.6" }, { "DBParameterGroupName": "default.aurora5.6", "DBParameterGroupFamily": "aurora5.6", "Description": "Default parameter group for aurora5.6", "DBParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:pg:default.aurora5.6" }, { "DBParameterGroupName": "default.mariadb10.1", "DBParameterGroupFamily": "mariadb10.1", "Description": "Default parameter group for mariadb10.1", "DBParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:pg:default.mariadb10.1" }, ...some output truncated... ] }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを使用する」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンスの「DescribeDBParameterGroups
」を参照してください。
-
次の例は、describe-db-parameters を使用する方法を説明しています。
- AWS CLI
-
DB パラメータグループのパラメータを記述するには
次の
describe-db-parametersの例では、指定された DB パラメータグループに関する詳細を取得します。aws rds describe-db-parameters \ --db-parameter-group-namemydbpg出力:
{ "Parameters": [ { "ParameterName": "allow-suspicious-udfs", "Description": "Controls whether user-defined functions that have only an xxx symbol for the main function can be loaded", "Source": "engine-default", "ApplyType": "static", "DataType": "boolean", "AllowedValues": "0,1", "IsModifiable": false, "ApplyMethod": "pending-reboot" }, { "ParameterName": "auto_generate_certs", "Description": "Controls whether the server autogenerates SSL key and certificate files in the data directory, if they do not already exist.", "Source": "engine-default", "ApplyType": "static", "DataType": "boolean", "AllowedValues": "0,1", "IsModifiable": false, "ApplyMethod": "pending-reboot" }, ...some output truncated... ] }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを使用する」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンスの「DescribeDBParameters
」を参照してください。
-
次の例は、describe-db-proxies を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシを記述するには
次の
describe-db-proxiesの例では、DB プロキシに関する情報を取得します。aws rds describe-db-proxies出力:
{ "DBProxies": [ { "DBProxyName": "proxyExample1", "DBProxyArn": "arn:aws:rds:us-east-1:123456789012:db-proxy:prx-0123a01b12345c0ab", "Status": "available", "EngineFamily": "PostgreSQL", "VpcId": "vpc-1234567", "VpcSecurityGroupIds": [ "sg-1234" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Auth": "[ { "Description": "proxydescription1" "AuthScheme": "SECRETS", "SecretArn": "arn:aws:secretsmanager:us-west-2:123456789123:secret:secretName-1234f", "IAMAuth": "DISABLED" } ]", "RoleArn": "arn:aws:iam::12345678912??:role/ProxyPostgreSQLRole", "Endpoint": "proxyExample1.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "RequireTLS": false, "IdleClientTimeout": 1800, "DebuggingLogging": false, "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "UpdatedDate": "2023-04-13T01:49:38.568000+00:00" }, { "DBProxyName": "proxyExample2", "DBProxyArn": "arn:aws:rds:us-east-1:123456789012:db-proxy:prx-1234a12b23456c1ab", "Status": "available", "EngineFamily": "PostgreSQL", "VpcId": "sg-1234567", "VpcSecurityGroupIds": [ "sg-1234" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Auth": "[ { "Description": "proxydescription2" "AuthScheme": "SECRETS", "SecretArn": "aarn:aws:secretsmanager:us-west-2:123456789123:secret:secretName-1234f", "IAMAuth": "DISABLED" } ]", "RoleArn": "arn:aws:iam::12345678912:role/ProxyPostgreSQLRole", "Endpoint": "proxyExample2.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "RequireTLS": false, "IdleClientTimeout": 1800, "DebuggingLogging": false, "CreatedDate": "2022-01-05T16:19:33.452000+00:00", "UpdatedDate": "2023-04-13T01:49:38.568000+00:00" } ] }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの表示」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの表示」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbProxies
」を参照してください。
-
次の例は、describe-db-proxy-endpoints を使用する方法を説明しています。
- AWS CLI
-
DB プロキシエンドポイントを記述するには
次の
describe-db-proxy-endpointsの例では、DB プロキシエンドポイントに関する情報を返します。aws rds describe-db-proxy-endpoints出力:
{ "DBProxyEndpoints": [ { "DBProxyEndpointName": "proxyEndpoint1", "DBProxyEndpointArn": "arn:aws:rds:us-east-1:123456789012:db-proxy-endpoint:prx-endpoint-0123a01b12345c0ab", "DBProxyName": "proxyExample", "Status": "available", "VpcId": "vpc-1234567", "VpcSecurityGroupIds": [ "sg-1234" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Endpoint": "proxyEndpoint1.endpoint.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "TargetRole": "READ_WRITE", "IsDefault": false }, { "DBProxyEndpointName": "proxyEndpoint2", "DBProxyEndpointArn": "arn:aws:rds:us-east-1:123456789012:db-proxy-endpoint:prx-endpoint-4567a01b12345c0ab", "DBProxyName": "proxyExample2", "Status": "available", "VpcId": "vpc1234567", "VpcSecurityGroupIds": [ "sg-5678" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Endpoint": "proxyEndpoint2.endpoint.proxy-cd1ef2klmnop.us-east-1.rds.amazonaws.com", "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "TargetRole": "READ_WRITE", "IsDefault": false } ] }詳細については、「Amazon RDS ユーザーガイド」の「プロキシエンドポイントの表示」および「Amazon Aurora ユーザーガイド」の「プロキシエンドポイントの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbProxyEndpoints
」を参照してください。
-
次の例は、describe-db-proxy-target-groups を使用する方法を説明しています。
- AWS CLI
-
DB プロキシエンドポイントを記述するには
次の
describe-db-proxy-target-groupsの例では、DB プロキシターゲットグループに関する情報を取得します。aws rds describe-db-proxy-target-groups \ --db-proxy-nameproxyExample出力:
{ "TargetGroups": { "DBProxyName": "proxyExample", "TargetGroupName": "default", "TargetGroupArn": "arn:aws:rds:us-east-1:123456789012:target-group:prx-tg-0123a01b12345c0ab", "IsDefault": true, "Status": "available", "ConnectionPoolConfig": { "MaxConnectionsPercent": 100, "MaxIdleConnectionsPercent": 50, "ConnectionBorrowTimeout": 120, "SessionPinningFilters": [] }, "CreatedDate": "2023-05-02T18:41:19.495000+00:00", "UpdatedDate": "2023-05-02T18:41:21.762000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの表示」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの表示」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbProxyTargetGroups
」を参照してください。
-
次の例は、describe-db-proxy-targets を使用する方法を説明しています。
- AWS CLI
-
DB プロキシターゲットを記述するには
次の
describe-db-proxy-targetsの例では、DB プロキシターゲットに関する情報を返します。aws rds describe-db-proxy-targets \ --db-proxy-nameproxyExample出力:
{ "Targets": [ { "Endpoint": "database1.ab0cd1efghij.us-east-1.rds.amazonaws.com", "TrackedClusterId": "database1", "RdsResourceId": "database1-instance-1", "Port": 3306, "Type": "RDS_INSTANCE", "Role": "READ_WRITE", "TargetHealth": { "State": "UNAVAILABLE", "Reason": "PENDING_PROXY_CAPACITY", "Description": "DBProxy Target is waiting for proxy to scale to desired capacity" } } ] }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの表示」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの表示」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbProxyTargets
」を参照してください。
-
次の例は、describe-db-recommendations を使用する方法を説明しています。
- AWS CLI
-
例 1: すべての DB レコメンデーションを一覧表示するには
次の の
describe-db-recommendations例では、 AWS アカウント内のすべての DB レコメンデーションを一覧表示します。aws rds describe-db-recommendations出力:
{ "DBRecommendations": [ { "RecommendationId": "12ab3cde-f456-7g8h-9012-i3j45678k9lm", "TypeId": "config_recommendation::old_minor_version", "Severity": "informational", "ResourceArn": "arn:aws:rds:us-west-2:111122223333:db:database-1", "Status": "active", "CreatedTime": "2024-02-21T23:14:19.292000+00:00", "UpdatedTime": "2024-02-21T23:14:19+00:00", "Detection": "**[resource-name]** is not running the latest minor DB engine version", "Recommendation": "Upgrade to latest engine version", "Description": "Your database resources aren't running the latest minor DB engine version. The latest minor version contains the latest security fixes and other improvements.", "RecommendedActions": [ { "ActionId": "12ab34c5de6fg7h89i0jk1lm234n5678", "Operation": "modifyDbInstance", "Parameters": [ { "Key": "EngineVersion", "Value": "5.7.44" }, { "Key": "DBInstanceIdentifier", "Value": "database-1" } ], "ApplyModes": [ "immediately", "next-maintenance-window" ], "Status": "ready", "ContextAttributes": [ { "Key": "Recommended value", "Value": "5.7.44" }, { "Key": "Current engine version", "Value": "5.7.42" } ] } ], "Category": "security", "Source": "RDS", "TypeDetection": "**[resource-count] resources** are not running the latest minor DB engine version", "TypeRecommendation": "Upgrade to latest engine version", "Impact": "Reduced database performance and data security at risk", "AdditionalInfo": "We recommend that you maintain your database with the latest DB engine minor version as this version includes the latest security and functionality fixes. The DB engine minor version upgrades contain only the changes which are backward-compatible with earlier minor versions of the same major version of the DB engine.", "Links": [ { "Text": "Upgrading an RDS DB instance engine version", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Upgrading.html" }, { "Text": "Using Amazon RDS Blue/Green Deployments for database updates for Amazon Aurora", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html" }, { "Text": "Using Amazon RDS Blue/Green Deployments for database updates for Amazon RDS", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html" } ] } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」および「Amazon Aurora ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」を参照してください。
例 2: 重要度の高い DB レコメンデーションを一覧表示するには
次の の
describe-db-recommendations例では、 AWS アカウントの重要度の高い DB レコメンデーションを一覧表示します。aws rds describe-db-recommendations \ --filtersName=severity,Values=high出力:
{ "DBRecommendations": [ { "RecommendationId": "12ab3cde-f456-7g8h-9012-i3j45678k9lm", "TypeId": "config_recommendation::rds_extended_support", "Severity": "high", "ResourceArn": "arn:aws:rds:us-west-2:111122223333:db:database-1", "Status": "active", "CreatedTime": "2024-02-21T23:14:19.392000+00:00", "UpdatedTime": "2024-02-21T23:14:19+00:00", "Detection": "Your databases will be auto-enrolled to RDS Extended Support on February 29", "Recommendation": "Upgrade your major version before February 29, 2024 to avoid additional charges", "Description": "Your PostgreSQL 11 and MySQL 5.7 databases will be automatically enrolled into RDS Extended Support on February 29, 2024. To avoid the increase in charges due to RDS Extended Support, we recommend upgrading your databases to a newer major engine version before February 29, 2024.\nTo learn more about the RDS Extended Support pricing, refer to the pricing page.", "RecommendedActions": [ { "ActionId": "12ab34c5de6fg7h89i0jk1lm234n5678", "Parameters": [], "ApplyModes": [ "manual" ], "Status": "ready", "ContextAttributes": [] } ], "Category": "cost optimization", "Source": "RDS", "TypeDetection": "Your database will be auto-enrolled to RDS Extended Support on February 29", "TypeRecommendation": "Upgrade your major version before February 29, 2024 to avoid additional charges", "Impact": "Increase in charges due to RDS Extended Support", "AdditionalInfo": "With Amazon RDS Extended Support, you can continue running your database on a major engine version past the RDS end of standard support date for an additional cost. This paid feature gives you more time to upgrade to a supported major engine version.\nDuring Extended Support, Amazon RDS will supply critical CVE patches and bug fixes.", "Links": [ { "Text": "Amazon RDS Extended Support pricing for RDS for MySQL", "Url": "https://aws.amazon.com/rds/mysql/pricing/" }, { "Text": "Amazon RDS Extended Support for RDS for MySQL and PostgreSQL databases", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html" }, { "Text": "Amazon RDS Extended Support pricing for Amazon Aurora PostgreSQL", "Url": "https://aws.amazon.com/rds/aurora/pricing/" }, { "Text": "Amazon RDS Extended Support for Aurora PostgreSQL databases", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/extended-support.html" }, { "Text": "Amazon RDS Extended Support pricing for RDS for PostgreSQL", "Url": "https://aws.amazon.com/rds/postgresql/pricing/" } ] } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」および「Amazon Aurora ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」を参照してください。
例 3: 指定された DB インスタンスの DB レコメンデーションを一覧表示するには
次の
describe-db-recommendationsの例では、指定された DB インスタンスのすべての DB レコメンデーションを一覧表示します。aws rds describe-db-recommendations \ --filtersName=dbi-resource-id,Values=database-1出力:
{ "DBRecommendations": [ { "RecommendationId": "12ab3cde-f456-7g8h-9012-i3j45678k9lm", "TypeId": "config_recommendation::old_minor_version", "Severity": "informational", "ResourceArn": "arn:aws:rds:us-west-2:111122223333:db:database-1", "Status": "active", "CreatedTime": "2024-02-21T23:14:19.292000+00:00", "UpdatedTime": "2024-02-21T23:14:19+00:00", "Detection": "**[resource-name]** is not running the latest minor DB engine version", "Recommendation": "Upgrade to latest engine version", "Description": "Your database resources aren't running the latest minor DB engine version. The latest minor version contains the latest security fixes and other improvements.", "RecommendedActions": [ { "ActionId": "12ab34c5de6fg7h89i0jk1lm234n5678", "Operation": "modifyDbInstance", "Parameters": [ { "Key": "EngineVersion", "Value": "5.7.44" }, { "Key": "DBInstanceIdentifier", "Value": "database-1" } ], "ApplyModes": [ "immediately", "next-maintenance-window" ], "Status": "ready", "ContextAttributes": [ { "Key": "Recommended value", "Value": "5.7.44" }, { "Key": "Current engine version", "Value": "5.7.42" } ] } ], "Category": "security", "Source": "RDS", "TypeDetection": "**[resource-count] resources** are not running the latest minor DB engine version", "TypeRecommendation": "Upgrade to latest engine version", "Impact": "Reduced database performance and data security at risk", "AdditionalInfo": "We recommend that you maintain your database with the latest DB engine minor version as this version includes the latest security and functionality fixes. The DB engine minor version upgrades contain only the changes which are backward-compatible with earlier minor versions of the same major version of the DB engine.", "Links": [ { "Text": "Upgrading an RDS DB instance engine version", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Upgrading.html" }, { "Text": "Using Amazon RDS Blue/Green Deployments for database updates for Amazon Aurora", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html" }, { "Text": "Using Amazon RDS Blue/Green Deployments for database updates for Amazon RDS", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html" } ] } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」および「Amazon Aurora ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」を参照してください。
例 4: アクティブな DB レコメンデーションをすべて一覧表示するには
次の の
describe-db-recommendations例では、 AWS アカウント内のすべてのアクティブな DB レコメンデーションを一覧表示します。aws rds describe-db-recommendations \ --filtersName=status,Values=active出力:
{ "DBRecommendations": [ { "RecommendationId": "12ab3cde-f456-7g8h-9012-i3j45678k9lm", "TypeId": "config_recommendation::old_minor_version", "Severity": "informational", "ResourceArn": "arn:aws:rds:us-west-2:111122223333:db:database-1", "Status": "active", "CreatedTime": "2024-02-21T23:14:19.292000+00:00", "UpdatedTime": "2024-02-21T23:14:19+00:00", "Detection": "**[resource-name]** is not running the latest minor DB engine version", "Recommendation": "Upgrade to latest engine version", "Description": "Your database resources aren't running the latest minor DB engine version. The latest minor version contains the latest security fixes and other improvements.", "RecommendedActions": [ { "ActionId": "12ab34c5de6fg7h89i0jk1lm234n5678", "Operation": "modifyDbInstance", "Parameters": [ { "Key": "EngineVersion", "Value": "5.7.44" }, { "Key": "DBInstanceIdentifier", "Value": "database-1" } ], "ApplyModes": [ "immediately", "next-maintenance-window" ], "Status": "ready", "ContextAttributes": [ { "Key": "Recommended value", "Value": "5.7.44" }, { "Key": "Current engine version", "Value": "5.7.42" } ] } ], "Category": "security", "Source": "RDS", "TypeDetection": "**[resource-count] resources** are not running the latest minor DB engine version", "TypeRecommendation": "Upgrade to latest engine version", "Impact": "Reduced database performance and data security at risk", "AdditionalInfo": "We recommend that you maintain your database with the latest DB engine minor version as this version includes the latest security and functionality fixes. The DB engine minor version upgrades contain only the changes which are backward-compatible with earlier minor versions of the same major version of the DB engine.", "Links": [ { "Text": "Upgrading an RDS DB instance engine version", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Upgrading.html" }, { "Text": "Using Amazon RDS Blue/Green Deployments for database updates for Amazon Aurora", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html" }, { "Text": "Using Amazon RDS Blue/Green Deployments for database updates for Amazon RDS", "Url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html" } ] } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」および「Amazon Aurora ユーザーガイド」の「Amazon RDS 推奨事項の表示と対応」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbRecommendations
」を参照してください。
-
次の例は、describe-db-security-groups を使用する方法を説明しています。
- AWS CLI
-
DB セキュリティグループを一覧表示するには
次の
describe-db-security-groupsの例では、DB セキュリティグループを一覧表示します。aws rds describe-db-security-groups出力:
{ "DBSecurityGroups": [ { "OwnerId": "123456789012", "DBSecurityGroupName": "default", "DBSecurityGroupDescription": "default", "EC2SecurityGroups": [], "IPRanges": [], "DBSecurityGroupArn": "arn:aws:rds:us-west-1:111122223333:secgrp:default" }, { "OwnerId": "123456789012", "DBSecurityGroupName": "mysecgroup", "DBSecurityGroupDescription": "My Test Security Group", "VpcId": "vpc-1234567f", "EC2SecurityGroups": [], "IPRanges": [], "DBSecurityGroupArn": "arn:aws:rds:us-west-1:111122223333:secgrp:mysecgroup" } ] }詳細については、「Amazon RDS ユーザーガイド」の「利用可能な DB セキュリティグループを一覧表示する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbSecurityGroups
」を参照してください。
-
次の例は、describe-db-shard-groups を使用する方法を説明しています。
- AWS CLI
-
例 1: DB シャードグループを記述するには
次の
describe-db-shard-groupsの例では、DB シャードグループに関する詳細を取得します。aws rds describe-db-shard-groups出力:
{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-7bb446329da94788b3f957746example", "DBShardGroupIdentifier": "limitless-test-shard-grp", "DBClusterIdentifier": "limitless-test-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": true, "Endpoint": "limitless-test-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" }, { "DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890", "DBShardGroupIdentifier": "my-db-shard-group", "DBClusterIdentifier": "my-sv2-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": false, "Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスター」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbShardGroups
」を参照してください。
-
次の例は、describe-db-snapshot-attributes を使用する方法を説明しています。
- AWS CLI
-
DB スナップショットの属性名と値を記述するには
次の
describe-db-snapshot-attributesの例では、DB スナップショットの属性名と値について説明します。aws rds describe-db-snapshot-attributes \ --db-snapshot-identifiermydbsnapshot出力:
{ "DBSnapshotAttributesResult": { "DBSnapshotIdentifier": "mydbsnapshot", "DBSnapshotAttributes": [ { "AttributeName": "restore", "AttributeValues": [ "123456789012", "210987654321" ] } ] } }詳細については、「Amazon RDS ユーザーガイド」の「DB スナップショットの共有」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbSnapshotAttributes
」を参照してください。
-
次の例は、describe-db-snapshots を使用する方法を説明しています。
- AWS CLI
-
例 1: DB インスタンスの DB スナップショットを記述するには
次の
describe-db-snapshotsの例は、DB インスタンスの DB スナップショットの詳細を取得します。aws rds describe-db-snapshots \ --db-snapshot-identifiermydbsnapshot出力:
{ "DBSnapshots": [ { "DBSnapshotIdentifier": "mydbsnapshot", "DBInstanceIdentifier": "mysqldb", "SnapshotCreateTime": "2018-02-08T22:28:08.598Z", "Engine": "mysql", "AllocatedStorage": 20, "Status": "available", "Port": 3306, "AvailabilityZone": "us-east-1f", "VpcId": "vpc-6594f31c", "InstanceCreateTime": "2018-02-08T22:24:55.973Z", "MasterUsername": "mysqladmin", "EngineVersion": "5.6.37", "LicenseModel": "general-public-license", "SnapshotType": "manual", "OptionGroupName": "default:mysql-5-6", "PercentProgress": 100, "StorageType": "gp2", "Encrypted": false, "DBSnapshotArn": "arn:aws:rds:us-east-1:123456789012:snapshot:mydbsnapshot", "IAMDatabaseAuthenticationEnabled": false, "ProcessorFeatures": [], "DbiResourceId": "db-AKIAIOSFODNN7EXAMPLE" } ] }詳細については、「Amazon RDS ユーザーガイド」の「DB スナップショットの作成」を参照してください。
例 2: 手動で作成されたスナップショットの数を調べるには
次の
describe-db-snapshots例では、--queryオプションのlength演算子を使用して、特定の AWS リージョンで作成された手動スナップショットの数を返します。aws rds describe-db-snapshots \ --snapshot-typemanual\ --query"length(*[].{DBSnapshots:SnapshotType})"\ --regioneu-central-1出力:
35詳細については、「Amazon RDS ユーザーガイド」の「DB スナップショットの作成」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンスの「DescribeDBSnapshots
」を参照してください。
-
次の例は、describe-db-subnet-groups を使用する方法を説明しています。
- AWS CLI
-
DB サブネットグループを記述するには
次の
describe-db-subnet-groupsの例では、指定された DB サブネットグループに関する詳細を取得します。aws rds describe-db-subnet-groups出力:
{ "DBSubnetGroups": [ { "DBSubnetGroupName": "mydbsubnetgroup", "DBSubnetGroupDescription": "My DB Subnet Group", "VpcId": "vpc-971c12ee", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-d8c8e7f4", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-718fdc7d", "SubnetAvailabilityZone": { "Name": "us-east-1f" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-cbc8e7e7", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-0ccde220", "SubnetAvailabilityZone": { "Name": "us-east-1a" }, "SubnetStatus": "Active" } ], "DBSubnetGroupArn": "arn:aws:rds:us-east-1:123456789012:subgrp:mydbsubnetgroup" } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon Virtual Private Cloud VPC および Amazon RDSAmazon Aurora」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDbSubnetGroups
」を参照してください。
-
次の例は、describe-engine-default-cluster-parameters を使用する方法を説明しています。
- AWS CLI
-
Aurora データベースエンジンのデフォルトのエンジンおよびシステムパラメータ情報を記述するには
次の
describe-engine-default-cluster-parametersの例では、MySQL 5.7 互換の Aurora DB クラスターのデフォルトのエンジンおよびシステムパラメータ情報の詳細を取得します。aws rds describe-engine-default-cluster-parameters \ --db-parameter-group-familyaurora-mysql5.7出力:
{ "EngineDefaults": { "Parameters": [ { "ParameterName": "aurora_load_from_s3_role", "Description": "IAM role ARN used to load data from AWS S3", "Source": "engine-default", "ApplyType": "dynamic", "DataType": "string", "IsModifiable": true, "SupportedEngineModes": [ "provisioned" ] }, ...some output truncated... ] } }詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEngineDefaultClusterParameters
」を参照してください。
-
次の例は、describe-engine-default-parameters を使用する方法を説明しています。
- AWS CLI
-
データベースエンジンのデフォルトのエンジンおよびシステムパラメータ情報を記述するには
次の
describe-engine-default-parametersの例では、MySQL 5.7 DB インスタンスのデフォルトのエンジンおよびシステムパラメータ情報の詳細を取得します。aws rds describe-engine-default-parameters \ --db-parameter-group-familymysql5.7出力:
{ "EngineDefaults": { "Parameters": [ { "ParameterName": "allow-suspicious-udfs", "Description": "Controls whether user-defined functions that have only an xxx symbol for the main function can be loaded", "Source": "engine-default", "ApplyType": "static", "DataType": "boolean", "AllowedValues": "0,1", "IsModifiable": false }, ...some output truncated... ] } }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeDefaultParameters
」を参照してください。
-
次の例は、describe-event-categories を使用する方法を説明しています。
- AWS CLI
-
イベントカテゴリについて表示するには
次の
describe-event-categoriesの例では、使用可能なすべてのイベントソースのイベントカテゴリの詳細を取得します。aws rds describe-event-categories出力:
{ "EventCategoriesMapList": [ { "SourceType": "db-instance", "EventCategories": [ "deletion", "read replica", "failover", "restoration", "maintenance", "low storage", "configuration change", "backup", "creation", "availability", "recovery", "failure", "backtrack", "notification" ] }, { "SourceType": "db-security-group", "EventCategories": [ "configuration change", "failure" ] }, { "SourceType": "db-parameter-group", "EventCategories": [ "configuration change" ] }, { "SourceType": "db-snapshot", "EventCategories": [ "deletion", "creation", "restoration", "notification" ] }, { "SourceType": "db-cluster", "EventCategories": [ "failover", "failure", "notification" ] }, { "SourceType": "db-cluster-snapshot", "EventCategories": [ "backup" ] } ] }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEventCategories
」を参照してください。
-
次の例は、describe-event-subscriptions を使用する方法を説明しています。
- AWS CLI
-
イベントサブスクリプションを記述するには
この例では、現在の AWS アカウントのすべての Amazon RDS イベントサブスクリプションについて説明します。
aws rds describe-event-subscriptions出力:
{ "EventSubscriptionsList": [ { "EventCategoriesList": [ "backup", "recovery" ], "Enabled": true, "EventSubscriptionArn": "arn:aws:rds:us-east-1:123456789012:es:my-instance-events", "Status": "creating", "SourceType": "db-instance", "CustomerAwsId": "123456789012", "SubscriptionCreationTime": "2018-07-31 23:22:01.893", "CustSubscriptionId": "my-instance-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:interesting-events" }, ...some output truncated... ] }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEventSubscriptions
」を参照してください。
-
次の例は、describe-events を使用する方法を説明しています。
- AWS CLI
-
イベントを記述するには
次の
describe-eventsの例では、指定した DB インスタンスで発生したイベントの詳細を取得します。aws rds describe-events \ --source-identifiertest-instance\ --source-typedb-instance出力:
{ "Events": [ { "SourceType": "db-instance", "SourceIdentifier": "test-instance", "EventCategories": [ "backup" ], "Message": "Backing up DB instance", "Date": "2018-07-31T23:09:23.983Z", "SourceArn": "arn:aws:rds:us-east-1:123456789012:db:test-instance" }, { "SourceType": "db-instance", "SourceIdentifier": "test-instance", "EventCategories": [ "backup" ], "Message": "Finished DB Instance backup", "Date": "2018-07-31T23:15:13.049Z", "SourceArn": "arn:aws:rds:us-east-1:123456789012:db:test-instance" } ] }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeEvents
」を参照してください。
-
次の例は、describe-export-tasks を使用する方法を説明しています。
- AWS CLI
-
スナップショットエクスポートタスクを記述するには
次の
describe-export-tasksの例では、Amazon S3 へのスナップショットのエクスポートに関する情報を返します。aws rds describe-export-tasks出力:
{ "ExportTasks": [ { "ExportTaskIdentifier": "test-snapshot-export", "SourceArn": "arn:aws:rds:us-west-2:123456789012:snapshot:test-snapshot", "SnapshotTime": "2020-03-02T18:26:28.163Z", "TaskStartTime": "2020-03-02T18:57:56.896Z", "TaskEndTime": "2020-03-02T19:10:31.985Z", "S3Bucket": "amzn-s3-demo-bucket", "S3Prefix": "", "IamRoleArn": "arn:aws:iam::123456789012:role/service-role/ExportRole", "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/abcd0000-7fca-4128-82f2-aabbccddeeff", "Status": "COMPLETE", "PercentProgress": 100, "TotalExtractedDataInGB": 0 }, { "ExportTaskIdentifier": "my-s3-export", "SourceArn": "arn:aws:rds:us-west-2:123456789012:snapshot:db5-snapshot-test", "SnapshotTime": "2020-03-27T20:48:42.023Z", "S3Bucket": "amzn-s3-demo-bucket", "S3Prefix": "", "IamRoleArn": "arn:aws:iam::123456789012:role/service-role/ExportRole", "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/abcd0000-7fca-4128-82f2-aabbccddeeff", "Status": "STARTING", "PercentProgress": 0, "TotalExtractedDataInGB": 0 } ] }詳細については、「Amazon RDS ユーザーガイド」の「スナップショットのエクスポートのモニタリング」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeExportTasks
」を参照してください。
-
次の例は、describe-global-clusters を使用する方法を説明しています。
- AWS CLI
-
グローバル DB クラスターを記述するには
次の の
describe-global-clusters例では、現在の AWS リージョンの Aurora グローバル DB クラスターを一覧表示します。aws rds describe-global-clusters出力:
{ "GlobalClusters": [ { "GlobalClusterIdentifier": "myglobalcluster", "GlobalClusterResourceId": "cluster-f5982077e3b5aabb", "GlobalClusterArn": "arn:aws:rds::123456789012:global-cluster:myglobalcluster", "Status": "available", "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.07.2", "StorageEncrypted": false, "DeletionProtection": false, "GlobalClusterMembers": [] } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora グローバルデータベースの管理」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeGlobalClusters
」を参照してください。
-
次の例は、describe-option-group-options を使用する方法を説明しています。
- AWS CLI
-
使用可能なすべてのオプションを記述するには
次の
describe-option-group-optionsの例では、Oracle Database 19c インスタンスの 2 つのオプションを一覧表示します。aws rds describe-option-group-options \ --engine-nameoracle-ee\ --major-engine-version19\ --max-items2出力:
{ "OptionGroupOptions": [ { "Name": "APEX", "Description": "Oracle Application Express Runtime Environment", "EngineName": "oracle-ee", "MajorEngineVersion": "19", "MinimumRequiredMinorEngineVersion": "0.0.0.ru-2019-07.rur-2019-07.r1", "PortRequired": false, "OptionsDependedOn": [], "OptionsConflictsWith": [], "Persistent": false, "Permanent": false, "RequiresAutoMinorEngineVersionUpgrade": false, "VpcOnly": false, "SupportsOptionVersionDowngrade": false, "OptionGroupOptionSettings": [], "OptionGroupOptionVersions": [ { "Version": "19.1.v1", "IsDefault": true }, { "Version": "19.2.v1", "IsDefault": false } ] }, { "Name": "APEX-DEV", "Description": "Oracle Application Express Development Environment", "EngineName": "oracle-ee", "MajorEngineVersion": "19", "MinimumRequiredMinorEngineVersion": "0.0.0.ru-2019-07.rur-2019-07.r1", "PortRequired": false, "OptionsDependedOn": [ "APEX" ], "OptionsConflictsWith": [], "Persistent": false, "Permanent": false, "RequiresAutoMinorEngineVersionUpgrade": false, "VpcOnly": false, "OptionGroupOptionSettings": [] } ], "NextToken": "eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ==" }詳細については、「Amazon RDS ユーザーガイド」の「オプショングループのオプションとそれらの設定を一覧表示する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeOptionGroupOptions
」を参照してください。
-
次の例は、describe-option-groups を使用する方法を説明しています。
- AWS CLI
-
使用可能なオプショングループの説明を表示するには
次の
describe-option-groupsの例では、Oracle Database 19c インスタンスのオプショングループを一覧表示します。aws rds describe-option-groups \ --engine-nameoracle-ee\ --major-engine-version19出力:
{ "OptionGroupsList": [ { "OptionGroupName": "default:oracle-ee-19", "OptionGroupDescription": "Default option group for oracle-ee 19", "EngineName": "oracle-ee", "MajorEngineVersion": "19", "Options": [], "AllowsVpcAndNonVpcInstanceMemberships": true, "OptionGroupArn": "arn:aws:rds:us-west-1:111122223333:og:default:oracle-ee-19" } ] }詳細については、「Amazon RDS ユーザーガイド」の「オプショングループのオプションとそれらの設定を一覧表示する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeOptionGroups
」を参照してください。
-
次の例は、describe-orderable-db-instance-options を使用する方法を説明しています。
- AWS CLI
-
順序設定可能な DB インスタンスオプションを記述するには
次の
describe-orderable-db-instance-optionsの例は、MySQL DB エンジンを実行する DB インスタンスの順序設定可能なオプションの詳細を取得します。aws rds describe-orderable-db-instance-options \ --enginemysql出力:
{ "OrderableDBInstanceOptions": [ { "MinStorageSize": 5, "ReadReplicaCapable": true, "MaxStorageSize": 6144, "AvailabilityZones": [ { "Name": "us-east-1a" }, { "Name": "us-east-1b" }, { "Name": "us-east-1c" }, { "Name": "us-east-1d" } ], "SupportsIops": false, "AvailableProcessorFeatures": [], "MultiAZCapable": true, "DBInstanceClass": "db.m1.large", "Vpc": true, "StorageType": "gp2", "LicenseModel": "general-public-license", "EngineVersion": "5.5.46", "SupportsStorageEncryption": false, "SupportsEnhancedMonitoring": true, "Engine": "mysql", "SupportsIAMDatabaseAuthentication": false, "SupportsPerformanceInsights": false } ] ...some output truncated... }-
API の詳細については、AWS CLI コマンドリファレンスの「DescribeOrderableDBInstanceOptions
」を参照してください。
-
次の例は、describe-pending-maintenance-actions を使用する方法を説明しています。
- AWS CLI
-
少なくとも 1 つの保留中のメンテナンスアクションを持つリソースを一覧表示するには
次の
describe-pending-maintenance-actionsの例では、DB インスタンスの保留中のメンテナンスアクションを一覧表示します。aws rds describe-pending-maintenance-actions出力:
{ "PendingMaintenanceActions": [ { "ResourceIdentifier": "arn:aws:rds:us-west-2:123456789012:cluster:global-db1-cl1", "PendingMaintenanceActionDetails": [ { "Action": "system-update", "Description": "Upgrade to Aurora PostgreSQL 2.4.2" } ] } ] }詳細については、「Amazon RDS ユーザーガイド」の「DB インスタンスのメンテナンス」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribePendingMaintenanceActions
」を参照してください。
-
次の例は、describe-reserved-db-instances-offerings を使用する方法を説明しています。
- AWS CLI
-
リザーブド DB インスタンスの提供を記述するには
次の
describe-reserved-db-instances-offeringsの例では、oracleのリザーブド DB インスタンスオプションの詳細を取得します。aws rds describe-reserved-db-instances-offerings \ --product-descriptionoracle出力:
{ "ReservedDBInstancesOfferings": [ { "CurrencyCode": "USD", "UsagePrice": 0.0, "ProductDescription": "oracle-se2(li)", "ReservedDBInstancesOfferingId": "005bdee3-9ef4-4182-aa0c-58ef7cb6c2f8", "MultiAZ": true, "DBInstanceClass": "db.m4.xlarge", "OfferingType": "Partial Upfront", "RecurringCharges": [ { "RecurringChargeAmount": 0.594, "RecurringChargeFrequency": "Hourly" } ], "FixedPrice": 4089.0, "Duration": 31536000 }, ...some output truncated... }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeReservedDbInstancesOfferings
」を参照してください。
-
次の例は、describe-reserved-db-instances を使用する方法を説明しています。
- AWS CLI
-
リザーブド DB インスタンスを記述するには
次の の
describe-reserved-db-instances例では、現在の AWS アカウントのリザーブド DB インスタンスの詳細を取得します。aws rds describe-reserved-db-instances出力:
{ "ReservedDBInstances": [ { "ReservedDBInstanceId": "myreservedinstance", "ReservedDBInstancesOfferingId": "12ab34cd-59af-4b2c-a660-1abcdef23456", "DBInstanceClass": "db.t3.micro", "StartTime": "2020-06-01T13:44:21.436Z", "Duration": 31536000, "FixedPrice": 0.0, "UsagePrice": 0.0, "CurrencyCode": "USD", "DBInstanceCount": 1, "ProductDescription": "sqlserver-ex(li)", "OfferingType": "No Upfront", "MultiAZ": false, "State": "payment-pending", "RecurringCharges": [ { "RecurringChargeAmount": 0.014, "RecurringChargeFrequency": "Hourly" } ], "ReservedDBInstanceArn": "arn:aws:rds:us-west-2:123456789012:ri:myreservedinstance", "LeaseId": "a1b2c3d4-6b69-4a59-be89-5e11aa446666" } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS のリザーブド DB インスタンス」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeReservedDbInstances
」を参照してください。
-
次の例は、describe-source-regions を使用する方法を説明しています。
- AWS CLI
-
ソースリージョンを記述するには
次の の
describe-source-regions例では、すべてのソース AWS リージョンの詳細を取得します。また、自動バックアップは米国西部 (オレゴン) から送信先 AWS リージョンである米国東部 (バージニア北部) にのみレプリケートできることを示しています。aws rds describe-source-regions \ --regionus-east-1出力:
{ "SourceRegions": [ { "RegionName": "af-south-1", "Endpoint": "https://rds.af-south-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "ap-east-1", "Endpoint": "https://rds.ap-east-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "ap-northeast-1", "Endpoint": "https://rds.ap-northeast-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "ap-northeast-2", "Endpoint": "https://rds.ap-northeast-2.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "ap-northeast-3", "Endpoint": "https://rds.ap-northeast-3.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "ap-south-1", "Endpoint": "https://rds.ap-south-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "ap-southeast-1", "Endpoint": "https://rds.ap-southeast-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "ap-southeast-2", "Endpoint": "https://rds.ap-southeast-2.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "ap-southeast-3", "Endpoint": "https://rds.ap-southeast-3.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "ca-central-1", "Endpoint": "https://rds.ca-central-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "eu-north-1", "Endpoint": "https://rds.eu-north-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "eu-south-1", "Endpoint": "https://rds.eu-south-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "eu-west-1", "Endpoint": "https://rds.eu-west-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "eu-west-2", "Endpoint": "https://rds.eu-west-2.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "eu-west-3", "Endpoint": "https://rds.eu-west-3.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "me-central-1", "Endpoint": "https://rds.me-central-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "me-south-1", "Endpoint": "https://rds.me-south-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": false }, { "RegionName": "sa-east-1", "Endpoint": "https://rds.sa-east-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "us-east-2", "Endpoint": "https://rds.us-east-2.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "us-west-1", "Endpoint": "https://rds.us-west-1.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true }, { "RegionName": "us-west-2", "Endpoint": "https://rds.us-west-2.amazonaws.com", "Status": "available", "SupportsDBInstanceAutomatedBackupsReplication": true } ] }詳細については、「Amazon RDS ユーザーガイド」の「レプリケーションされたバックアップに関する情報の検索」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeSourceRegions
」を参照してください。
-
次の例は、describe-valid-db-instance-modifications を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスの有効な変更を記述するには
次の
describe-valid-db-instance-modificationsの例は、指定された DB インスタンスの有効な変更に関する詳細を取得します。aws rds describe-valid-db-instance-modifications \ --db-instance-identifiertest-instance出力:
{ "ValidDBInstanceModificationsMessage": { "ValidProcessorFeatures": [], "Storage": [ { "StorageSize": [ { "Step": 1, "To": 20, "From": 20 }, { "Step": 1, "To": 6144, "From": 22 } ], "ProvisionedIops": [ { "Step": 1, "To": 0, "From": 0 } ], "IopsToStorageRatio": [ { "To": 0.0, "From": 0.0 } ], "StorageType": "gp2" }, { "StorageSize": [ { "Step": 1, "To": 6144, "From": 100 } ], "ProvisionedIops": [ { "Step": 1, "To": 40000, "From": 1000 } ], "IopsToStorageRatio": [ { "To": 50.0, "From": 1.0 } ], "StorageType": "io1" }, { "StorageSize": [ { "Step": 1, "To": 20, "From": 20 }, { "Step": 1, "To": 3072, "From": 22 } ], "ProvisionedIops": [ { "Step": 1, "To": 0, "From": 0 } ], "IopsToStorageRatio": [ { "To": 0.0, "From": 0.0 } ], "StorageType": "magnetic" } ] } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「DescribeValidDbInstanceModifications
」を参照してください。
-
次の例は、download-db-log-file-portion を使用する方法を説明しています。
- AWS CLI
-
例 1: DB ログファイルの最新部分をダウンロードするには
次の
download-db-log-file-portionの例では、ログファイルの最新の部分のみをダウンロードし、tail.txtという名前のローカルファイルに保存します。aws rds download-db-log-file-portion \ --db-instance-identifiertest-instance\ --log-file-namelog.txt\ --outputtext>tail.txt保存されたファイルには空白行が含まれている場合があります。ダウンロード中にログファイルの各部分の最後に表示されます。
例 2: DB ログファイル全体をダウンロードするには
次の
download-db-log-file-portionの例では、--starting-token 0パラメータを使用してログファイル全体をダウンロードし、出力をfull.txtという名前のローカルファイルに保存します。aws rds download-db-log-file-portion \ --db-instance-identifiertest-instance\ --log-file-namelog.txt\ --starting-token0\ --outputtext>full.txt保存されたファイルには空白行が含まれている場合があります。ダウンロード中にログファイルの各部分の最後に表示されます。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「DownloadDbLogFilePortion
」を参照してください。
-
次の例は、generate-auth-token を使用する方法を説明しています。
- AWS CLI
-
認証トークンを生成するには
次の
generate-db-auth-tokenの例では、IAM データベース認証で使用する認証トークンを生成します。aws rds generate-db-auth-token \ --hostnameaurmysql-test.cdgmuqiadpid.us-west-2.rds.amazonaws.com\ --port3306\ --regionus-east-1\ --usernamejane_doe出力:
aurmysql-test.cdgmuqiadpid.us-west-2.rds.amazonaws.com:3306/?Action=connect&DBUser=jane_doe&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIESZCNJ3OEXAMPLE%2F20180731%2Fus-east-1%2Frds-db%2Faws4_request&X-Amz-Date=20180731T235209Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=5a8753ebEXAMPLEa2c724e5667797EXAMPLE9d6ec6e3f427191fa41aeEXAMPLE-
API の詳細については、「AWS CLI コマンドリファレンス」の「GenerateAuthToken
」を参照してください。
-
次の例は、generate-db-auth-token を使用する方法を説明しています。
- AWS CLI
-
IAM 認証トークンを生成するには
次の
generate-db-auth-tokenの例では、IAM 認証トークンを生成してデータベースに接続します。aws rds generate-db-auth-token \ --hostnamemydb.123456789012.us-east-1.rds.amazonaws.com\ --port3306\ --regionus-east-1\ --usernamedb_user出力:
mydb.123456789012.us-east-1.rds.amazonaws.com:3306/?Action=connect&DBUser=db_user&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIEXAMPLE%2Fus-east-1%2Frds-db%2Faws4_request&X-Amz-Date=20210123T011543Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=88987EXAMPLE1EXAMPLE2EXAMPLE3EXAMPLE4EXAMPLE5EXAMPLE6詳細については、「Amazon RDS ユーザーガイド」の「IAM 認証を使用した DB インスタンスへの接続」および「Amazon Aurora ユーザーガイド」の「IAM 認証を使用した DB クラスターへの接続」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「GenerateDbAuthToken
」を参照してください。
-
次の例は、list-tags-for-resource を使用する方法を説明しています。
- AWS CLI
-
Amazon RDS リソースのすべてのタグを一覧表示するには
次の
list-tags-for-resourceの例では、DB インスタンスのすべてのタグを一覧表示します。aws rds list-tags-for-resource \ --resource-namearn:aws:rds:us-east-1:123456789012:db:orcl1出力:
{ "TagList": [ { "Key": "Environment", "Value": "test" }, { "Key": "Name", "Value": "MyDatabase" } ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS リソースのタグ付け」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ListTagsForResource
」を参照してください。
-
次の例は、modify-certificates を使用する方法を説明しています。
- AWS CLI
-
新しい DB インスタンスのシステムデフォルト SSL/TLS 証明書を一時的に上書きするには
次の
modify-certificatesの例では、新しい DB インスタンスのシステムデフォルト SSL/TLS 証明書を一時的に上書きします。aws rds modify-certificates \ --certificate-identifierrds-ca-2019出力:
{ "Certificate": { "CertificateIdentifier": "rds-ca-2019", "CertificateType": "CA", "Thumbprint": "EXAMPLE123456789012", "ValidFrom": "2019-09-19T18:16:53Z", "ValidTill": "2024-08-22T17:08:50Z", "CertificateArn": "arn:aws:rds:us-east-1::cert:rds-ca-2019", "CustomerOverride": true, "CustomerOverrideValidTill": "2024-08-22T17:08:50Z" } }詳細については、「Amazon RDS ユーザーガイド」の「SSL/TLS 証明書のローテーション」および「Amazon Aurora ユーザーガイド」の「SSL/TLS 証明書のローテーション」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyCertificates
」を参照してください。
-
次の例は、modify-current-db-cluster-capacity を使用する方法を説明しています。
- AWS CLI
-
Aurora Serverless DB クラスターの容量を拡張するには
次の
modify-current-db-cluster-capacityの例では、Aurora Serverless DB クラスターの容量を 8 にスケーリングします。aws rds modify-current-db-cluster-capacity \ --db-cluster-identifiermydbcluster\ --capacity8出力:
{ "DBClusterIdentifier": "mydbcluster", "PendingCapacity": 8, "CurrentCapacity": 1, "SecondsBeforeTimeout": 300, "TimeoutAction": "ForceApplyCapacityChange" }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora Serverless v1 DB クラスターのキャパシティーを手動でスケーリングする」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyCurrentDbClusterCapacity
」を参照してください。
-
次の例は、modify-db-cluster-endpoint を使用する方法を説明しています。
- AWS CLI
-
カスタム DB クラスターエンドポイントを変更するには
次の
modify-db-cluster-endpointの例では、指定されたカスタム DB クラスターエンドポイントを変更します。aws rds modify-db-cluster-endpoint \ --db-cluster-endpoint-identifiermycustomendpoint\ --static-membersdbinstance1dbinstance2dbinstance3出力:
{ "DBClusterEndpointIdentifier": "mycustomendpoint", "DBClusterIdentifier": "mydbcluster", "DBClusterEndpointResourceIdentifier": "cluster-endpoint-ANPAJ4AE5446DAEXAMPLE", "Endpoint": "mycustomendpoint.cluster-custom-cnpexample.us-east-1.rds.amazonaws.com", "Status": "modifying", "EndpointType": "CUSTOM", "CustomEndpointType": "READER", "StaticMembers": [ "dbinstance1", "dbinstance2", "dbinstance3" ], "ExcludedMembers": [], "DBClusterEndpointArn": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:mycustomendpoint" }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora 接続管理」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbClusterEndpoint
」を参照してください。
-
次の例は、modify-db-cluster-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB クラスターパラメータグループのパラメータを変更するには
次の
modify-db-cluster-parameter-groupの例は、DB クラスターパラメータのパラメータの値を変更します。aws rds modify-db-cluster-parameter-group \ --db-cluster-parameter-group-namemydbclusterpg\ --parameters"ParameterName=server_audit_logging,ParameterValue=1,ApplyMethod=immediate"\"ParameterName=server_audit_logs_upload,ParameterValue=1,ApplyMethod=immediate"出力:
{ "DBClusterParameterGroupName": "mydbclusterpg" }詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbClusterParameterGroup
」を参照してください。
-
次の例は、modify-db-cluster-snapshot-attribute を使用する方法を説明しています。
- AWS CLI
-
DB クラスタースナップショット属性を変更するには
次の
modify-db-cluster-snapshot-attributeの例では、指定された DB クラスタースナップショット属性を変更します。aws rds modify-db-cluster-snapshot-attribute \ --db-cluster-snapshot-identifiermyclustersnapshot\ --attribute-namerestore\ --values-to-add123456789012出力:
{ "DBClusterSnapshotAttributesResult": { "DBClusterSnapshotIdentifier": "myclustersnapshot", "DBClusterSnapshotAttributes": [ { "AttributeName": "restore", "AttributeValues": [ "123456789012" ] } ] } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスターのスナップショットからの復元」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbClusterSnapshotAttribute
」を参照してください。
-
次の例は、modify-db-cluster を使用する方法を説明しています。
- AWS CLI
-
例 1: DB クラスターを変更するには
次の
modify-db-clusterの例では、cluster-2という名前の DB クラスターのマスターユーザーパスワードを変更し、バックアップ保持期間を 14 日間に設定します。--apply-immediatelyパラメータを使用することで、次のメンテナンスウィンドウを待つことなく、すぐに変更することができます。aws rds modify-db-cluster \ --db-cluster-identifiercluster-2\ --backup-retention-period14\ --master-user-passwordnewpassword99\ --apply-immediately出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "eu-central-1b", "eu-central-1c", "eu-central-1a" ], "BackupRetentionPeriod": 14, "DatabaseName": "", "DBClusterIdentifier": "cluster-2", "DBClusterParameterGroup": "default.aurora5.6", "DBSubnetGroup": "default-vpc-2305ca49", "Status": "available", "EarliestRestorableTime": "2020-06-03T02:07:29.637Z", "Endpoint": "cluster-2.cluster-############.eu-central-1.rds.amazonaws.com", "ReaderEndpoint": "cluster-2.cluster-ro-############.eu-central-1.rds.amazonaws.com", "MultiAZ": false, "Engine": "aurora", "EngineVersion": "5.6.10a", "LatestRestorableTime": "2020-06-04T15:11:25.748Z", "Port": 3306, "MasterUsername": "admin", "PreferredBackupWindow": "01:55-02:25", "PreferredMaintenanceWindow": "thu:21:14-thu:21:44", "ReadReplicaIdentifiers": [], "DBClusterMembers": [ { "DBInstanceIdentifier": "cluster-2-instance-1", "IsClusterWriter": true, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 } ], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-20a5c047", "Status": "active" } ], "HostedZoneId": "Z1RLNU0EXAMPLE", "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:eu-central-1:123456789012:key/d1bd7c8f-5cdb-49ca-8a62-a1b2c3d4e5f6", "DbClusterResourceId": "cluster-AGJ7XI77XVIS6FUXHU1EXAMPLE", "DBClusterArn": "arn:aws:rds:eu-central-1:123456789012:cluster:cluster-2", "AssociatedRoles": [], "IAMDatabaseAuthenticationEnabled": false, "ClusterCreateTime": "2020-04-03T14:44:02.764Z", "EngineMode": "provisioned", "DeletionProtection": false, "HttpEndpointEnabled": false, "CopyTagsToSnapshot": true, "CrossAccountClone": false, "DomainMemberships": [] } }詳細については、Amazon Aurora ユーザーガイドの「Amazon Aurora DB クラスターの変更」を参照してください。
例 2: VPC セキュリティグループを DB クラスターと関連付けるには
次の
modify-db-instanceの例では、特定の VPC セキュリティグループを関連付け、DB クラスターから DB セキュリティグループを削除します。aws rds modify-db-cluster \ --db-cluster-identifierdbName\ --vpc-security-group-idssg-ID出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-west-2c", "us-west-2b", "us-west-2a" ], "BackupRetentionPeriod": 1, "DBClusterIdentifier": "dbName", "DBClusterParameterGroup": "default.aurora-mysql8.0", "DBSubnetGroup": "default", "Status": "available", "EarliestRestorableTime": "2024-02-15T01:12:13.966000+00:00", "Endpoint": "dbName.cluster-abcdefghji.us-west-2.rds.amazonaws.com", "ReaderEndpoint": "dbName.cluster-ro-abcdefghji.us-west-2.rds.amazonaws.com", "MultiAZ": false, "Engine": "aurora-mysql", "EngineVersion": "8.0.mysql_aurora.3.04.1", "LatestRestorableTime": "2024-02-15T02:25:33.696000+00:00", "Port": 3306, "MasterUsername": "admin", "PreferredBackupWindow": "10:59-11:29", "PreferredMaintenanceWindow": "thu:08:54-thu:09:24", "ReadReplicaIdentifiers": [], "DBClusterMembers": [ { "DBInstanceIdentifier": "dbName-instance-1", "IsClusterWriter": true, "DBClusterParameterGroupStatus": "in-sync", "PromotionTier": 1 } ], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-ID", "Status": "active" } ], ...output omitted... } }詳細については、「Amazon Aurora ユーザーガイド」の「セキュリティグループによるアクセス制御」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbCluster
」を参照してください。
-
次の例は、modify-db-instance を使用する方法を説明しています。
- AWS CLI
-
例 1: DB インスタンスを変更するには
次の
modify-db-instanceの例は、オプショングループとパラメータグループを互換性のある Microsoft SQL Server DB インスタンスに関連付けます。--apply-immediatelyパラメータを使用することで、次のメンテナンスウィンドウを待つことなく、オプショングループとパラメータグループをすぐに関連付けることができます。aws rds modify-db-instance \ --db-instance-identifierdatabase-2\ --option-group-nametest-se-2017\ --db-parameter-group-nametest-sqlserver-se-2017\ --apply-immediately出力:
{ "DBInstance": { "DBInstanceIdentifier": "database-2", "DBInstanceClass": "db.r4.large", "Engine": "sqlserver-se", "DBInstanceStatus": "available", ...output omitted... "DBParameterGroups": [ { "DBParameterGroupName": "test-sqlserver-se-2017", "ParameterApplyStatus": "applying" } ], "AvailabilityZone": "us-west-2d", ...output omitted... "MultiAZ": true, "EngineVersion": "14.00.3281.6.v1", "AutoMinorVersionUpgrade": false, "ReadReplicaDBInstanceIdentifiers": [], "LicenseModel": "license-included", "OptionGroupMemberships": [ { "OptionGroupName": "test-se-2017", "Status": "pending-apply" } ], "CharacterSetName": "SQL_Latin1_General_CP1_CI_AS", "SecondaryAvailabilityZone": "us-west-2c", "PubliclyAccessible": true, "StorageType": "gp2", ...output omitted... "DeletionProtection": false, "AssociatedRoles": [], "MaxAllocatedStorage": 1000 } }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS DB インスタンスを変更する」を参照してください。
例 2: VPC セキュリティグループを DB インスタンスと関連付けるには
次の
modify-db-instanceの例では、特定の VPC セキュリティグループを関連付け、DB インスタンスから DB セキュリティグループを削除します。aws rds modify-db-instance \ --db-instance-identifierdbName\ --vpc-security-group-idssg-ID出力:
{ "DBInstance": { "DBInstanceIdentifier": "dbName", "DBInstanceClass": "db.t3.micro", "Engine": "mysql", "DBInstanceStatus": "available", "MasterUsername": "admin", "Endpoint": { "Address": "dbName.abcdefghijk.us-west-2.rds.amazonaws.com", "Port": 3306, "HostedZoneId": "ABCDEFGHIJK1234" }, "AllocatedStorage": 20, "InstanceCreateTime": "2024-02-15T00:37:58.793000+00:00", "PreferredBackupWindow": "11:57-12:27", "BackupRetentionPeriod": 7, "DBSecurityGroups": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-ID", "Status": "active" } ], ... output omitted ... "MultiAZ": false, "EngineVersion": "8.0.35", "AutoMinorVersionUpgrade": true, "ReadReplicaDBInstanceIdentifiers": [], "LicenseModel": "general-public-license", ... output ommited ... } }詳細については、「Amazon RDS ユーザーガイド」の「セキュリティグループによるアクセス制御」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンスの「ModifyDBInstance
」を参照してください。
-
次の例は、modify-db-parameter-group を使用する方法を説明しています。
- AWS CLI
-
DB パラメータグループを変更するには
次の
modify-db-parameter-groupの例は、DB パラメータグループのclr enabledパラメータの値を変更します。--apply-immediatelyパラメータを使用することで、次のメンテナンスウィンドウを待つことなく、DB パラメータグループをすぐに変更することができます。aws rds modify-db-parameter-group \ --db-parameter-group-nametest-sqlserver-se-2017\ --parameters"ParameterName='clr enabled',ParameterValue=1,ApplyMethod=immediate"出力:
{ "DBParameterGroupName": "test-sqlserver-se-2017" }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループのパラメータの変更」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンス の「ModifyDBParameterGroup
」を参照してください。
-
次の例は、modify-db-proxy-endpoint を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシエンドポイントを変更するには
次の
modify-db-proxy-endpointの例では、DB プロキシエンドポイントproxyEndpointを変更して、読み取りタイムアウトを 65 秒に設定します。aws rds modify-db-proxy-endpoint \ --db-proxy-endpoint-nameproxyEndpoint\ --cli-read-timeout65出力:
{ "DBProxyEndpoint": { "DBProxyEndpointName": "proxyEndpoint", "DBProxyEndpointArn": "arn:aws:rds:us-east-1:123456789012:db-proxy-endpoint:prx-endpoint-0123a01b12345c0ab", "DBProxyName": "proxyExample", "Status": "available", "VpcId": "vpc-1234567", "VpcSecurityGroupIds": [ "sg-1234" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Endpoint": "proxyEndpoint.endpoint.proxyExample-ab0cd1efghij.us-east-1.rds.amazonaws.com", "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "TargetRole": "READ_WRITE", "IsDefault": "false" } }詳細については、「Amazon RDS ユーザーガイド」の「プロキシエンドポイントの変更」および「Amazon Aurora ユーザーガイド」の「プロキシエンドポイントの変更」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbProxyEndpoint
」を参照してください。
-
次の例は、modify-db-proxy-target-group を使用する方法を説明しています。
- AWS CLI
-
DB プロキシエンドポイントを変更するには
次の
modify-db-proxy-target-groupの例では、DB プロキシターゲットグループを変更して、最大接続数を 80%、最大アイドル接続数を 10% に設定します。aws rds modify-db-proxy-target-group \ --target-group-namedefault\ --db-proxy-nameproxyExample\ --connection-pool-configMaxConnectionsPercent=80,MaxIdleConnectionsPercent=10出力:
{ "DBProxyTargetGroup": { "DBProxyName": "proxyExample", "TargetGroupName": "default", "TargetGroupArn": "arn:aws:rds:us-east-1:123456789012:target-group:prx-tg-0123a01b12345c0ab", "IsDefault": true, "Status": "available", "ConnectionPoolConfig": { "MaxConnectionsPercent": 80, "MaxIdleConnectionsPercent": 10, "ConnectionBorrowTimeout": 120, "SessionPinningFilters": [] }, "CreatedDate": "2023-05-02T18:41:19.495000+00:00", "UpdatedDate": "2023-05-02T18:41:21.762000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの変更」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの変更」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbProxyTargetGroup
」を参照してください。
-
次の例は、modify-db-proxy を使用する方法を説明しています。
- AWS CLI
-
RDS データベースの DB プロキシを変更するには
次の
modify-db-proxyの例では、proxyExampleという名前の DB プロキシを変更して、接続に SSL を要求するようにしています。aws rds modify-db-proxy \ --db-proxy-nameproxyExample\ --require-tls出力:
{ "DBProxy": { "DBProxyName": "proxyExample", "DBProxyArn": "arn:aws:rds:us-east-1:123456789012:db-proxy:prx-0123a01b12345c0ab", "Status": "modifying" "EngineFamily": "PostgreSQL", "VpcId": "sg-1234567", "VpcSecurityGroupIds": [ "sg-1234" ], "VpcSubnetIds": [ "subnetgroup1", "subnetgroup2" ], "Auth": "[ { "Description": "proxydescription1", "AuthScheme": "SECRETS", "SecretArn": "arn:aws:secretsmanager:us-west-2:123456789123:secret:proxysecret1-Abcd1e", "IAMAuth": "DISABLED" } ]", "RoleArn": "arn:aws:iam::12345678912:role/ProxyPostgreSQLRole", "Endpoint": "proxyExample.proxy-ab0cd1efghij.us-east-1.rds.amazonaws.com", "RequireTLS": true, "IdleClientTimeout": 1800, "DebuggingLogging": false, "CreatedDate": "2023-04-05T16:09:33.452000+00:00", "UpdatedDate": "2023-04-13T01:49:38.568000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの変更」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbProxy
」を参照してください。
-
次の例は、modify-db-shard-group を使用する方法を説明しています。
- AWS CLI
-
例 1: DB シャードグループを変更するには
次の
modify-db-shard-groupの例では、DB シャードグループの最大容量を変更します。aws rds modify-db-shard-group \ --db-shard-group-identifiermy-db-shard-group\ --max-acu1000出力:
{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890", "DBShardGroupIdentifier": "my-db-shard-group", "DBClusterIdentifier": "my-sv2-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": false, "Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスター」を参照してください。
例 2: DB シャードグループを記述するには
次の
describe-db-shard-groupsの例では、modify-db-shard-groupコマンドの実行後に DB シャードグループの詳細を取得します。DB シャードグループmy-db-shard-groupの最大容量は、1000 Aurora キャパシティーユニット (ACU) になりました。aws rds describe-db-shard-groups出力:
{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-7bb446329da94788b3f957746example", "DBShardGroupIdentifier": "limitless-test-shard-grp", "DBClusterIdentifier": "limitless-test-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": true, "Endpoint": "limitless-test-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" }, { "DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890", "DBShardGroupIdentifier": "my-db-shard-group", "DBClusterIdentifier": "my-sv2-cluster", "MaxACU": 1000.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": false, "Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスター」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbShardGroup
」を参照してください。
-
次の例は、modify-db-snapshot-attribute を使用する方法を説明しています。
- AWS CLI
-
例 1: 2 つの AWS アカウントで DB スナップショットを復元できるようにするには
次の
modify-db-snapshot-attribute例では、識別子111122223333と を持つ 2 つの AWS アカウントに444455556666、 という名前の DB スナップショットを復元するアクセス許可を付与しますmydbsnapshot。aws rds modify-db-snapshot-attribute \ --db-snapshot-identifiermydbsnapshot\ --attribute-namerestore\ --values-to-add {"111122223333","444455556666"}出力:
{ "DBSnapshotAttributesResult": { "DBSnapshotIdentifier": "mydbsnapshot", "DBSnapshotAttributes": [ { "AttributeName": "restore", "AttributeValues": [ "111122223333", "444455556666" ] } ] } }詳細については、「Amazon RDS ユーザーガイド」の「スナップショットの共有」を参照してください。
例 2: AWS アカウントが DB スナップショットを復元できないようにするには
次の の
modify-db-snapshot-attribute例では、 という名前の DB スナップショットを復元するアクセス許可を特定の AWS アカウントから削除しますmydbsnapshot。単一のアカウントを指定する場合、アカウント識別子を引用符や中括弧で囲むことはできません。aws rds modify-db-snapshot-attribute \ --db-snapshot-identifiermydbsnapshot\ --attribute-namerestore\ --values-to-remove444455556666出力:
{ "DBSnapshotAttributesResult": { "DBSnapshotIdentifier": "mydbsnapshot", "DBSnapshotAttributes": [ { "AttributeName": "restore", "AttributeValues": [ "111122223333" ] } ] } }詳細については、「Amazon RDS ユーザーガイド」の「スナップショットの共有」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbSnapshotAttribute
」を参照してください。
-
次の例は、modify-db-snapshot-attributes を使用する方法を説明しています。
- AWS CLI
-
DB スナップショット属性を変更するには
次の
modify-db-snapshot-attribute例では、111122223333と の 2 つの AWS アカウント識別子を使用して444455556666、 という名前の DB スナップショットを復元できますmydbsnapshot。aws rds modify-db-snapshot-attribute \ --db-snapshot-identifiermydbsnapshot\ --attribute-namerestore\ --values-to-add '["111122223333","444455556666"]'出力:
{ "DBSnapshotAttributesResult": { "DBSnapshotIdentifier": "mydbsnapshot", "DBSnapshotAttributes": [ { "AttributeName": "restore", "AttributeValues": [ "111122223333", "444455556666" ] } ] } }詳細については、「Amazon RDS ユーザーガイド」の「スナップショットの共有」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbSnapshotAttributes
」を参照してください。
-
次の例は、modify-db-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB スナップショットを変更するには
次の
modify-db-snapshotの例では、db5-snapshot-upg-testという名前の PostgeSQL 10.6 スナップショットを PostgreSQL 11.7 にアップグレードします。新しい DB エンジンバージョンは、スナップショットのアップグレードが完了し、そのステータスが使用可能になった後に表示されます。aws rds modify-db-snapshot \ --db-snapshot-identifierdb5-snapshot-upg-test\ --engine-version11.7出力:
{ "DBSnapshot": { "DBSnapshotIdentifier": "db5-snapshot-upg-test", "DBInstanceIdentifier": "database-5", "SnapshotCreateTime": "2020-03-27T20:49:17.092Z", "Engine": "postgres", "AllocatedStorage": 20, "Status": "upgrading", "Port": 5432, "AvailabilityZone": "us-west-2a", "VpcId": "vpc-2ff27557", "InstanceCreateTime": "2020-03-27T19:59:04.735Z", "MasterUsername": "postgres", "EngineVersion": "10.6", "LicenseModel": "postgresql-license", "SnapshotType": "manual", "OptionGroupName": "default:postgres-11", "PercentProgress": 100, "StorageType": "gp2", "Encrypted": false, "DBSnapshotArn": "arn:aws:rds:us-west-2:123456789012:snapshot:db5-snapshot-upg-test", "IAMDatabaseAuthenticationEnabled": false, "ProcessorFeatures": [], "DbiResourceId": "db-GJMF75LM42IL6BTFRE4UZJ5YM4" } }詳細については、「Amazon RDS ユーザーガイド」の「PostgreSQL DB スナップショットをアップグレードする」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbSnapshot
」を参照してください。
-
次の例は、modify-db-subnet-group を使用する方法を説明しています。
- AWS CLI
-
DB サブネットグループを変更するには
次の
modify-db-subnet-groupの例では、mysubnetgroupという名前の DB サブネットグループに ID がsubnet-08e41f9e230222222のサブネットを追加します。既存のサブネットをサブネットグループに保持するには、--subnet-idsオプションに ID を値として含めます。DB サブネットグループに最低 2 つの異なるアベイラビリティーゾーンがあるサブネットであることを確認します。aws rds modify-db-subnet-group \ --db-subnet-group-namemysubnetgroup\ --subnet-ids '["subnet-0a1dc4e1a6f123456","subnet-070dd7ecb3aaaaaaa","subnet-00f5b198bc0abcdef","subnet-08e41f9e230222222"]'出力:
{ "DBSubnetGroup": { "DBSubnetGroupName": "mysubnetgroup", "DBSubnetGroupDescription": "test DB subnet group", "VpcId": "vpc-0f08e7610a1b2c3d4", "SubnetGroupStatus": "Complete", "Subnets": [ { "SubnetIdentifier": "subnet-08e41f9e230222222", "SubnetAvailabilityZone": { "Name": "us-west-2a" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-070dd7ecb3aaaaaaa", "SubnetAvailabilityZone": { "Name": "us-west-2b" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-00f5b198bc0abcdef", "SubnetAvailabilityZone": { "Name": "us-west-2d" }, "SubnetStatus": "Active" }, { "SubnetIdentifier": "subnet-0a1dc4e1a6f123456", "SubnetAvailabilityZone": { "Name": "us-west-2b" }, "SubnetStatus": "Active" } ], "DBSubnetGroupArn": "arn:aws:rds:us-west-2:534026745191:subgrp:mysubnetgroup" } }詳細については、「Amazon RDS ユーザーガイド」の「ステップ 3: DB サブネットグループの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyDbSubnetGroup
」を参照してください。
-
次の例は、modify-event-subscription を使用する方法を説明しています。
- AWS CLI
-
イベントサブスクリプションを変更するには
次の
modify-event-subscriptionの例では、指定されたイベントサブスクリプションを無効にするため、指定された Amazon Simple Notification Service トピックに通知を発行しなくなります。aws rds modify-event-subscription \ --subscription-namemy-instance-events\ --no-enabled出力:
{ "EventSubscription": { "EventCategoriesList": [ "backup", "recovery" ], "CustomerAwsId": "123456789012", "SourceType": "db-instance", "SubscriptionCreationTime": "Tue Jul 31 23:22:01 UTC 2018", "EventSubscriptionArn": "arn:aws:rds:us-east-1:123456789012:es:my-instance-events", "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:interesting-events", "CustSubscriptionId": "my-instance-events", "Status": "modifying", "Enabled": false } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyEventSubscription
」を参照してください。
-
次の例は、modify-global-cluster を使用する方法を説明しています。
- AWS CLI
-
グローバル DB クラスターを変更するには
次の
modify-global-clusterの例では、Aurora MySQL 互換のグローバル DB クラスターの削除保護を有効にします。aws rds modify-global-cluster \ --global-cluster-identifiermyglobalcluster\ --deletion-protection出力:
{ "GlobalCluster": { "GlobalClusterIdentifier": "myglobalcluster", "GlobalClusterResourceId": "cluster-f0e523bfe07aabb", "GlobalClusterArn": "arn:aws:rds::123456789012:global-cluster:myglobalcluster", "Status": "available", "Engine": "aurora-mysql", "EngineVersion": "5.7.mysql_aurora.2.07.2", "StorageEncrypted": false, "DeletionProtection": true, "GlobalClusterMembers": [] } }詳細については、「Amazon Aurora ユーザーガイド」の「Aurora グローバルデータベースの管理」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyGlobalCluster
」を参照してください。
-
次の例は、promote-read-replica-db-cluster を使用する方法を説明しています。
- AWS CLI
-
DB クラスターリードレプリカを昇格するには
次の
promote-read-replica-db-clusterの例では、指定されたリードレプリカをスタンドアロン DB クラスターに昇格させます。aws rds promote-read-replica-db-cluster \ --db-cluster-identifiermydbcluster-1出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c" ], "BackupRetentionPeriod": 1, "DatabaseName": "", "DBClusterIdentifier": "mydbcluster-1", ...some output truncated... } }詳細については、「Amazon Aurora ユーザーガイド」の「リードレプリカを DB クラスターに昇格させる」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「PromoteReadReplicaDbCluster
」を参照してください。
-
次の例は、promote-read-replica を使用する方法を説明しています。
- AWS CLI
-
リードレプリカを昇格させるには
次の
promote-read-replicaの例では、指定されたリードレプリカをスタンドアロン DB インスタンスに昇格させます。aws rds promote-read-replica \ --db-instance-identifiertest-instance-repl出力:
{ "DBInstance": { "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:test-instance-repl", "StorageType": "standard", "ReadReplicaSourceDBInstanceIdentifier": "test-instance", "DBInstanceStatus": "modifying", ...some output truncated... } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「PromoteReadReplica
」を参照してください。
-
次の例は、purchase-reserved-db-instance を使用する方法を説明しています。
- AWS CLI
-
リザーブド DB インスタンスを購入するには
次の
purchase-reserved-db-instances-offeringの例では、リザーブド DB インスタンスサービスを購入します。reserved-db-instances-offering-idは、describe-reserved-db-instances-offeringコマンドによって返される有効なオファリング ID である必要があります。aws rds purchase-reserved-db-instances-offering --reserved-db-instances-offering-id 438012d3-4a52-4cc7-b2e3-8dff72e0e706
-
API の詳細については、「AWS CLI コマンドリファレンス」の「PurchaseReservedDbInstance
」を参照してください。
-
次の例は、purchase-reserved-db-instances-offerings を使用する方法を説明しています。
- AWS CLI
-
例 1: 購入するリザーブド DB インスタンスを検索するには
次の
describe-reserved-db-instances-offeringsの例では、db.t2.micro インスタンスクラスと 1 年間の利用可能なリザーブド MySQL DB インスタンスを一覧表示します。オファリング ID は、リザーブド DB インスタンスの購入に必要です。aws rds describe-reserved-db-instances-offerings \ --product-descriptionmysql\ --db-instance-classdb.t2.micro\ --duration1出力:
{ "ReservedDBInstancesOfferings": [ { "ReservedDBInstancesOfferingId": "8ba30be1-b9ec-447f-8f23-6114e3f4c7b4", "DBInstanceClass": "db.t2.micro", "Duration": 31536000, "FixedPrice": 51.0, "UsagePrice": 0.0, "CurrencyCode": "USD", "ProductDescription": "mysql", "OfferingType": "Partial Upfront", "MultiAZ": false, "RecurringCharges": [ { "RecurringChargeAmount": 0.006, "RecurringChargeFrequency": "Hourly" } ] }, ... some output truncated ... ] }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS のリザーブド DB インスタンス」を参照してください。
例 2: リザーブド DB インスタンスを購入するには
次の
purchase-reserved-db-instances-offeringの例は、前の例からのリザーブド DB インスタンスサービスを購入する方法を示しています。aws rds purchase-reserved-db-instances-offering --reserved-db-instances-offering-id 8ba30be1-b9ec-447f-8f23-6114e3f4c7b4
出力:
{ "ReservedDBInstance": { "ReservedDBInstanceId": "ri-2020-06-29-16-54-57-670", "ReservedDBInstancesOfferingId": "8ba30be1-b9ec-447f-8f23-6114e3f4c7b4", "DBInstanceClass": "db.t2.micro", "StartTime": "2020-06-29T16:54:57.670Z", "Duration": 31536000, "FixedPrice": 51.0, "UsagePrice": 0.0, "CurrencyCode": "USD", "DBInstanceCount": 1, "ProductDescription": "mysql", "OfferingType": "Partial Upfront", "MultiAZ": false, "State": "payment-pending", "RecurringCharges": [ { "RecurringChargeAmount": 0.006, "RecurringChargeFrequency": "Hourly" } ], "ReservedDBInstanceArn": "arn:aws:rds:us-west-2:123456789012:ri:ri-2020-06-29-16-54-57-670" } }詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS のリザーブド DB インスタンス」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「PurchaseReservedDbInstancesOfferings
」を参照してください。
-
次の例は、reboot-db-instance を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスを再起動するには
次の
reboot-db-instanceの例は、指定された DB インスタンスを再起動します。aws rds reboot-db-instance \ --db-instance-identifiertest-mysql-instance出力:
{ "DBInstance": { "DBInstanceIdentifier": "test-mysql-instance", "DBInstanceClass": "db.t3.micro", "Engine": "mysql", "DBInstanceStatus": "rebooting", "MasterUsername": "admin", "Endpoint": { "Address": "test-mysql-instance.############.us-west-2.rds.amazonaws.com", "Port": 3306, "HostedZoneId": "Z1PVIF0EXAMPLE" }, ... output omitted... } }詳細については、「Amazon RDS ユーザーガイド」の「DB インスタンスの再起動」を参照してください。
-
API の詳細については、AWS CLI コマンドリファレンスの「RebootDBInstance
」を参照してください。
-
次の例は、reboot-db-shard-group を使用する方法を説明しています。
- AWS CLI
-
例 1: DB シャードグループを再起動するには
次の
reboot-db-shard-groupの例では、DB シャードグループを再起動します。aws rds reboot-db-shard-group \ --db-shard-group-identifiermy-db-shard-group出力:
{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890", "DBShardGroupIdentifier": "my-db-shard-group", "DBClusterIdentifier": "my-sv2-cluster", "MaxACU": 1000.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": false, "Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスターまたは Amazon Aurora DB インスタンスの再起動」を参照してください。
例 2: DB シャードグループを記述するには
次の
describe-db-shard-groupsの例では、reboot-db-shard-groupコマンドの実行後に DB シャードグループの詳細を取得します。DB シャードグループmy-db-shard-groupを再起動しています。aws rds describe-db-shard-groups出力:
{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-7bb446329da94788b3f957746example", "DBShardGroupIdentifier": "limitless-test-shard-grp", "DBClusterIdentifier": "limitless-test-cluster", "MaxACU": 768.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": true, "Endpoint": "limitless-test-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" }, { "DBShardGroupResourceId": "shardgroup-a6e3a0226aa243e2ac6c7a1234567890", "DBShardGroupIdentifier": "my-db-shard-group", "DBClusterIdentifier": "my-sv2-cluster", "MaxACU": 1000.0, "ComputeRedundancy": 0, "Status": "rebooting", "PubliclyAccessible": false, "Endpoint": "my-sv2-cluster.limitless-cekycexample.us-east-2.rds.amazonaws.com" } ] }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスターまたは Amazon Aurora DB インスタンスの再起動」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RebootDbShardGroup
」を参照してください。
-
次の例は、register-db-proxy-targets を使用する方法を説明しています。
- AWS CLI
-
DB プロキシをデータベースに登録するには
次の
register-db-proxy-targetsの例では、データベースとプロキシ間の関連付けを作成します。aws rds register-db-proxy-targets \ --db-proxy-nameproxyExample\ --db-cluster-identifiersdatabase-5出力:
{ "DBProxyTargets": [ { "RdsResourceId": "database-5", "Port": 3306, "Type": "TRACKED_CLUSTER", "TargetHealth": { "State": "REGISTERING" } }, { "Endpoint": "database-5instance-1.ab0cd1efghij.us-east-1.rds.amazonaws.com", "RdsResourceId": "database-5", "Port": 3306, "Type": "RDS_INSTANCE", "TargetHealth": { "State": "REGISTERING" } } ] }詳細については、「Amazon RDS ユーザーガイド」の「RDS プロキシの作成」および「Amazon Aurora ユーザーガイド」の「RDS プロキシの作成」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RegisterDbProxyTargets
」を参照してください。
-
次の例は、remove-from-global-cluster を使用する方法を説明しています。
- AWS CLI
-
Aurora グローバルデータベースクラスターから Aurora セカンダリクラスターをデタッチするには
次の
remove-from-global-clusterの例では、Aurora グローバルデータベースクラスターから Aurora セカンダリクラスターをデタッチします。クラスターは読み取り専用から、読み取り/書き込み機能を備えたスタンドアロンクラスターに変わります。aws rds remove-from-global-cluster \ --regionus-west-2\ --global-cluster-identifiermyglobalcluster\ --db-cluster-identifierarn:aws:rds:us-west-2:123456789012:cluster:DB-1出力:
{ "GlobalCluster": { "GlobalClusterIdentifier": "myglobalcluster", "GlobalClusterResourceId": "cluster-abc123def456gh", "GlobalClusterArn": "arn:aws:rds::123456789012:global-cluster:myglobalcluster", "Status": "available", "Engine": "aurora-postgresql", "EngineVersion": "10.11", "StorageEncrypted": true, "DeletionProtection": false, "GlobalClusterMembers": [ { "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:js-global-cluster", "Readers": [ "arn:aws:rds:us-west-2:123456789012:cluster:DB-1" ], "IsWriter": true }, { "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:DB-1", "Readers": [], "IsWriter": false, "GlobalWriteForwardingStatus": "disabled" } ] } }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora Global Database からのクラスターの削除」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveFromGlobalCluster
」を参照してください。
-
次の例は、remove-option-from-option-group を使用する方法を説明しています。
- AWS CLI
-
オプショングループからオプションを削除するには
次の
remove-option-from-option-groupの例では、OEMオプションをmyoptiongroupから削除しています。aws rds remove-option-from-option-group \ --option-group-namemyoptiongroup\ --optionsOEM\ --apply-immediately出力:
{ "OptionGroup": { "OptionGroupName": "myoptiongroup", "OptionGroupDescription": "Test", "EngineName": "oracle-ee", "MajorEngineVersion": "19", "Options": [], "AllowsVpcAndNonVpcInstanceMemberships": true, "OptionGroupArn": "arn:aws:rds:us-east-1:123456789012:og:myoptiongroup" } }詳細については、「Amazon Aurora ユーザーガイド」の「オプショングループからオプションを削除する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveOptionFromOptionGroup
」を参照してください。
-
次の例は、remove-role-from-db-cluster を使用する方法を説明しています。
- AWS CLI
-
DB クラスターから AWS Identity and Access Management (IAM) ロールの関連付けを解除するには
次の
remove-role-from-db-clusterの例では、DB クラスターからロールを削除します。aws rds remove-role-from-db-cluster \ --db-cluster-identifiermydbcluster\ --role-arnarn:aws:iam::123456789012:role/RDSLoadFromS3このコマンドでは何も出力されません。
詳細については、「Amazon Aurora ユーザーガイド」の「IAM ロールと Amazon Aurora MySQL DB クラスターの関連付け」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveRoleFromDbCluster
」を参照してください。
-
次の例は、remove-role-from-db-instance を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスから AWS Identity and Access Management (IAM) ロールの関連付けを解除するには
次の
remove-role-from-db-instanceの例では、test-instanceという名前の Oracle DB インスタンスからrds-s3-integration-roleという名前のロールを削除します。aws rds remove-role-from-db-instance \ --db-instance-identifiertest-instance\ --feature-nameS3_INTEGRATION\ --role-arnarn:aws:iam::111122223333:role/rds-s3-integration-roleこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「S3 との RDS SQL Server 統合の無効化」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveRoleFromDbInstance
」を参照してください。
-
次の例は、remove-source-identifier-from-subscription を使用する方法を説明しています。
- AWS CLI
-
サブスクリプションからソース識別子を削除するには
次の
remove-source-identifierの例は、ソース識別子を既存のサブスクリプションから削除します。aws rds remove-source-identifier-from-subscription \ --subscription-namemy-instance-events\ --source-identifiertest-instance-repl出力:
{ "EventSubscription": { "EventSubscriptionArn": "arn:aws:rds:us-east-1:123456789012:es:my-instance-events", "SubscriptionCreationTime": "Tue Jul 31 23:22:01 UTC 2018", "EventCategoriesList": [ "backup", "recovery" ], "SnsTopicArn": "arn:aws:sns:us-east-1:123456789012:interesting-events", "Status": "modifying", "CustSubscriptionId": "my-instance-events", "CustomerAwsId": "123456789012", "SourceIdsList": [ "test-instance" ], "SourceType": "db-instance", "Enabled": false } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveSourceIdentifierFromSubscription
」を参照してください。
-
次の例は、remove-tags-from-resource を使用する方法を説明しています。
- AWS CLI
-
リソースからタグを削除する
次の
remove-tags-from-resourceの例では、リソースからタグが削除されます。aws rds remove-tags-from-resource \ --resource-namearn:aws:rds:us-east-1:123456789012:db:mydbinstance\ --tag-keysNameEnvironmentこのコマンドでは何も出力されません。
詳細については、「Amazon RDS ユーザーガイド」の「Amazon RDS リソースのタグ付け」および「Amazon Aurora ユーザーガイド」の「Amazon RDS リソースのタグ付け」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RemoveTagsFromResource
」を参照してください。
-
次の例は、reset-db-cluster-parameter-group を使用する方法を説明しています。
- AWS CLI
-
例 1: すべてのパラメータをデフォルト値にリセットするには
次の
reset-db-cluster-parameter-groupの例では、顧客が作成した DB クラスターパラメータグループのパラメータ値をデフォルト値にリセットします。aws rds reset-db-cluster-parameter-group \ --db-cluster-parameter-group-namemydbclpg\ --reset-all-parameters出力:
{ "DBClusterParameterGroupName": "mydbclpg" }詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
例 2: 特定のパラメータをデフォルト値にリセットするには
次の
reset-db-cluster-parameter-groupの例では、特定のパラメータのパラメータ値を顧客が作成した DB クラスターパラメータグループのデフォルト値にリセットします。aws rds reset-db-cluster-parameter-group \ --db-cluster-parameter-group-namemydbclpgy\ --parameters"ParameterName=max_connections,ApplyMethod=immediate"\"ParameterName=max_allowed_packet,ApplyMethod=immediate"出力:
{ "DBClusterParameterGroupName": "mydbclpg" }詳細については、「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ResetDbClusterParameterGroup
」を参照してください。
-
次の例は、reset-db-parameter-group を使用する方法を説明しています。
- AWS CLI
-
例 1: すべてのパラメータをデフォルト値にリセットするには
次の
reset-db-parameter-groupの例では、顧客が作成した DB パラメータグループのパラメータ値をデフォルト値にリセットします。aws rds reset-db-parameter-group \ --db-parameter-group-namemypg\ --reset-all-parameters出力:
{ "DBParameterGroupName": "mypg" }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを使用する」および「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
例 2: 特定のパラメータをデフォルト値にリセットするには
次の
reset-db-parameter-groupの例では、特定のパラメータのパラメータ値を顧客が作成した DB パラメータグループのデフォルト値にリセットします。aws rds reset-db-parameter-group \ --db-parameter-group-namemypg\ --parameters"ParameterName=max_connections,ApplyMethod=immediate"\"ParameterName=max_allowed_packet,ApplyMethod=immediate"出力:
{ "DBParameterGroupName": "mypg" }詳細については、「Amazon RDS ユーザーガイド」の「DB パラメータグループを使用する」および「Amazon Aurora ユーザーガイド」の「DB パラメータグループおよび DB クラスターパラメータグループを使用する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ResetDbParameterGroup
」を参照してください。
-
次の例は、restore-db-cluster-from-s3 を使用する方法を説明しています。
- AWS CLI
-
Amazon S3 バケットから Amazon Aurora DB クラスターを復元するには
次の
restore-db-cluster-from-s3の例では、Amazon Aurora MySQL バージョン 5.7 互換 DB クラスターを Amazon S3 の MySQL 5.7 DB バックアップファイルから復元します。aws rds restore-db-cluster-from-s3 \ --db-cluster-identifiercluster-s3-restore\ --engineaurora-mysql\ --master-usernameadmin\ --master-user-passwordmypassword\ --s3-bucket-nameamzn-s3-demo-bucket\ --s3-prefixtest-backup\ --s3-ingestion-role-arnarn:aws:iam::123456789012:role/service-role/TestBackup\ --source-enginemysql\ --source-engine-version5.7.28出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-west-2c", "us-west-2a", "us-west-2b" ], "BackupRetentionPeriod": 1, "DBClusterIdentifier": "cluster-s3-restore", "DBClusterParameterGroup": "default.aurora-mysql5.7", "DBSubnetGroup": "default", "Status": "creating", "Endpoint": "cluster-s3-restore.cluster-co3xyzabc123.us-west-2.rds.amazonaws.com", "ReaderEndpoint": "cluster-s3-restore.cluster-ro-co3xyzabc123.us-west-2.rds.amazonaws.com", "MultiAZ": false, "Engine": "aurora-mysql", "EngineVersion": "5.7.12", "Port": 3306, "MasterUsername": "admin", "PreferredBackupWindow": "11:15-11:45", "PreferredMaintenanceWindow": "thu:12:19-thu:12:49", "ReadReplicaIdentifiers": [], "DBClusterMembers": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-########", "Status": "active" } ], "HostedZoneId": "Z1PVIF0EXAMPLE", "StorageEncrypted": false, "DbClusterResourceId": "cluster-SU5THYQQHOWCXZZDGXREXAMPLE", "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:cluster-s3-restore", "AssociatedRoles": [], "IAMDatabaseAuthenticationEnabled": false, "ClusterCreateTime": "2020-07-27T14:22:08.095Z", "EngineMode": "provisioned", "DeletionProtection": false, "HttpEndpointEnabled": false, "CopyTagsToSnapshot": false, "CrossAccountClone": false, "DomainMemberships": [] } }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon S3 バケットを使用した MySQL からのデータ移行」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RestoreDbClusterFromS3
」を参照してください。
-
次の例は、restore-db-cluster-from-snapshot を使用する方法を説明しています。
- AWS CLI
-
スナップショットから DB クラスターを復元するには
次の
restore-db-cluster-from-snapshotは、PostgreSQL バージョン 10.7 と互換性のある Aurora PostgreSQL DB クラスターを、test-instance-snapshotという名前の DB クラスタースナップショットから復元します。aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifiernewdbcluster\ --snapshot-identifiertest-instance-snapshot\ --engineaurora-postgresql\ --engine-version10.7出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-west-2c", "us-west-2a", "us-west-2b" ], "BackupRetentionPeriod": 7, "DatabaseName": "", "DBClusterIdentifier": "newdbcluster", "DBClusterParameterGroup": "default.aurora-postgresql10", "DBSubnetGroup": "default", "Status": "creating", "Endpoint": "newdbcluster.cluster-############.us-west-2.rds.amazonaws.com", "ReaderEndpoint": "newdbcluster.cluster-ro-############.us-west-2.rds.amazonaws.com", "MultiAZ": false, "Engine": "aurora-postgresql", "EngineVersion": "10.7", "Port": 5432, "MasterUsername": "postgres", "PreferredBackupWindow": "09:33-10:03", "PreferredMaintenanceWindow": "sun:12:22-sun:12:52", "ReadReplicaIdentifiers": [], "DBClusterMembers": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-########", "Status": "active" } ], "HostedZoneId": "Z1PVIF0EXAMPLE", "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/287364e4-33e3-4755-a3b0-a1b2c3d4e5f6", "DbClusterResourceId": "cluster-5DSB5IFQDDUVAWOUWM1EXAMPLE", "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:newdbcluster", "AssociatedRoles": [], "IAMDatabaseAuthenticationEnabled": false, "ClusterCreateTime": "2020-06-05T15:06:58.634Z", "EngineMode": "provisioned", "DeletionProtection": false, "HttpEndpointEnabled": false, "CopyTagsToSnapshot": false, "CrossAccountClone": false, "DomainMemberships": [] } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスターのスナップショットからの復元」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RestoreDbClusterFromSnapshot
」を参照してください。
-
次の例は、restore-db-cluster-to-point-in-time を使用する方法を説明しています。
- AWS CLI
-
DB クラスターを特定の時点に復元するには
次の
restore-db-cluster-to-point-in-timeの例では、database-4という名前の DB クラスターを可能な限り最新の時刻に復元します。copy-on-writeを復元タイプとして使用すると、新しい DB クラスターがソース DB クラスターのクローンとして復元されます。aws rds restore-db-cluster-to-point-in-time \ --source-db-cluster-identifierdatabase-4\ --db-cluster-identifiersample-cluster-clone\ --restore-typecopy-on-write\ --use-latest-restorable-time出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-west-2c", "us-west-2a", "us-west-2b" ], "BackupRetentionPeriod": 7, "DatabaseName": "", "DBClusterIdentifier": "sample-cluster-clone", "DBClusterParameterGroup": "default.aurora-postgresql10", "DBSubnetGroup": "default", "Status": "creating", "Endpoint": "sample-cluster-clone.cluster-############.us-west-2.rds.amazonaws.com", "ReaderEndpoint": "sample-cluster-clone.cluster-ro-############.us-west-2.rds.amazonaws.com", "MultiAZ": false, "Engine": "aurora-postgresql", "EngineVersion": "10.7", "Port": 5432, "MasterUsername": "postgres", "PreferredBackupWindow": "09:33-10:03", "PreferredMaintenanceWindow": "sun:12:22-sun:12:52", "ReadReplicaIdentifiers": [], "DBClusterMembers": [], "VpcSecurityGroups": [ { "VpcSecurityGroupId": "sg-########", "Status": "active" } ], "HostedZoneId": "Z1PVIF0EXAMPLE", "StorageEncrypted": true, "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/287364e4-33e3-4755-a3b0-a1b2c3d4e5f6", "DbClusterResourceId": "cluster-BIZ77GDSA2XBSTNPFW1EXAMPLE", "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster-clone", "AssociatedRoles": [], "IAMDatabaseAuthenticationEnabled": false, "CloneGroupId": "8d19331a-099a-45a4-b4aa-11aa22bb33cc44dd", "ClusterCreateTime": "2020-03-10T19:57:38.967Z", "EngineMode": "provisioned", "DeletionProtection": false, "HttpEndpointEnabled": false, "CopyTagsToSnapshot": false, "CrossAccountClone": false } }詳細については、「Amazon Aurora ユーザーガイド」の「DB クラスターを指定の時点の状態に復元する」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RestoreDbClusterToPointInTime
」を参照してください。
-
次の例は、restore-db-instance-from-db-snapshot を使用する方法を説明しています。
- AWS CLI
-
DB スナップショットから DB インスタンスを復元するには
次の
restore-db-instance-from-db-snapshotの例では、指定された DB スナップショットからdb.t3.smallDB インスタンスクラスでdb7-new-instanceという名前の新しい DB インスタンスを作成します。スナップショットが作成されたソース DB インスタンスは、廃止された DB インスタンスクラスを使用するため、アップグレードできません。aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifierdb7-new-instance\ --db-snapshot-identifierdb7-test-snapshot\ --db-instance-classdb.t3.small出力:
{ "DBInstance": { "DBInstanceIdentifier": "db7-new-instance", "DBInstanceClass": "db.t3.small", "Engine": "mysql", "DBInstanceStatus": "creating", ...output omitted... "PreferredMaintenanceWindow": "mon:07:37-mon:08:07", "PendingModifiedValues": {}, "MultiAZ": false, "EngineVersion": "5.7.22", "AutoMinorVersionUpgrade": true, "ReadReplicaDBInstanceIdentifiers": [], "LicenseModel": "general-public-license", ...output omitted... "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:db7-new-instance", "IAMDatabaseAuthenticationEnabled": false, "PerformanceInsightsEnabled": false, "DeletionProtection": false, "AssociatedRoles": [] } }詳細については、「Amazon RDS ユーザーガイド」の「DB スナップショットからの復元」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RestoreDbInstanceFromDbSnapshot
」を参照してください。
-
次の例は、restore-db-instance-from-s3 を使用する方法を説明しています。
- AWS CLI
-
Amazon S3 のバックアップから DB インスタンスを復元するには
次の
restore-db-instance-from-s3の例では、my-backupsS3 バケット内の既存のバックアップからrestored-test-instanceという名前の新しい DB インスタンスを作成します。aws rds restore-db-instance-from-s3 \ --db-instance-identifierrestored-test-instance\ --allocated-storage250--db-instance-classdb.m4.large--enginemysql\ --master-username master --master-user-passwordsecret99\ --s3-bucket-namemy-backups--s3-ingestion-role-arnarn:aws:iam::123456789012:role/my-role\ --source-enginemysql--source-engine-version5.6.27-
API の詳細については、「AWS CLI コマンドリファレンス」の「RestoreDbInstanceFromS3
」を参照してください。
-
次の例は、restore-db-instance-to-point-in-time を使用する方法を説明しています。
- AWS CLI
-
例 1: DB インスタンスを特定の時点に復元するには
次の
restore-db-instance-to-point-in-timeの例は、指定された時刻にtest-instanceをrestored-test-instanceという新しい DB インスタンスに復元します。aws rds restore-db-instance-to-point-in-time \ --source-db-instance-identifiertest-instance\ --target-db-instancerestored-test-instance\ --restore-time2018-07-30T23:45:00.000Z出力:
{ "DBInstance": { "AllocatedStorage": 20, "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:restored-test-instance", "DBInstanceStatus": "creating", "DBInstanceIdentifier": "restored-test-instance", ...some output omitted... } }詳細については、「Amazon RDS ユーザーガイド」の「DB インスタンスを指定の時点の状態に復元する」を参照してください。
例 2: レプリケーションされたバックアップから指定された時刻に DB インスタンスを復元するには
次の
restore-db-instance-to-point-in-timeの例では、Oracle DB インスタンスをレプリケートされた自動バックアップから指定された時間に復元します。aws rds restore-db-instance-to-point-in-time \ --source-db-instance-automated-backups-arn"arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example"\ --target-db-instance-identifiermyorclinstance-from-replicated-backup\ --restore-time2020-12-08T18:45:00.000Z出力:
{ "DBInstance": { "DBInstanceIdentifier": "myorclinstance-from-replicated-backup", "DBInstanceClass": "db.t3.micro", "Engine": "oracle-se2", "DBInstanceStatus": "creating", "MasterUsername": "admin", "DBName": "ORCL", "AllocatedStorage": 20, "PreferredBackupWindow": "07:45-08:15", "BackupRetentionPeriod": 14, ... some output omitted ... "DbiResourceId": "db-KGLXG75BGVIWKQT7NQ4EXAMPLE", "CACertificateIdentifier": "rds-ca-2019", "DomainMemberships": [], "CopyTagsToSnapshot": false, "MonitoringInterval": 0, "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:myorclinstance-from-replicated-backup", "IAMDatabaseAuthenticationEnabled": false, "PerformanceInsightsEnabled": false, "DeletionProtection": false, "AssociatedRoles": [], "TagList": [] } }詳細については、「Amazon RDS ユーザーガイド」の「レプリケーションされたバックアップから指定された時刻への復元」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「RestoreDbInstanceToPointInTime
」を参照してください。
-
次の例は、start-activity-stream を使用する方法を説明しています。
- AWS CLI
-
データベースアクティビティストリーミングをスタートするには
次の
start-activity-streamの例では、my-pg-cluster という名前の Aurora クラスターをモニタリングするための非同期アクティビティストリームを開始します。aws rds start-activity-stream \ --regionus-east-1\ --modeasync\ --kms-key-idarn:aws:kms:us-east-1:1234567890123:key/a12c345d-6ef7-890g-h123-456i789jk0l1\ --resource-arnarn:aws:rds:us-east-1:1234567890123:cluster:my-pg-cluster\ --apply-immediately出力:
{ "KmsKeyId": "arn:aws:kms:us-east-1:1234567890123:key/a12c345d-6ef7-890g-h123-456i789jk0l1", "KinesisStreamName": "aws-rds-das-cluster-0ABCDEFGHI1JKLM2NOPQ3R4S", "Status": "starting", "Mode": "async", "ApplyImmediately": true }詳細については、「Amazon Aurora ユーザーガイド」の「データベースアクティビティストリームの開始」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StartActivityStream
」を参照してください。
-
次の例は、start-db-cluster を使用する方法を説明しています。
- AWS CLI
-
DB クラスターを開始するには
次の
start-db-clusterの例では、DB クラスターとその DB インスタンスを起動します。aws rds start-db-cluster \ --db-cluster-identifiermydbcluster出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-east-1a", "us-east-1e", "us-east-1b" ], "BackupRetentionPeriod": 1, "DatabaseName": "mydb", "DBClusterIdentifier": "mydbcluster", ...some output truncated... } }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスターの停止と開始」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StartDbCluster
」を参照してください。
-
次の例は、start-db-instance-automated-backups-replication を使用する方法を説明しています。
- AWS CLI
-
クロスリージョン自動バックアップを有効にするには
次の
start-db-instance-automated-backups-replicationの例では、米国東部 (バージニア北部) リージョン の DB インスタンスから 米国西部 (オレゴン) リージョン への自動バックアップをレプリケーションします。バックアップ保持期間は 14 日間です。aws rds start-db-instance-automated-backups-replication \ --regionus-west-2\ --source-db-instance-arn"arn:aws:rds:us-east-1:123456789012:db:new-orcl-db"\ --backup-retention-period14出力:
{ "DBInstanceAutomatedBackup": { "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:new-orcl-db", "DbiResourceId": "db-JKIB2GFQ5RV7REPLZA4EXAMPLE", "Region": "us-east-1", "DBInstanceIdentifier": "new-orcl-db", "RestoreWindow": {}, "AllocatedStorage": 20, "Status": "pending", "Port": 1521, "InstanceCreateTime": "2020-12-04T15:28:31Z", "MasterUsername": "admin", "Engine": "oracle-se2", "EngineVersion": "12.1.0.2.v21", "LicenseModel": "bring-your-own-license", "OptionGroupName": "default:oracle-se2-12-1", "Encrypted": false, "StorageType": "gp2", "IAMDatabaseAuthenticationEnabled": false, "BackupRetentionPeriod": 14, "DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example" } }詳細については、「Amazon RDS ユーザーガイド」の「クロスリージョン自動バックアップの有効化」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StartDbInstanceAutomatedBackupsReplication
」を参照してください。
-
次の例は、start-db-instance を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスを開始するには
次の
start-db-instanceの例では、指定された DB インスタンスを起動します。aws rds start-db-instance \ --db-instance-identifiertest-instance出力:
{ "DBInstance": { "DBInstanceStatus": "starting", ...some output truncated... } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「StartDbInstance
」を参照してください。
-
次の例は、start-export-task を使用する方法を説明しています。
- AWS CLI
-
Amazon S3 にスナップショットをエクスポートするには
次の
start-export-taskの例では、db5-snapshot-testという名前の DB スナップショットをamzn-s3-demo-bucketという名前の Amazon S3 バケットにエクスポートします。aws rds start-export-task \ --export-task-identifiermy-s3-export\ --source-arnarn:aws:rds:us-west-2:123456789012:snapshot:db5-snapshot-test\ --s3-bucket-nameamzn-s3-demo-bucket\ --iam-role-arnarn:aws:iam::123456789012:role/service-role/ExportRole\ --kms-key-idarn:aws:kms:us-west-2:123456789012:key/abcd0000-7fca-4128-82f2-aabbccddeeff出力:
{ "ExportTaskIdentifier": "my-s3-export", "SourceArn": "arn:aws:rds:us-west-2:123456789012:snapshot:db5-snapshot-test", "SnapshotTime": "2020-03-27T20:48:42.023Z", "S3Bucket": "amzn-s3-demo-bucket", "IamRoleArn": "arn:aws:iam::123456789012:role/service-role/ExportRole", "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/abcd0000-7fca-4128-82f2-aabbccddeeff", "Status": "STARTING", "PercentProgress": 0, "TotalExtractedDataInGB": 0 }詳細については、「Amazon RDS ユーザーガイド」の「Amazon S3 バケットへのスナップショットのエクスポート」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StartExportTask
」を参照してください。
-
次の例は、stop-activity-stream を使用する方法を説明しています。
- AWS CLI
-
データベースアクティビティストリーミングを停止するには
次の
stop-activity-streamの例では、my-pg-cluster という名前の Aurora クラスター内のアクティビティストリームを停止します。aws rds stop-activity-stream \ --regionus-east-1\ --resource-arnarn:aws:rds:us-east-1:1234567890123:cluster:my-pg-cluster\ --apply-immediately出力:
{ "KmsKeyId": "arn:aws:kms:us-east-1:1234567890123:key/a12c345d-6ef7-890g-h123-456i789jk0l1", "KinesisStreamName": "aws-rds-das-cluster-0ABCDEFGHI1JKLM2NOPQ3R4S", "Status": "stopping" }詳細については、「Amazon Aurora ユーザーガイド」の「アクティビティストリームの停止」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StopActivityStream
」を参照してください。
-
次の例は、stop-db-cluster を使用する方法を説明しています。
- AWS CLI
-
DB クラスターを停止するには
次の
stop-db-cluster例では、DB クラスターとその DB インスタンスを停止します。aws rds stop-db-cluster \ --db-cluster-identifiermydbcluster出力:
{ "DBCluster": { "AllocatedStorage": 1, "AvailabilityZones": [ "us-east-1a", "us-east-1e", "us-east-1b" ], "BackupRetentionPeriod": 1, "DatabaseName": "mydb", "DBClusterIdentifier": "mydbcluster", ...some output truncated... } }詳細については、「Amazon Aurora ユーザーガイド」の「Amazon Aurora DB クラスターの停止と開始」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StopDbCluster
」を参照してください。
-
次の例は、stop-db-instance-automated-backups-replication を使用する方法を説明しています。
- AWS CLI
-
自動バックアップのレプリケーションを停止するには
次の
stop-db-instance-automated-backups-replicationは、米国西部 (オレゴン) リージョンへの自動バックアップのレプリケーションを終了します。レプリケーションされたバックアップは、設定されたバックアップ保持期間に従って保持されます。aws rds stop-db-instance-automated-backups-replication \ --regionus-west-2\ --source-db-instance-arn"arn:aws:rds:us-east-1:123456789012:db:new-orcl-db"出力:
{ "DBInstanceAutomatedBackup": { "DBInstanceArn": "arn:aws:rds:us-east-1:123456789012:db:new-orcl-db", "DbiResourceId": "db-JKIB2GFQ5RV7REPLZA4EXAMPLE", "Region": "us-east-1", "DBInstanceIdentifier": "new-orcl-db", "RestoreWindow": { "EarliestTime": "2020-12-04T23:13:21.030Z", "LatestTime": "2020-12-07T19:59:57Z" }, "AllocatedStorage": 20, "Status": "replicating", "Port": 1521, "InstanceCreateTime": "2020-12-04T15:28:31Z", "MasterUsername": "admin", "Engine": "oracle-se2", "EngineVersion": "12.1.0.2.v21", "LicenseModel": "bring-your-own-license", "OptionGroupName": "default:oracle-se2-12-1", "Encrypted": false, "StorageType": "gp2", "IAMDatabaseAuthenticationEnabled": false, "BackupRetentionPeriod": 7, "DBInstanceAutomatedBackupsArn": "arn:aws:rds:us-west-2:123456789012:auto-backup:ab-jkib2gfq5rv7replzadausbrktni2bn4example" } }詳細については、「Amazon RDS ユーザーガイド」の「自動バックアップレプリケーションの停止」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「StopDbInstanceAutomatedBackupsReplication
」を参照してください。
-
次の例は、stop-db-instance を使用する方法を説明しています。
- AWS CLI
-
DB インスタンスを停止するには
次の
stop-db-instanceの例では、指定された DB インスタンスを停止します。aws rds stop-db-instance \ --db-instance-identifiertest-instance出力:
{ "DBInstance": { "DBInstanceStatus": "stopping", ...some output truncated... } }-
API の詳細については、「AWS CLI コマンドリファレンス」の「StopDbInstance
」を参照してください。
-
次の例は、switchover-blue-green-deployment を使用する方法を説明しています。
- AWS CLI
-
例 1: RDS DB インスタンスのブルー/グリーンデプロイを切り替えるには
次の
switchover-blue-green-deploymentの例では、指定されたグリーン環境を新しい本番環境として昇格させます。aws rds switchover-blue-green-deployment \ --blue-green-deployment-identifierbgd-wi89nwzglccsfake\ --switchover-timeout300出力:
{ "BlueGreenDeployment": { "BlueGreenDeploymentIdentifier": "bgd-v53303651eexfake", "BlueGreenDeploymentName": "bgd-cli-test-instance", "Source": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "Target": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-green-blhi1e", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-green-blhi1e", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-1-green-k5fv7u", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-2-green-ggsh8m", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-db-instance-replica-3-green-o2vwm0", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CONFIGURE_BACKUPS", "Status": "COMPLETED" }, { "Name": "CREATING_TOPOLOGY_OF_SOURCE", "Status": "COMPLETED" } ], "Status": "SWITCHOVER_IN_PROGRESS", "CreateTime": "2022-02-25T22:33:22.225000+00:00" } }詳細については、「Amazon RDS ユーザーガイド」の「ブルー/グリーンデプロイの切り替え」を参照してください。
例 2: Aurora MySQL DB クラスターのブルー/グリーンデプロイを昇格させるには
次の
switchover-blue-green-deploymentの例では、指定されたグリーン環境を新しい本番環境として昇格させます。aws rds switchover-blue-green-deployment \ --blue-green-deployment-identifierbgd-wi89nwzglccsfake\ --switchover-timeout300出力:
{ "BlueGreenDeployment": { "BlueGreenDeploymentIdentifier": "bgd-wi89nwzglccsfake", "BlueGreenDeploymentName": "my-blue-green-deployment", "Source": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "Target": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3ud8z6", "SwitchoverDetails": [ { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster:my-aurora-mysql-cluster-green-3ud8z6", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-1-green-bvxc73", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-2-green-7wc4ie", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3", "TargetMember": "arn:aws:rds:us-east-1:123456789012:db:my-aurora-mysql-cluster-3-green-p4xxkz", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-excluded-member-endpoint-green-np1ikl", "Status": "AVAILABLE" }, { "SourceMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint", "TargetMember": "arn:aws:rds:us-east-1:123456789012:cluster-endpoint:my-reader-endpoint-green-miszlf", "Status": "AVAILABLE" } ], "Tasks": [ { "Name": "CREATING_READ_REPLICA_OF_SOURCE", "Status": "COMPLETED" }, { "Name": "DB_ENGINE_VERSION_UPGRADE", "Status": "COMPLETED" }, { "Name": "CREATE_DB_INSTANCES_FOR_CLUSTER", "Status": "COMPLETED" }, { "Name": "CREATE_CUSTOM_ENDPOINTS", "Status": "COMPLETED" } ], "Status": "SWITCHOVER_IN_PROGRESS", "CreateTime": "2022-02-25T22:38:49.522000+00:00" } }詳細については、「Amazon Aurora ユーザーガイド」の「ブルー/グリーンデプロイの切り替え」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「SwitchoverBlueGreenDeployment
」を参照してください。
-