

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

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

下列程式碼範例示範如何使用 AWS Command Line Interface 搭配 DAX 執行動作和實作常見案例。

*Actions* 是大型程式的程式碼摘錄，必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數，但您可以在其相關情境中查看內容中的動作。

每個範例均包含完整原始碼的連結，您可在連結中找到如何設定和執行內容中程式碼的相關指示。

**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 命令參考》**中的 [DescribeParameter](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)。