

# 使用 AWS CLI 的 DAX 示例
<a name="cli_dax_code_examples"></a>

以下代码示例演示如何通过将 AWS Command Line Interface与 DAX 结合使用，来执行操作和实现常见场景。

*操作是大型程序的代码摘录*，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

每个示例都包含一个指向完整源代码的链接，您可以从中找到有关如何在上下文中设置和运行代码的说明。

**Topics**
+ [操作](#actions)

## 操作
<a name="actions"></a>

### `create-cluster`
<a name="dax_CreateCluster_cli_topic"></a>

以下代码示例演示了如何使用 `create-cluster`。

**AWS CLI**  
**创建 DAX 集群**  
以下 `create-cluster` 示例创建具有指定设置的 DAX 集群。  

```
aws dax create-cluster \
    --cluster-name daxcluster \
    --node-type dax.r4.large \
    --replication-factor 3 \
    --iam-role-arn roleARN  \
    --sse-specification Enabled=true
```
输出：  

```
{
    "Cluster": {
        "ClusterName": "daxcluster",
        "ClusterArn": "arn:aws:dax:us-west-2:123456789012:cache/daxcluster",
        "TotalNodes": 3,
        "ActiveNodes": 0,
        "NodeType": "dax.r4.large",
        "Status": "creating",
        "ClusterDiscoveryEndpoint": {
            "Port": 8111
        },
        "PreferredMaintenanceWindow": "thu:13:00-thu:14:00",
        "SubnetGroup": "default",
        "SecurityGroups": [
            {
                "SecurityGroupIdentifier": "sg-1af6e36e",
                "Status": "active"
            }
        ],
        "IamRoleArn": "arn:aws:iam::123456789012:role/DAXServiceRoleForDynamoDBAccess",
        "ParameterGroup": {
            "ParameterGroupName": "default.dax1.0",
            "ParameterApplyStatus": "in-sync",
            "NodeIdsToReboot": []
        },
        "SSEDescription": {
            "Status": "ENABLED"
        }
    }
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[步骤 3：创建 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.create-cluster.cli.create-cluster.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/create-cluster.html)。

### `create-parameter-group`
<a name="dax_CreateParameterGroup_cli_topic"></a>

以下代码示例演示了如何使用 `create-parameter-group`。

**AWS CLI**  
**创建参数组**  
以下“create-parameter-group”示例创建一个具有指定设置的参数组。  

```
aws dax create-parameter-group \
    --parameter-group-name daxparametergroup \
    --description "A new parameter group"
```
输出：  

```
{
    "ParameterGroup": {
        "ParameterGroupName": "daxparametergroup",
        "Description": "A new parameter group"
    }
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.cluster-management.custom-settings.ttl)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateParameterGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/create-parameter-group.html)。

### `create-subnet-group`
<a name="dax_CreateSubnetGroup_cli_topic"></a>

以下代码示例演示了如何使用 `create-subnet-group`。

**AWS CLI**  
**创建 DAX 子网组**  
以下 `create-subnet-group` 示例创建具有指定设置的子网组。  

```
aws dax create-subnet-group \
    --subnet-group-name daxSubnetGroup \
    --subnet-ids subnet-11111111 subnet-22222222
```
输出：  

```
{
    "SubnetGroup": {
        "SubnetGroupName": "daxSubnetGroup",
        "VpcId": "vpc-05a1fa8e00c325226",
        "Subnets": [
            {
                "SubnetIdentifier": "subnet-11111111",
                "SubnetAvailabilityZone": "us-west-2b"
            },
            {
                "SubnetIdentifier": "subnet-22222222",
                "SubnetAvailabilityZone": "us-west-2c"
            }
        ]
    }
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[步骤 2：创建子网组](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.create-cluster.cli.create-subnet-group.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [CreateSubnetGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/create-subnet-group.html)。

### `decrease-replication-factor`
<a name="dax_DecreaseReplicationFactor_cli_topic"></a>

以下代码示例演示了如何使用 `decrease-replication-factor`。

**AWS CLI**  
**从集群移除一个或多个节点**  
以下 `decrease-replication-factor` 示例将指定 DAX 集群中节点的数量减少到一个。  

```
aws dax decrease-replication-factor \
    --cluster-name daxcluster \
    --new-replication-factor 1
```
输出：  

```
{
    "Cluster": {
        "ClusterName": "daxcluster",
        "ClusterArn": "arn:aws:dax:us-west-2:123456789012:cache/daxcluster",
        "TotalNodes": 3,
        "ActiveNodes": 3,
        "NodeType": "dax.r4.large",
        "Status": "modifying",
        "ClusterDiscoveryEndpoint": {
            "Address": "daxcluster.ey3o9d.clustercfg.dax.usw2.cache.amazonaws.com",
            "Port": 8111
        },
        "Nodes": [
            {
                "NodeId": "daxcluster-a",
                "Endpoint": {
                    "Address": "daxcluster-a.ey3o9d.0001.dax.usw2.cache.amazonaws.com",
                    "Port": 8111
                },
                "NodeCreateTime": 1576625059.509,
                "AvailabilityZone": "us-west-2c",
                "NodeStatus": "available",
                "ParameterGroupStatus": "in-sync"
            },
            {
                "NodeId": "daxcluster-b",
                "Endpoint": {
                    "Address": "daxcluster-b.ey3o9d.0001.dax.usw2.cache.amazonaws.com",
                    "Port": 8111
                },
                "NodeCreateTime": 1576625059.509,
                "AvailabilityZone": "us-west-2a",
                "NodeStatus": "available",
                "ParameterGroupStatus": "in-sync"
            },
            {
                "NodeId": "daxcluster-c",
                "Endpoint": {
                    "Address": "daxcluster-c.ey3o9d.0001.dax.usw2.cache.amazonaws.com",
                    "Port": 8111
                },
                "NodeCreateTime": 1576625059.509,
                "AvailabilityZone": "us-west-2b",
                "NodeStatus": "available",
                "ParameterGroupStatus": "in-sync"
            }
        ],
        "PreferredMaintenanceWindow": "thu:13:00-thu:14:00",
        "SubnetGroup": "default",
        "SecurityGroups": [
            {
                "SecurityGroupIdentifier": "sg-1af6e36e",
                "Status": "active"
            }
        ],
        "IamRoleArn": "arn:aws:iam::123456789012:role/DAXServiceRoleForDynamoDBAccess",
        "ParameterGroup": {
            "ParameterGroupName": "default.dax1.0",
            "ParameterApplyStatus": "in-sync",
            "NodeIdsToReboot": []
        },
        "SSEDescription": {
            "Status": "ENABLED"
        }
    }
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.cluster-management.custom-settings)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DecreaseReplicationFactor](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/decrease-replication-factor.html)。

### `delete-cluster`
<a name="dax_DeleteCluster_cli_topic"></a>

以下代码示例演示了如何使用 `delete-cluster`。

**AWS CLI**  
**删除 DAX 集群**  
以下 `delete-cluster` 示例删除指定的 DAX 集群。  

```
aws dax delete-cluster \
    --cluster-name daxcluster
```
输出：  

```
{
    "Cluster": {
        "ClusterName": "daxcluster",
        "ClusterArn": "arn:aws:dax:us-west-2:123456789012:cache/daxcluster",
        "TotalNodes": 3,
        "ActiveNodes": 0,
        "NodeType": "dax.r4.large",
        "Status": "deleting",
        "ClusterDiscoveryEndpoint": {
            "Address": "dd.ey3o9d.clustercfg.dax.usw2.cache.amazonaws.com",
            "Port": 8111
        },
        "PreferredMaintenanceWindow": "fri:06:00-fri:07:00",
        "SubnetGroup": "default",
        "SecurityGroups": [
            {
                "SecurityGroupIdentifier": "sg-1af6e36e",
                "Status": "active"
            }
        ],
        "IamRoleArn": "arn:aws:iam::123456789012:role/DAXServiceRoleForDynamoDBAccess",
        "ParameterGroup": {
            "ParameterGroupName": "default.dax1.0",
            "ParameterApplyStatus": "in-sync",
            "NodeIdsToReboot": []
        },
        "SSEDescription": {
            "Status": "ENABLED"
        }
    }
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.cluster-management.deleting)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeleteCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/delete-cluster.html)。

### `delete-parameter-group`
<a name="dax_DeleteParameterGroup_cli_topic"></a>

以下代码示例演示了如何使用 `delete-parameter-group`。

**AWS CLI**  
**删除参数组**  
以下 `delete-parameter-group` 示例删除指定的 DAX 参数组。  

```
aws dax  delete-parameter-group \
    --parameter-group-name daxparametergroup
```
输出：  

```
{
    "DeletionMessage": "Parameter group daxparametergroup has been deleted."
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeleteParameterGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/delete-parameter-group.html)。

### `delete-subnet-group`
<a name="dax_DeleteSubnetGroup_cli_topic"></a>

以下代码示例演示了如何使用 `delete-subnet-group`。

**AWS CLI**  
**删除子网组**  
以下 `delete-subnet-group` 示例删除指定的 DAX 子网组。  

```
aws dax delete-subnet-group \
    --subnet-group-name daxSubnetGroup
```
输出：  

```
{
    "DeletionMessage": "Subnet group daxSubnetGroup has been deleted."
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DeleteSubnetGroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/delete-subnet-group.html)。

### `describe-clusters`
<a name="dax_DescribeClusters_cli_topic"></a>

以下代码示例演示了如何使用 `describe-clusters`。

**AWS CLI**  
**返回有关所有预置 DAX 集群的信息**  
以下 `describe-clusters` 示例显示有关所有预置 DAX 集群的详细信息。  

```
aws dax describe-clusters
```
输出：  

```
{
    "Clusters": [
        {
            "ClusterName": "daxcluster",
            "ClusterArn": "arn:aws:dax:us-west-2:123456789012:cache/daxcluster",
            "TotalNodes": 1,
            "ActiveNodes": 1,
            "NodeType": "dax.r4.large",
            "Status": "available",
            "ClusterDiscoveryEndpoint": {
                "Address": "daxcluster.ey3o9d.clustercfg.dax.usw2.cache.amazonaws.com",
                "Port": 8111
            },
            "Nodes": [
                {
                    "NodeId": "daxcluster-a",
                    "Endpoint": {
                        "Address": "daxcluster-a.ey3o9d.0001.dax.usw2.cache.amazonaws.com",
                        "Port": 8111
                    },
                    "NodeCreateTime": 1576625059.509,
                    "AvailabilityZone": "us-west-2c",
                    "NodeStatus": "available",
                    "ParameterGroupStatus": "in-sync"
                }
            ],
            "PreferredMaintenanceWindow": "thu:13:00-thu:14:00",
            "SubnetGroup": "default",
            "SecurityGroups": [
                {
                    "SecurityGroupIdentifier": "sg-1af6e36e",
                    "Status": "active"
                }
            ],
            "IamRoleArn": "arn:aws:iam::123456789012:role/DAXServiceRoleForDynamoDBAccess",
            "ParameterGroup": {
                "ParameterGroupName": "default.dax1.0",
                "ParameterApplyStatus": "in-sync",
                "NodeIdsToReboot": []
            },
            "SSEDescription": {
                "Status": "ENABLED"
            }
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DescribeClusters](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/describe-clusters.html)。

### `describe-default-parameters`
<a name="dax_DescribeDefaultParameters_cli_topic"></a>

以下代码示例演示了如何使用 `describe-default-parameters`。

**AWS CLI**  
**返回 DAX 的默认系统参数信息**  
以下 `describe-default-parameters` 示例显示 DAX 的默认系统参数信息。  

```
aws dax describe-default-parameters
```
输出：  

```
{
    "Parameters": [
        {
            "ParameterName": "query-ttl-millis",
            "ParameterType": "DEFAULT",
            "ParameterValue": "300000",
            "NodeTypeSpecificValues": [],
            "Description": "Duration in milliseconds for queries to remain cached",
            "Source": "user",
            "DataType": "integer",
            "AllowedValues": "0-",
            "IsModifiable": "TRUE",
            "ChangeType": "IMMEDIATE"
        },
        {
            "ParameterName": "record-ttl-millis",
            "ParameterType": "DEFAULT",
            "ParameterValue": "300000",
            "NodeTypeSpecificValues": [],
            "Description": "Duration in milliseconds for records to remain valid in cache (Default: 0 = infinite)",
            "Source": "user",
            "DataType": "integer",
            "AllowedValues": "0-",
            "IsModifiable": "TRUE",
            "ChangeType": "IMMEDIATE"
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DescribeDefaultParameters](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/describe-default-parameters.html)。

### `describe-events`
<a name="dax_DescribeEvents_cli_topic"></a>

以下代码示例演示了如何使用 `describe-events`。

**AWS CLI**  
**返回与 DAX 集群和参数组相关的所有事件**  
以下 `describe-events` 示例显示与 DAX 集群和参数组相关的事件的详细信息。  

```
aws dax describe-events
```
输出：  

```
{
    "Events": [
        {
            "SourceName": "daxcluster",
            "SourceType": "CLUSTER",
            "Message": "Cluster deleted.",
            "Date": 1576702736.706
        },
        {
            "SourceName": "daxcluster",
            "SourceType": "CLUSTER",
            "Message": "Removed node daxcluster-b.",
            "Date": 1576702691.738
        },
        {
            "SourceName": "daxcluster",
            "SourceType": "CLUSTER",
            "Message": "Removed node daxcluster-a.",
            "Date": 1576702633.498
        },
        {
            "SourceName": "daxcluster",
            "SourceType": "CLUSTER",
            "Message": "Removed node daxcluster-c.",
            "Date": 1576702631.329
        },
        {
            "SourceName": "daxcluster",
            "SourceType": "CLUSTER",
            "Message": "Cluster created.",
            "Date": 1576626560.057
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DescribeEvents](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/describe-events.html)。

### `describe-parameter-groups`
<a name="dax_DescribeParameterGroups_cli_topic"></a>

以下代码示例演示了如何使用 `describe-parameter-groups`。

**AWS CLI**  
**描述 DAX 中定义的参数组**  
以下 `describe-parameter-groups` 示例检索 DAX 中定义的参数组的详细信息。  

```
aws dax describe-parameter-groups
```
输出：  

```
{
    "ParameterGroups": [
        {
            "ParameterGroupName": "default.dax1.0",
            "Description": "Default parameter group for dax1.0"
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DescribeParameterGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/describe-parameter-groups.html)。

### `describe-parameters`
<a name="dax_DescribeParameters_cli_topic"></a>

以下代码示例演示了如何使用 `describe-parameters`。

**AWS CLI**  
**描述 DAX 参数组中定义的参数**  
以下 `describe-parameters` 示例检索指定 DAX 参数组中定义的参数的详细信息。  

```
aws dax describe-parameters \
    --parameter-group-name default.dax1.0
```
输出：  

```
{
    "Parameters": [
        {
            "ParameterName": "query-ttl-millis",
            "ParameterType": "DEFAULT",
            "ParameterValue": "300000",
            "NodeTypeSpecificValues": [],
            "Description": "Duration in milliseconds for queries to remain cached",
            "Source": "user",
            "DataType": "integer",
            "AllowedValues": "0-",
            "IsModifiable": "TRUE",
            "ChangeType": "IMMEDIATE"
        },
        {
            "ParameterName": "record-ttl-millis",
            "ParameterType": "DEFAULT",
            "ParameterValue": "300000",
            "NodeTypeSpecificValues": [],
            "Description": "Duration in milliseconds for records to remain valid in cache (Default: 0 = infinite)",
            "Source": "user",
            "DataType": "integer",
            "AllowedValues": "0-",
            "IsModifiable": "TRUE",
            "ChangeType": "IMMEDIATE"
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DescribeParameters](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/describe-parameters.html)。

### `describe-subnet-groups`
<a name="dax_DescribeSubnetGroups_cli_topic"></a>

以下代码示例演示了如何使用 `describe-subnet-groups`。

**AWS CLI**  
**描述 DAX 中定义的子网组**  
以下 `describe-subnet-groups` 示例检索 DAX 中定义的子网组的详细信息。  

```
aws dax describe-subnet-groups
```
输出：  

```
{
    "SubnetGroups": [
        {
            "SubnetGroupName": "default",
            "Description": "Default CacheSubnetGroup",
            "VpcId": "vpc-ee70a196",
            "Subnets": [
                {
                    "SubnetIdentifier": "subnet-874953af",
                    "SubnetAvailabilityZone": "us-west-2d"
                },
                {
                    "SubnetIdentifier": "subnet-bd3d1fc4",
                    "SubnetAvailabilityZone": "us-west-2a"
                },
                {
                    "SubnetIdentifier": "subnet-72c2ff28",
                    "SubnetAvailabilityZone": "us-west-2c"
                },
                {
                    "SubnetIdentifier": "subnet-09e6aa42",
                    "SubnetAvailabilityZone": "us-west-2b"
                }
            ]
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.concepts.cluster.html#DAX.concepts.cluster.security)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [DescribeSubnetGroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/describe-subnet-groups.html)。

### `increase-replication-factor`
<a name="dax_IncreaseReplicationFactor_cli_topic"></a>

以下代码示例演示了如何使用 `increase-replication-factor`。

**AWS CLI**  
**提高 DAX 集群的复制系数**  
以下 `increase-replication-factor` 示例将指定 DAX 集群的复制系数增加到 3。  

```
aws dax increase-replication-factor \
    --cluster-name daxcluster \
    --new-replication-factor 3
```
输出：  

```
{
    "Cluster": {
        "ClusterName": "daxcluster",
        "ClusterArn": "arn:aws:dax:us-west-2:123456789012:cache/daxcluster",
        "TotalNodes": 3,
        "ActiveNodes": 1,
        "NodeType": "dax.r4.large",
        "Status": "modifying",
        "ClusterDiscoveryEndpoint": {
            "Address": "daxcluster.ey3o9d.clustercfg.dax.usw2.cache.amazonaws.com",
            "Port": 8111
        },
        "Nodes": [
            {
                "NodeId": "daxcluster-a",
                "Endpoint": {
                    "Address": "daxcluster-a.ey3o9d.0001.dax.usw2.cache.amazonaws.com",
                    "Port": 8111
                },
                "NodeCreateTime": 1576625059.509,
                "AvailabilityZone": "us-west-2c",
                "NodeStatus": "available",
                "ParameterGroupStatus": "in-sync"
            },
            {
                "NodeId": "daxcluster-b",
                "NodeStatus": "creating"
            },
            {
                "NodeId": "daxcluster-c",
                "NodeStatus": "creating"
            }
        ],
        "PreferredMaintenanceWindow": "thu:13:00-thu:14:00",
        "SubnetGroup": "default",
        "SecurityGroups": [
            {
                "SecurityGroupIdentifier": "sg-1af6e36e",
                "Status": "active"
            }
        ],
        "IamRoleArn": "arn:aws:iam::123456789012:role/DAXServiceRoleForDynamoDBAccess",
        "ParameterGroup": {
            "ParameterGroupName": "default.dax1.0",
            "ParameterApplyStatus": "in-sync",
            "NodeIdsToReboot": []
        },
        "SSEDescription": {
            "Status": "ENABLED"
        }
    }
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.cluster-management.custom-settings)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [IncreaseReplicationFactor](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/increase-replication-factor.html)。

### `list-tags`
<a name="dax_ListTags_cli_topic"></a>

以下代码示例演示了如何使用 `list-tags`。

**AWS CLI**  
**列出 DAX 资源上的标签**  
以下 `list-tags` 示例列出附加到指定 DAX 集群的标签键和值。  

```
aws dax list-tags \
    --resource-name arn:aws:dax:us-west-2:123456789012:cache/daxcluster
```
输出：  

```
{
    "Tags": [
        {
            "Key": "ClusterUsage",
            "Value": "prod"
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.management.tagging)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [ListTags](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/list-tags.html)。

### `tag-resource`
<a name="dax_TagResource_cli_topic"></a>

以下代码示例演示了如何使用 `tag-resource`。

**AWS CLI**  
**为 DAX 资源添加标签**  
以下 `tag-resource` 示例将指定的标签键名和关联值附加到指定的 DAX 集群，以描述集群的使用情况。  

```
aws dax tag-resource \
    --resource-name arn:aws:dax:us-west-2:123456789012:cache/daxcluster \
    --tags="Key=ClusterUsage,Value=prod"
```
输出：  

```
{
    "Tags": [
        {
            "Key": "ClusterUsage",
            "Value": "prod"
        }
    ]
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.management.tagging)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/tag-resource.html)。

### `untag-resource`
<a name="dax_UntagResource_cli_topic"></a>

以下代码示例演示了如何使用 `untag-resource`。

**AWS CLI**  
**从 DAX 资源中移除标签**  
以下 `untag-resource` 示例从 DAX 集群中移除具有指定键名的标签。  

```
aws dax untag-resource  \
    --resource-name arn:aws:dax:us-west-2:123456789012:cache/daxcluster \
    --tag-keys="ClusterUsage"
```
输出：  

```
{
    "Tags": []
}
```
有关更多信息，请参阅《Amazon DynamoDB 开发人员指南》**中的[管理 DAX 集群](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.cluster-management.html#DAX.management.tagging)。  
+  有关 API 详细信息，请参阅《AWS CLI 命令参考》**中的 [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dax/untag-resource.html)。