を使用した MemoryDB の例 AWS CLI - AWS Command Line Interface

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

を使用した MemoryDB の例 AWS CLI

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

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

各例には、完全なソースコードへのリンクが含まれています。このリンクには、コンテキスト内でコードをセットアップして実行する方法の手順が記載されています。

トピック

アクション

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

AWS CLI

スナップショットをコピーするには

次のcopy-snapshot例では、スナップショットのコピーを作成します。

aws memorydb copy-snapshot \ --source-snapshot-name my-cluster-snapshot \ --target-snapshot-name my-cluster-snapshot-copy

出力

{ "Snapshot": { "Name": "my-cluster-snapshot-copy", "Status": "creating", "Source": "manual", "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:snapshot/my-cluster-snapshot-copy", "ClusterConfiguration": { "Name": "my-cluster", "Description": " ", "NodeType": "db.r6g.large", "EngineVersion": "6.2", "MaintenanceWindow": "wed:03:00-wed:04:00", "Port": 6379, "ParameterGroupName": "default.memorydb-redis6", "SubnetGroupName": "my-sg", "VpcId": "vpc-xx2574fc", "SnapshotRetentionLimit": 0, "SnapshotWindow": "04:30-05:30", "NumShards": 2 } } }

詳細については、MemoryDB ユーザーガイドの「スナップショットのコピー」を参照してください。 MemoryDB

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

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

AWS CLI

を作成するには ACL

次のcreate-acl例では、新しいアクセスコントロールリストを作成します。

aws memorydb create-acl \ --acl-name "new-acl-1" \ --user-names "my-user"

出力:

{ "ACL": { "Name": "new-acl-1", "Status": "creating", "UserNames": [ "my-user" ], "MinimumEngineVersion": "6.2", "Clusters": [], "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:acl/new-acl-1" } }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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

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

AWS CLI

クラスターを作成するには

次のcreate-cluster例では、新しいクラスターを作成します。

aws memorydb create-cluster \ --cluster-name my-new-cluster \ --node-type db.r6g.large \ --acl-name my-acl \ --subnet-group my-sg

出力:

{ "Cluster": { "Name": "my-new-cluster", "Status": "creating", "NumberOfShards": 1, "AvailabilityMode": "MultiAZ", "ClusterEndpoint": { "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "default.memorydb-redis6", "ParameterGroupStatus": "in-sync", "SubnetGroupName": "my-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:cluster/my-new-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "sat:10:00-sat:11:00", "SnapshotWindow": "07:30-08:30", "ACLName": "my-acl", "AutoMinorVersionUpgrade": true } }

詳細については、MemoryDB ユーザーガイドの「クラスターの管理」を参照してください。 MemoryDB

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

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

AWS CLI

パラメータグループを作成するには

次のcreate-parameter-group例では、パラメータグループを作成します。

aws memorydb create-parameter-group \ --parameter-group-name myRedis6x \ --family memorydb_redis6 \ --description "my-parameter-group"

出力:

{ "ParameterGroup": { "Name": "myredis6x", "Family": "memorydb_redis6", "Description": "my-parameter-group", "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:parametergroup/myredis6x" } }

詳細については、MemoryDB ユーザーガイドの「パラメータグループの作成」を参照してください。

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

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

AWS CLI

スナップショットを作成するには

次のcreate-snapshot例では、スナップショットを作成します。

aws memorydb create-snapshot \ --cluster-name my-cluster \ --snapshot-name my-cluster-snapshot

出力:

{ "Snapshot": { "Name": "my-cluster-snapshot1", "Status": "creating", "Source": "manual", "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:snapshot/my-cluster-snapshot", "ClusterConfiguration": { "Name": "my-cluster", "Description": "", "NodeType": "db.r6g.large", "EngineVersion": "6.2", "MaintenanceWindow": "wed:03:00-wed:04:00", "Port": 6379, "ParameterGroupName": "default.memorydb-redis6", "SubnetGroupName": "my-sg", "VpcId": "vpc-862xxxxc", "SnapshotRetentionLimit": 0, "SnapshotWindow": "04:30-05:30", "NumShards": 2 } } }

詳細については、MemoryDB ユーザーガイドの「手動スナップショットの作成」を参照してください。 MemoryDB

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

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

AWS CLI

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

次のcreate-subnet-group例では、サブネットグループを作成します。

aws memorydb create-subnet-group \ --subnet-group-name mysubnetgroup \ --description "my subnet group" \ --subnet-ids subnet-5623xxxx

出力:

{ "SubnetGroup": { "Name": "mysubnetgroup", "Description": "my subnet group", "VpcId": "vpc-86257xxx", "Subnets": [ { "Identifier": "subnet-5623xxxx", "AvailabilityZone": { "Name": "us-east-1a" } } ], "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:subnetgroup/mysubnetgroup" } }

詳細については、MemoryDB ユーザーガイドの「サブネットグループの作成」を参照してください。

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

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

AWS CLI

ユーザーを作成するには

次のcreate-user例では、新しいユーザーを作成します。

aws memorydb create-user \ --user-name user-name-1 \ --access-string "~objects:* ~items:* ~public:*" \ --authentication-mode \ Passwords="enterapasswordhere",Type=password

出力:

{ "User": { "Name": "user-name-1", "Status": "active", "AccessString": "off ~objects:* ~items:* ~public:* resetchannels -@all", "ACLNames": [], "MinimumEngineVersion": "6.2", "Authentication": { "Type": "password", "PasswordCount": 1 }, "ARN": "arn:aws:memorydb:us-west-2:491658xxxxxx:user/user-name-1" } }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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

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

AWS CLI

を削除するには ACL

次のdelete-acl例では、アクセスコントロールリストを削除します。

aws memorydb delete-acl \ --acl-name "new-acl-1"

出力:

{ "ACL": { "Name": "new-acl-1", "Status": "deleting", "UserNames": [ "pat" ], "MinimumEngineVersion": "6.2", "Clusters": [], "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:acl/new-acl-1" } }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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

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

AWS CLI

クラスターを削除するには

次のdelete-cluster例では、クラスターを削除します。

aws memorydb delete-cluster \ --cluster-name my-new-cluster

出力:

{ "Cluster": { "Name": "my-new-cluster", "Status": "deleting", "NumberOfShards": 1, "ClusterEndpoint": { "Address": "clustercfg.my-new-cluster.xxxxx.memorydb.us-east-1.amazonaws.com", "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "default.memorydb-redis6", "ParameterGroupStatus": "in-sync", "SubnetGroupName": "my-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:cluster/my-new-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "sat:10:00-sat:11:00", "SnapshotWindow": "07:30-08:30", "AutoMinorVersionUpgrade": true } }

詳細については、MemoryDB ユーザーガイドの「クラスターの削除」を参照してください。

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

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

AWS CLI

パラメータグループを削除するには

次のdelete-parameter-group例では、パラメータグループを削除します。

aws memorydb delete-parameter-group \ --parameter-group-name myRedis6x

出力:

{ "ParameterGroup": { "Name": "myredis6x", "Family": "memorydb_redis6", "Description": "my-parameter-group", "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:parametergroup/myredis6x" } }

詳細については、MemoryDB ユーザーガイドの「パラメータグループの削除」を参照してください。

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

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

AWS CLI

スナップショットを削除するには

次のdelete-snapshot例では、スナップショットを削除します。

aws memorydb delete-snapshot \ --snapshot-name my-cluster-snapshot

出力:

{ "Snapshot": { "Name": "my-cluster-snapshot", "Status": "deleting", "Source": "manual", "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:snapshot/my-cluster-snapshot", "ClusterConfiguration": { "Name": "my-cluster", "Description": "", "NodeType": "db.r6g.large", "EngineVersion": "6.2", "MaintenanceWindow": "wed:03:00-wed:04:00", "Port": 6379, "ParameterGroupName": "default.memorydb-redis6", "SubnetGroupName": "my-sg", "VpcId": "vpc-862xxxxc", "SnapshotRetentionLimit": 0, "SnapshotWindow": "04:30-05:30", "NumShards": 2 } } }

詳細については、MemoryDB ユーザーガイドの「スナップショットの削除」を参照してください。

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

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

AWS CLI

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

次のdelete-subnet-group例では、サブネットを削除します。

aws memorydb delete-subnet-group \ --subnet-group-name mysubnetgroup

出力:

{ "SubnetGroup": { "Name": "mysubnetgroup", "Description": "my subnet group", "VpcId": "vpc-86xxxx4fc", "Subnets": [ { "Identifier": "subnet-56xxx61b", "AvailabilityZone": { "Name": "us-east-1a" } } ], "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:subnetgroup/mysubnetgroup" } }

詳細については、MemoryDB ユーザーガイドの「サブネットグループの削除」を参照してください。

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

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

AWS CLI

ユーザーを削除するには

次のdelete-user例では、ユーザーを削除します。

aws memorydb delete-user \ --user-name my-user

出力:

{ "User": { "Name": "my-user", "Status": "deleting", "AccessString": "on ~app::* resetchannels -@all +@read", "ACLNames": [ "my-acl" ], "MinimumEngineVersion": "6.2", "Authentication": { "Type": "password", "PasswordCount": 1 }, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:user/my-user" } }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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

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

AWS CLI

のリストを返すには ACLs

次の describe-acls` は のリストを返しますACLs。

aws memorydb describe-acls

出力:

{ "ACLs": [ { "Name": "open-access", "Status": "active", "UserNames": [ "default" ], "MinimumEngineVersion": "6.2", "Clusters": [], "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:acl/open-access" }, { "Name": my-acl", "Status": "active", "UserNames": [], "MinimumEngineVersion": "6.2", "Clusters": [ "my-cluster" ], "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxxx:acl/my-acl" } ] }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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

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

AWS CLI

クラスターのリストを返すには

次の describe-clusters` は、クラスターのリストを返します。

aws memorydb describe-clusters

出力:

{ "Clusters": [ { "Name": "my-cluster", "Status": "available", "NumberOfShards": 2, "ClusterEndpoint": { "Address": "clustercfg.my-cluster.llru6f.memorydb.us-east-1.amazonaws.com", "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "default.memorydb-redis6", "ParameterGroupStatus": "in-sync", "SecurityGroups": [ { "SecurityGroupId": "sg-0a1434xxxxxc9fae", "Status": "active" } ], "SubnetGroupName": "pat-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:cluster/my-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "wed:03:00-wed:04:00", "SnapshotWindow": "04:30-05:30", "ACLName": "my-acl", "AutoMinorVersionUpgrade": true } ] }

詳細については、MemoryDB ユーザーガイドの「クラスターの管理」を参照してください。 MemoryDB

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

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

AWS CLI

エンジンバージョンのリストを返すには

次の describe-engine-versions` は、エンジンバージョンのリストを返します。

aws memorydb describe-engine-versions

出力:

{ "EngineVersions": [ { "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupFamily": "memorydb_redis6" } ] }

詳細については、MemoryDB ユーザーガイドの「エンジンのバージョンとアップグレード」を参照してください。 MemoryDB

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

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

AWS CLI

イベントのリストを返すには

次の describe-events` は、イベントのリストを返します。

aws memorydb describe-events

出力:

{ "Events": [ { "SourceName": "my-cluster", "SourceType": "cluster", "Message": "Increase replica count started for replication group my-cluster on 2022-07-22T14:09:01.440Z", "Date": "2022-07-22T07:09:01.443000-07:00" }, { "SourceName": "my-user", "SourceType": "user", "Message": "Create user my-user operation completed.", "Date": "2022-07-22T07:00:02.975000-07:00" } ] }

詳細については、MemoryDB ユーザーガイドの「イベントのモニタリング」を参照してください。

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

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

AWS CLI

パラメータグループのリストを返すには

次の describe-parameter-groups` は、パラメータグループのリストを返します。

aws memorydb describe-parameter-groups

出力:

{ "ParameterGroups": [ { "Name": "default.memorydb-redis6", "Family": "memorydb_redis6", "Description": "Default parameter group for memorydb_redis6", "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:parametergroup/default.memorydb-redis6" } ] }

詳細については、MemoryDB ユーザーガイドの「パラメータグループを使用したエンジンパラメータの設定」を参照してください。

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

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

AWS CLI

パラメータのリストを返すには

次の describe-parameters` は、パラメータのリストを返します。

aws memorydb describe-parameters

出力:

{ "Parameters": [ { "Name": "acllog-max-len", "Value": "128", "Description": "The maximum length of the ACL Log", "DataType": "integer", "AllowedValues": "1-10000", "MinimumEngineVersion": "6.2.4" }, { "Name": "activedefrag", "Value": "no", "Description": "Enabled active memory defragmentation", "DataType": "string", "AllowedValues": "yes,no", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-defrag-cycle-max", "Value": "75", "Description": "Maximal effort for defrag in CPU percentage", "DataType": "integer", "AllowedValues": "1-75", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-defrag-cycle-min", "Value": "5", "Description": "Minimal effort for defrag in CPU percentage", "DataType": "integer", "AllowedValues": "1-75", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-defrag-ignore-bytes", "Value": "104857600", "Description": "Minimum amount of fragmentation waste to start active defrag", "DataType": "integer", "AllowedValues": "1048576-", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-defrag-max-scan-fields", "Value": "1000", "Description": "Maximum number of set/hash/zset/list fields that will be processed from the main dictionary scan", "DataType": "integer", "AllowedValues": "1-1000000", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-defrag-threshold-lower", "Value": "10", "Description": "Minimum percentage of fragmentation to start active defrag", "DataType": "integer", "AllowedValues": "1-100", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-defrag-threshold-upper", "Value": "100", "Description": "Maximum percentage of fragmentation at which we use maximum effort", "DataType": "integer", "AllowedValues": "1-100", "MinimumEngineVersion": "6.2.4" }, { "Name": "active-expire-effort", "Value": "1", "Description": "The amount of effort that redis uses to expire items in the active expiration job", "DataType": "integer", "AllowedValues": "1-10", "MinimumEngineVersion": "6.2.4" }, { "Name": "activerehashing", "Value": "yes", "Description": "Apply rehashing or not", "DataType": "string", "AllowedValues": "yes,no", "MinimumEngineVersion": "6.2.4" }, { "Name": "client-output-buffer-limit-normal-hard-limit", "Value": "0", "Description": "Normal client output buffer hard limit in bytes", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "client-output-buffer-limit-normal-soft-limit", "Value": "0", "Description": "Normal client output buffer soft limit in bytes", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "client-output-buffer-limit-normal-soft-seconds", "Value": "0", "Description": "Normal client output buffer soft limit in seconds", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "client-output-buffer-limit-pubsub-hard-limit", "Value": "33554432", "Description": "Pubsub client output buffer hard limit in bytes", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "client-output-buffer-limit-pubsub-soft-limit", "Value": "8388608", "Description": "Pubsub client output buffer soft limit in bytes", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "client-output-buffer-limit-pubsub-soft-seconds", "Value": "60", "Description": "Pubsub client output buffer soft limit in seconds", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "hash-max-ziplist-entries", "Value": "512", "Description": "The maximum number of hash entries in order for the dataset to be compressed", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "hash-max-ziplist-value", "Value": "64", "Description": "The threshold of biggest hash entries in order for the dataset to be compressed", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "hll-sparse-max-bytes", "Value": "3000", "Description": "HyperLogLog sparse representation bytes limit", "DataType": "integer", "AllowedValues": "1-16000", "MinimumEngineVersion": "6.2.4" }, { "Name": "lazyfree-lazy-eviction", "Value": "no", "Description": "Perform an asynchronous delete on evictions", "DataType": "string", "AllowedValues": "yes,no", "MinimumEngineVersion": "6.2.4" }, { "Name": "lazyfree-lazy-expire", "Value": "no", "Description": "Perform an asynchronous delete on expired keys", "DataType": "string", "AllowedValues": "yes,no", "MinimumEngineVersion": "6.2.4" }, { "Name": "lazyfree-lazy-server-del", "Value": "no", "Description": "Perform an asynchronous delete on key updates", "DataType": "string", "AllowedValues": "yes,no", "MinimumEngineVersion": "6.2.4" }, { "Name": "lazyfree-lazy-user-del", "Value": "no", "Description": "Specifies whether the default behavior of DEL command acts the same as UNLINK", "DataType": "string", "AllowedValues": "yes,no", "MinimumEngineVersion": "6.2.4" }, { "Name": "lfu-decay-time", "Value": "1", "Description": "The amount of time in minutes to decrement the key counter for LFU eviction policyd", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "lfu-log-factor", "Value": "10", "Description": "The log factor for incrementing key counter for LFU eviction policy", "DataType": "integer", "AllowedValues": "1-", "MinimumEngineVersion": "6.2.4" }, { "Name": "list-compress-depth", "Value": "0", "Description": "Number of quicklist ziplist nodes from each side of the list to exclude from compression. The head and tail of the list are always uncompressed for fast push/pop operations", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "maxmemory-policy", "Value": "noeviction", "Description": "Max memory policy", "DataType": "string", "AllowedValues": "volatile-lru,allkeys-lru,volatile-lfu,allkeys-lfu,volatile-random,allkeys-random,volatile-ttl,noeviction", "MinimumEngineVersion": "6.2.4" }, { "Name": "maxmemory-samples", "Value": "3", "Description": "Max memory samples", "DataType": "integer", "AllowedValues": "1-", "MinimumEngineVersion": "6.2.4" }, { "Name": "notify-keyspace-events", "Description": "The keyspace events for Redis to notify Pub/Sub clients about. By default all notifications are disabled", "DataType": "string", "MinimumEngineVersion": "6.2.4" }, { "Name": "set-max-intset-entries", "Value": "512", "Description": "The limit in the size of the set in order for the dataset to be compressed", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "slowlog-log-slower-than", "Value": "10000", "Description": "The execution time, in microseconds, to exceed in order for the command to get logged. Note that a negative number disables the slow log, while a value of zero forces the logging of every command", "DataType": "integer", "AllowedValues": "-", "MinimumEngineVersion": "6.2.4" }, { "Name": "slowlog-max-len", "Value": "128", "Description": "The length of the slow log. There is no limit to this length. Just be aware that it will consume memory. You can reclaim memory used by the slow log with SLOWLOG RESET.", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "stream-node-max-bytes", "Value": "4096", "Description": "The maximum size of a single node in a stream in bytes", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "stream-node-max-entries", "Value": "100", "Description": "The maximum number of items a single node in a stream can contain", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "tcp-keepalive", "Value": "300", "Description": "If non-zero, send ACKs every given number of seconds", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "timeout", "Value": "0", "Description": "Close connection if client is idle for a given number of seconds, or never if 0", "DataType": "integer", "AllowedValues": "0,20-", "MinimumEngineVersion": "6.2.4" }, { "Name": "tracking-table-max-keys", "Value": "1000000", "Description": "The maximum number of keys allowed for the tracking table for client side caching", "DataType": "integer", "AllowedValues": "1-100000000", "MinimumEngineVersion": "6.2.4" }, { "Name": "zset-max-ziplist-entries", "Value": "128", "Description": "The maximum number of sorted set entries in order for the dataset to be compressed", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" }, { "Name": "zset-max-ziplist-value", "Value": "64", "Description": "The threshold of biggest sorted set entries in order for the dataset to be compressed", "DataType": "integer", "AllowedValues": "0-", "MinimumEngineVersion": "6.2.4" } ] }

詳細については、MemoryDB ユーザーガイドの「パラメータグループを使用したエンジンパラメータの設定」を参照してください。

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

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

AWS CLI

スナップショットのリストを返すには

次の describe-snapshots` はスナップショットのリストを返します。

aws memorydb describe-snapshots

出力:

{ "Snapshots": [ { "Name": "my-cluster-snapshot", "Status": "available", "Source": "manual", "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx2:snapshot/my-cluster-snapshot", "ClusterConfiguration": { "Name": "my-cluster", "Description": " ", "NodeType": "db.r6g.large", "EngineVersion": "6.2", "MaintenanceWindow": "wed:03:00-wed:04:00", "Port": 6379, "ParameterGroupName": "default.memorydb-redis6", "SubnetGroupName": "my-sg", "VpcId": "vpc-862574fc", "SnapshotRetentionLimit": 0, "SnapshotWindow": "04:30-05:30", "NumShards": 2 } } }

詳細については、MemoryDB ユーザーガイドの「スナップショットと復元」を参照してください。 MemoryDB

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

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

AWS CLI

サブネットグループのリストを返すには

次の describe-subnet-groups` は、サブネットグループのリストを返します。

aws memorydb describe-subnet-groups

出力

{ "SubnetGroups": [ { "Name": "my-sg", "Description": "pat-sg", "VpcId": "vpc-86xxx4fc", "Subnets": [ { "Identifier": "subnet-faxx84a6", "AvailabilityZone": { "Name": "us-east-1b" } }, { "Identifier": "subnet-56xxf61b", "AvailabilityZone": { "Name": "us-east-1a" } } ], "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:subnetgroup/my-sg" } ] }

詳細については、MemoryDB ユーザーガイドの「サブネットとサブネットグループ」を参照してください。 MemoryDB

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

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

AWS CLI

ユーザーのリストを返すには

次の describe-users` は、ユーザーのリストを返します。

aws memorydb describe-users

出力

{ "Users": [ { "Name": "default", "Status": "active", "AccessString": "on ~* &* +@all", "ACLNames": [ "open-access" ], "MinimumEngineVersion": "6.0", "Authentication": { "Type": "no-password" }, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:user/default" }, { "Name": "my-user", "Status": "active", "AccessString": "off ~objects:* ~items:* ~public:* resetchannels -@all", "ACLNames": [], "MinimumEngineVersion": "6.2", "Authentication": { "Type": "password", "PasswordCount": 2 }, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:user/my-user" } ] }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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

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

AWS CLI

シャードをフェイルオーバーするには

次のフェイルオーバーシャードは、シャードで失敗します。

aws memorydb failover-shard \ --cluster-name my-cluster --shard-name 0001

出力:

{ "Cluster": { "Name": "my-cluster", "Status": "available", "NumberOfShards": 2, "ClusterEndpoint": { "Address": "clustercfg.my-cluster.xxxxxx.memorydb.us-east-1.amazonaws.com", "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "default.memorydb-redis6", "ParameterGroupStatus": "in-sync", "SecurityGroups": [ { "SecurityGroupId": "sg-0a143xxxx45c9fae", "Status": "active" } ], "SubnetGroupName": "my-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:cluster/my-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "wed:03:00-wed:04:00", "SnapshotWindow": "04:30-05:30", "AutoMinorVersionUpgrade": true } }

詳細については、MemoryDB ユーザーガイドのMultiAZ によるダウンタイムの最小化」を参照してください。 MemoryDB

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

次の例は、list-allowed-node-type-updates を使用する方法を説明しています。

AWS CLI

許可されたノードタイプの更新のリストを返すには

次の list-allowed-node-type-updates は、使用可能なノードタイプの更新のリストを返します。

aws memorydb list-allowed-node-type-updates

出力:

{ "Cluster": { "Name": "my-cluster", "Status": "available", "NumberOfShards": 2, "ClusterEndpoint": { "Address": "clustercfg.my-cluster.xxxxxx.memorydb.us-east-1.amazonaws.com", "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "default.memorydb-redis6", "ParameterGroupStatus": "in-sync", "SecurityGroups": [ { "SecurityGroupId": "sg-0a143xxxx45c9fae", "Status": "active" } ], "SubnetGroupName": "my-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:cluster/my-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "wed:03:00-wed:04:00", "SnapshotWindow": "04:30-05:30", "AutoMinorVersionUpgrade": true } }

詳細については、MemoryDB ユーザーガイドの「スケーリング」を参照してください。 MemoryDB

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

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

AWS CLI

タグのリストを返すには

次の list-tags はタグのリストを返します。

aws memorydb list-tags \ --resource-arn arn:aws:memorydb:us-east-1:491658xxxxxx:cluster/my-cluster

出力:

{ "TagList": [ { "Key": "mytag", "Value": "myvalue" } ] }

詳細については、MemoryDB ユーザーガイドの「リソースのタグ付け」を参照してください。 MemoryDB

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

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

AWS CLI

パラメータグループをリセットするには

次の reset-parameter-group` はパラメータグループをリセットします。

aws memorydb reset-parameter-group \ --parameter-group-name my-parameter-group \ --all-parameters

出力:

{ "ParameterGroup": { "Name": "my-parameter-group", "Family": "memorydb_redis6", "Description": "my parameter group", "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:parametergroup/my-parameter-group" } }

詳細については、MemoryDB ユーザーガイドの「パラメータグループを使用したエンジンパラメータの設定」を参照してください。

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

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

AWS CLI

リソースにタグを付けるには

次の tag-resource` は、リソースにタグを追加します。

aws memorydb tag-resource \ --resource-arn arn:aws:memorydb:us-east-1:491658xxxxxx:cluster/my-cluster \ --tags Key="mykey",Value="myvalue"

出力:

{ "TagList": [ { "Key": "mytag", "Value": "myvalue" }, { "Key": "mykey", "Value": "myvalue" } ] }

詳細については、MemoryDB ユーザーガイドの「リソースのタグ付け」を参照してください。 MemoryDB

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

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

AWS CLI

を更新するには ACL

次の update-acl` ACLは、ユーザーを追加して を更新します。

aws memorydb untag-resource \ --resource-arn arn:aws:memorydb:us-east-1:491658xxxxx:cluster/my-cluster \ --tag-keys mykey

出力:

{ "TagList": [ { "Key": "mytag", "Value": "myvalue" } ] }

詳細については、MemoryDB ユーザーガイドの「リソースのタグ付け」を参照してください。 MemoryDB

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

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

AWS CLI

クラスターを更新するには

次の update-cluster`` は、クラスターのパラメータグループを に更新します my-parameter-group。

aws memorydb update-cluster \ --cluster-name my-cluster \ --parameter-group-name my-parameter-group

出力:

{ "Cluster": { "Name": "my-cluster", "Status": "available", "NumberOfShards": 2, "AvailabilityMode": "MultiAZ", "ClusterEndpoint": { "Address": "clustercfg.my-cluster.llru6f.memorydb.us-east-1.amazonaws.com", "Port": 6379 }, "NodeType": "db.r6g.large", "EngineVersion": "6.2", "EnginePatchVersion": "6.2.6", "ParameterGroupName": "my-parameter-group", "ParameterGroupStatus": "in-sync", "SecurityGroups": [ { "SecurityGroupId": "sg-0a143xxxxxc9fae", "Status": "active" } ], "SubnetGroupName": "pat-sg", "TLSEnabled": true, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:cluster/my-cluster", "SnapshotRetentionLimit": 0, "MaintenanceWindow": "wed:03:00-wed:04:00", "SnapshotWindow": "04:30-05:30", "ACLName": "my-acl", "AutoMinorVersionUpgrade": true } }

詳細については、MemoryDB ユーザーガイドの「クラスターの変更」を参照してください。 MemoryDB

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

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

AWS CLI

パラメータグループを更新するには

次の update-parameter-group`` はパラメータグループを更新します。

aws memorydb update-parameter-group \ --parameter-group-name my-parameter-group \ --parameter-name-values "ParameterName=activedefrag, ParameterValue=no"

出力:

{ "ParameterGroup": { "Name": "my-parameter-group", "Family": "memorydb_redis6", "Description": "my parameter group", "ARN": "arn:aws:memorydb:us-east-1:49165xxxxxx:parametergroup/my-parameter-group" } }

詳細については、MemoryDB ユーザーガイドの「パラメータグループの変更」を参照してください。 MemoryDB

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

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

AWS CLI

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

次の update-subnet-group` は、サブネットグループのサブネット ID を更新します。

aws memorydb update-subnet-group \ --subnet-group-name my-sg \ --subnet-ids subnet-01f29d458f3xxxxx

出力:

{ "SubnetGroup": { "Name": "my-sg-1", "Description": "my-sg", "VpcId": "vpc-09d2cfc01xxxxxxx", "Subnets": [ { "Identifier": "subnet-01f29d458fxxxxxx", "AvailabilityZone": { "Name": "us-east-1a" } } ], "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:subnetgroup/my-sg" } }

詳細については、MemoryDB ユーザーガイドの「サブネットとサブネットグループ」を参照してください。 MemoryDB

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

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

AWS CLI

ユーザーを更新するには

以下は、ユーザーのアクセス文字列update-userを変更します。

aws memorydb update-user \ --user-name my-user \ --access-string "off ~objects:* ~items:* ~public:* resetchannels -@all"

出力:

{ "User": { "Name": "my-user", "Status": "modifying", "AccessString": "off ~objects:* ~items:* ~public:* resetchannels -@all", "ACLNames": [ "myt-acl" ], "MinimumEngineVersion": "6.2", "Authentication": { "Type": "password", "PasswordCount": 2 }, "ARN": "arn:aws:memorydb:us-east-1:491658xxxxxx:user/my-user" } }

詳細については、MemoryDB ユーザーガイド「アクセスコントロールリストを使用したユーザーの認証」を参照してください。

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