

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

# 使用 的 Amazon EKS 範例 AWS CLI
<a name="cli_eks_code_examples"></a>

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

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

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

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

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

### `associate-access-policy`
<a name="eks_AssociateAccessPolicy_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-access-policy`。

**AWS CLI**  
**將存取政策及其範圍與叢集的存取項目相關聯**  
下列 `associate-access-policy` 會為存取政策及其範圍，與指定叢集的存取項目建立關聯。  

```
aws eks associate-access-policy \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:role/Admin \
    --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy \
    --access-scope type=namespace,namespaces=default
```
輸出：  

```
{
    "clusterName": "eks-customer",
    "principalArn": "arn:aws:iam::111122223333:role/Admin",
    "associatedAccessPolicy": {
        "policyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy",
        "accessScope": {
            "type": "namespace",
            "namespaces": [
                "default"
            ]
        },
        "associatedAt": "2025-05-24T15:59:51.981000-05:00",
        "modifiedAt": "2025-05-24T15:59:51.981000-05:00"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[將存取政策與存取項目相關聯](https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateAccessPolicy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/associate-access-policy.html)。

### `associate-encryption-config`
<a name="eks_AssociateEncryptionConfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-encryption-config`。

**AWS CLI**  
**將加密組態與現有叢集相關聯**  
下列 `associate-encryption-config` 範例會在尚未啟用加密的現有 EKS 叢集上啟用加密。  

```
aws eks associate-encryption-config \
    --cluster-name my-eks-cluster \
    --encryption-config '[{"resources":["secrets"],"provider":{"keyArn":"arn:aws:kms:region-code:account:key/key"}}]'
```
輸出：  

```
{
    "update": {
        "id": "3141b835-8103-423a-8e68-12c2521ffa4d",
        "status": "InProgress",
        "type": "AssociateEncryptionConfig",
        "params": [
            {
                "type": "EncryptionConfig",
                "value": "[{\"resources\":[\"secrets\"],\"provider\":{\"keyArn\":\"arn:aws:kms:region-code:account:key/key\"}}]"
            }
        ],
        "createdAt": "2024-03-14T11:01:26.297000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[在現有叢集上啟用秘密加密](https://docs.aws.amazon.com/eks/latest/userguide/enable-kms.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateEncryptionConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/associate-encryption-config.html)。

### `associate-identity-provider-config`
<a name="eks_AssociateIdentityProviderConfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `associate-identity-provider-config`。

**AWS CLI**  
**將身分提供者與您的 Amazon EKS 叢集相關聯**  
下列 `associate-identity-provider-config` 範例會為身分提供者與您的 Amazon EKS 叢集建立關聯。  

```
aws eks associate-identity-provider-config \
    --cluster-name my-eks-cluster \
    --oidc 'identityProviderConfigName=my-identity-provider,issuerUrl=https://oidc.eks.us-east-2.amazonaws.com/id/38D6A4619A0A69E342B113ED7F1A7652,clientId=kubernetes,usernameClaim=email,usernamePrefix=my-username-prefix,groupsClaim=my-claim,groupsPrefix=my-groups-prefix,requiredClaims={Claim1=value1,Claim2=value2}' \
    --tags env=dev
```
輸出：  

```
{
    "update": {
        "id": "8c6c1bef-61fe-42ac-a242-89412387b8e7",
        "status": "InProgress",
        "type": "AssociateIdentityProviderConfig",
        "params": [
            {
                "type": "IdentityProviderConfig",
                "value": "[{\"type\":\"oidc\",\"name\":\"my-identity-provider\"}]"
            }
        ],
        "createdAt": "2024-04-11T13:46:49.648000-04:00",
        "errors": []
    },
    "tags": {
        "env": "dev"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[從 OpenID Connect 身分提供者驗證叢集的使用者 - 關聯 OIDC 身分提供者](https://docs.aws.amazon.com/eks/latest/userguide/authenticate-oidc-identity-provider.html#associate-oidc-identity-provider)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [AssociateIdentityProviderConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/associate-identity-provider-config.html)。

### `create-access-entry`
<a name="eks_CreateAccessEntry_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-access-entry`。

**AWS CLI**  
**範例 1：建立 EKS 叢集的存取項目**  
下列 `create-access-entry` 範例會建立存取項目，允許 IAM 主體存取 EKS 叢集。  

```
aws eks create-access-entry \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:user/eks-user
```
輸出：  

```
{
    "accessEntry": {
        "clusterName": "eks-customer",
        "principalArn": "arn:aws:iam::111122223333:user/eks-user",
        "kubernetesGroups": [],
        "accessEntryArn": "arn:aws:eks:us-west-2:111122223333:access-entry/eks-customer/user/111122223333/eks-user/a1b2c3d4-5678-90ab-cdef-a6506e3d36p0",
        "createdAt": "2025-04-14T22:45:48.097000-05:00",
        "modifiedAt": "2025-04-14T22:45:48.097000-05:00",
        "tags": {},
        "username": "arn:aws:iam::111122223333:user/eks-user",
        "type": "STANDARD"
    }
}
```
如需詳細資訊，請參閱《Amazon EKS 使用者指南》**中的[建立存取項目](https://docs.aws.amazon.com/eks/latest/userguide/creating-access-entries.html)。  
**範例 2：透過指定存取項目的類型，建立 EKS 叢集的存取項目**  
下列 `create-access-entry` 範例會在 EKS 叢集中建 `EC2_LINUX` 類型的存取項目。根據預設，建立類型 `STANDARD` 存取項目。除了預設值外，如果我們指定其他任何存取項目類型，則需要在 CLI 中傳遞 IAM 角色 ARN。  

```
aws eks create-access-entry \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:role/admin-test-ip \
    --type EC2_LINUX
```
輸出：  

```
{
    "accessEntry": {
        "clusterName": "eks-customer",
        "principalArn": "arn:aws:iam::111122223333:role/admin-test-ip",
        "kubernetesGroups": [
            "system:nodes"
        ],
        "accessEntryArn": "arn:aws:eks:us-west-2:111122223333:access-entry/eks-customer/role/111122223333/admin-test-ip/accb5418-f493-f390-3e6e-c3f19f725fcp",
        "createdAt": "2025-05-06T19:42:45.453000-05:00",
        "modifiedAt": "2025-05-06T19:42:45.453000-05:00",
        "tags": {},
        "username": "system:node:{{EC2PrivateDNSName}}",
        "type": "EC2_LINUX"
    }
}
```
如需詳細資訊，請參閱《Amazon EKS 使用者指南》**中的[建立存取項目](https://docs.aws.amazon.com/eks/latest/userguide/creating-access-entries.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateAccessEntry](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-access-entry.html)。

### `create-addon`
<a name="eks_CreateAddon_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-addon`。

**AWS CLI**  
**範例 1：使用個別 EKS 叢集版本的預設相容版本建立 Amazon EKS 附加元件**  
下列`create-addon`範例命令會使用個別 EKS 叢集版本的預設相容版本來建立 Amazon EKS 附加元件。  

```
aws eks create-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon \
    --service-account-role-arn arn:aws:iam::111122223333:role/role-name
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "CREATING",
        "addonVersion": "v1.15.1-eksbuild.1",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/1ec71ee1-b9c2-8915-4e17-e8be0a55a149",
        "createdAt": "2024-03-14T12:20:03.264000-04:00",
        "modifiedAt": "2024-03-14T12:20:03.283000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
**範例 2：使用特定附加元件版本，建立 Amazon EKS 附加元件**  
下列 `create-addon` 範例命令會建立具有特定附加元件版本的 Amazon EKS 附加元件。  

```
aws eks create-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon \
    --service-account-role-arn arn:aws:iam::111122223333:role/role-name \
    --addon-version v1.16.4-eksbuild.2
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "CREATING",
        "addonVersion": "v1.16.4-eksbuild.2",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/34c71ee6-7738-6c8b-c6bd-3921a176b5ff",
        "createdAt": "2024-03-14T12:30:24.507000-04:00",
        "modifiedAt": "2024-03-14T12:30:24.521000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
**範例 3：使用自訂組態值建立 Amazon EKS 附加元件，並解決衝突詳細資訊**  
下列 `create-addon` 範例命令會使用自訂組態值建立 Amazon EKS 附加元件，並解決衝突詳細資訊。  

```
aws eks create-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon \
    --service-account-role-arn arn:aws:iam::111122223333:role/role-name \
    --addon-version v1.16.4-eksbuild.2 \
    --configuration-values '{"resources":{"limits":{"cpu":"100m"}}}' \
    --resolve-conflicts OVERWRITE
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "CREATING",
        "addonVersion": "v1.16.4-eksbuild.2",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/a6c71ee9-0304-9237-1be8-25af1b0f1ffb",
        "createdAt": "2024-03-14T12:35:58.313000-04:00",
        "modifiedAt": "2024-03-14T12:35:58.327000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "tags": {},
        "configurationValues": "{\"resources\":{\"limits\":{\"cpu\":\"100m\"}}}"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
**範例 4：使用自訂 JSON 組態值檔案，建立 Amazon EKS 附加元件**  
下列 `create-addon` 範例命令會使用自訂組態值建立 Amazon EKS 附加元件，並解決衝突詳細資訊。  

```
aws eks create-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon \
    --service-account-role-arn arn:aws:iam::111122223333:role/role-name \
    --addon-version v1.16.4-eksbuild.2 \
    --configuration-values 'file://configuration-values.json' \
    --resolve-conflicts OVERWRITE \
    --tags '{"eks-addon-key-1": "value-1" , "eks-addon-key-2": "value-2"}'
```
`configuration-values.json` 的內容：  

```
{
    "resources": {
        "limits": {
            "cpu": "150m"
        }
    },
    "env": {
        "AWS_VPC_K8S_CNI_LOGLEVEL": "ERROR"
    }
}
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "CREATING",
        "addonVersion": "v1.16.4-eksbuild.2",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/d8c71ef8-fbd8-07d0-fb32-6a7be19ececd",
        "createdAt": "2024-03-14T13:10:51.763000-04:00",
        "modifiedAt": "2024-03-14T13:10:51.777000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "tags": {
            "eks-addon-key-1": "value-1",
            "eks-addon-key-2": "value-2"
        },
        "configurationValues": "{\n    \"resources\": {\n        \"limits\": {\n            \"cpu\": \"150m\"\n        }\n    },\n    \"env\": {\n        \"AWS_VPC_K8S_CNI_LOGLEVEL\": \"ERROR\"\n    }\n}"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
**範例 5：使用自訂 YAML 組態值檔案，建立 Amazon EKS 附加元件**  
下列 `create-addon` 範例命令會使用自訂組態值建立 Amazon EKS 附加元件，並解決衝突詳細資訊。  

```
aws eks create-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon \
    --service-account-role-arn arn:aws:iam::111122223333:role/role-name \
    --addon-version v1.16.4-eksbuild.2 \
    --configuration-values 'file://configuration-values.yaml' \
    --resolve-conflicts OVERWRITE \
    --tags '{"eks-addon-key-1": "value-1" , "eks-addon-key-2": "value-2"}'
```
`configuration-values.yaml` 的內容：  

```
resources:
    limits:
        cpu: '100m'
env:
    AWS_VPC_K8S_CNI_LOGLEVEL: 'DEBUG'
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "CREATING",
        "addonVersion": "v1.16.4-eksbuild.2",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/d4c71efb-3909-6f36-a548-402cd4b5d59e",
        "createdAt": "2024-03-14T13:15:45.220000-04:00",
        "modifiedAt": "2024-03-14T13:15:45.237000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "tags": {
            "eks-addon-key-3": "value-3",
            "eks-addon-key-4": "value-4"
        },
        "configurationValues": "resources:\n    limits:\n        cpu: '100m'\nenv:\n    AWS_VPC_K8S_CNI_LOGLEVEL: 'INFO'"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateAddon](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-addon.html)。

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

以下程式碼範例顯示如何使用 `create-cluster`。

**AWS CLI**  
**建立新的叢集**  
此範例命令會在您的預設區域中，建立名為 `prod` 的叢集。  
命令：  

```
aws eks create-cluster --name prod \
--role-arn arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI \
--resources-vpc-config subnetIds=subnet-6782e71e,subnet-e7e761ac,securityGroupIds=sg-6979fe18
```
輸出：  

```
{
    "cluster": {
        "name": "prod",
        "arn": "arn:aws:eks:us-west-2:012345678910:cluster/prod",
        "createdAt": 1527808069.147,
        "version": "1.10",
        "roleArn": "arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI",
        "resourcesVpcConfig": {
            "subnetIds": [
                "subnet-6782e71e",
                "subnet-e7e761ac"
            ],
            "securityGroupIds": [
                "sg-6979fe18"
            ],
            "vpcId": "vpc-950809ec"
        },
        "status": "CREATING",
        "certificateAuthority": {}
    }
}
```
**建立啟用私有端點存取和記錄的新叢集**  
此範例命令會在預設區域中建立名為 `example` 的叢集，並停用公有端點存取、啟用私有端點存取，以及啟用所有記錄類型。  
命令：  

```
aws eks create-cluster --name example --kubernetes-version 1.12 \
--role-arn arn:aws:iam::012345678910:role/example-cluster-ServiceRole-1XWBQWYSFRE2Q \
--resources-vpc-config subnetIds=subnet-0a188dccd2f9a632f,subnet-09290d93da4278664,subnet-0f21dd86e0e91134a,subnet-0173dead68481a583,subnet-051f70a57ed6fcab6,subnet-01322339c5c7de9b4,securityGroupIds=sg-0c5b580845a031c10,endpointPublicAccess=false,endpointPrivateAccess=true \
--logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'
```
輸出：  

```
{
    "cluster": {
        "name": "example",
        "arn": "arn:aws:eks:us-west-2:012345678910:cluster/example",
        "createdAt": 1565804921.901,
        "version": "1.12",
        "roleArn": "arn:aws:iam::012345678910:role/example-cluster-ServiceRole-1XWBQWYSFRE2Q",
        "resourcesVpcConfig": {
            "subnetIds": [
                "subnet-0a188dccd2f9a632f",
                "subnet-09290d93da4278664",
                "subnet-0f21dd86e0e91134a",
                "subnet-0173dead68481a583",
                "subnet-051f70a57ed6fcab6",
                "subnet-01322339c5c7de9b4"
            ],
            "securityGroupIds": [
                "sg-0c5b580845a031c10"
            ],
            "vpcId": "vpc-0f622c01f68d4afec",
            "endpointPublicAccess": false,
            "endpointPrivateAccess": true
        },
        "logging": {
            "clusterLogging": [
                {
                    "types": [
                        "api",
                        "audit",
                        "authenticator",
                        "controllerManager",
                        "scheduler"
                    ],
                    "enabled": true
                }
            ]
        },
        "status": "CREATING",
        "certificateAuthority": {},
        "platformVersion": "eks.3"
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-cluster.html)。

### `create-fargate-profile`
<a name="eks_CreateFargateProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-fargate-profile`。

**AWS CLI**  
**範例 1：為具有命名空間的選擇器建立 EKS Fargate 設定檔**  
下列 `create-fargate-profile` 範例會為具有命名空間的選擇器，建立 EKS Fargate 設定檔。  

```
aws eks create-fargate-profile \
    --cluster-name my-eks-cluster \
    --pod-execution-role-arn arn:aws:iam::111122223333:role/role-name \
    --fargate-profile-name my-fargate-profile \
    --selectors '[{"namespace": "default"}]'
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/a2c72bca-318e-abe8-8ed1-27c6d4892e9e",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-03-19T12:38:47.368000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "default"
            }
        ],
        "status": "CREATING",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的 [AWS Fargate 設定檔 - 建立 Fargate 設定檔](https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html#create-fargate-profile)。  
**範例 2：為具有命名空間和標籤的選擇器，建立 EKS Fargate 設定檔**  
下列 `create-fargate-profile` 範例會為具有命名空間和標籤的選擇器，建立 EKS Fargate 設定檔。  

```
aws eks create-fargate-profile \
    --cluster-name my-eks-cluster \
    --pod-execution-role-arn arn:aws:iam::111122223333:role/role-name \
    --fargate-profile-name my-fargate-profile \
    --selectors '[{"namespace": "default", "labels": {"labelname1": "labelvalue1"}}]'
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/88c72bc7-e8a4-fa34-44e4-2f1397224bb3",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-03-19T12:33:48.125000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "default",
                "labels": {
                    "labelname1": "labelvalue1"
                }
            }
        ],
        "status": "CREATING",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的 [AWS Fargate 設定檔 - 建立 Fargate 設定檔。](https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html#create-fargate-profile)  
**範例 3：為具有命名空間和標籤的選擇器，建立 EKS Fargate 設定檔，以及用於啟動 Pod 的子網路 ID。**  
下列 `create-fargate-profile` 範例會為具有命名空間和標籤的選擇器建立 EKS Fargate 設定檔，以及用於啟動 Pod 的子網路 ID。  

```
aws eks create-fargate-profile \
    --cluster-name my-eks-cluster \
    --pod-execution-role-arn arn:aws:iam::111122223333:role/role-name \
    --fargate-profile-name my-fargate-profile \
    --selectors '[{"namespace": "default", "labels": {"labelname1": "labelvalue1"}}]' \
    --subnets '["subnet-09d912bb63ef21b9a", "subnet-04ad87f71c6e5ab4d", "subnet-0e2907431c9988b72"]'
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/e8c72bc8-e87b-5eb6-57cb-ed4fe57577e3",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-03-19T12:35:58.640000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "default",
                "labels": {
                    "labelname1": "labelvalue1"
                }
            }
        ],
        "status": "CREATING",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的 [AWS Fargate 設定檔 - 建立 Fargate 設定檔。](https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html#create-fargate-profile)  
**範例 4：為具有多個命名空間和標籤的選擇器建立 EKS Fargate 設定檔，以及用於啟動 Pod 的子網路 ID。**  
下列 `create-fargate-profile` 範例會為具有多個命名空間和標籤的選擇器建立 EKS Fargate 設定檔，以及用於啟動 Pod 的子網路 ID。  

```
aws eks create-fargate-profile \
    --cluster-name my-eks-cluster \
    --pod-execution-role-arn arn:aws:iam::111122223333:role/role-name \
    --fargate-profile-name my-fargate-profile \
    --selectors '[{"namespace": "default1", "labels": {"labelname1": "labelvalue1", "labelname2": "labelvalue2"}}, {"namespace": "default2", "labels": {"labelname1": "labelvalue1", "labelname2": "labelvalue2"}}]' \
    --subnets '["subnet-09d912bb63ef21b9a", "subnet-04ad87f71c6e5ab4d", "subnet-0e2907431c9988b72"]' \
    --tags '{"eks-fargate-profile-key-1": "value-1" , "eks-fargate-profile-key-2": "value-2"}'
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/4cc72bbf-b766-8ee6-8d29-e62748feb3cd",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-03-19T12:15:55.271000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "default1",
                "labels": {
                    "labelname2": "labelvalue2",
                    "labelname1": "labelvalue1"
                }
            },
            {
                "namespace": "default2",
                "labels": {
                    "labelname2": "labelvalue2",
                    "labelname1": "labelvalue1"
                }
            }
        ],
        "status": "CREATING",
        "tags": {
            "eks-fargate-profile-key-2": "value-2",
            "eks-fargate-profile-key-1": "value-1"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的 [AWS Fargate 設定檔 - 建立 Fargate 設定檔。](https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html#create-fargate-profile)  
**範例 5：使用命名空間和標籤的萬用字元選擇器建立 EKS Fargate 設定檔，以及用於啟動 Pod 的子網路 ID。**  
下列 `create-fargate-profile` 範例會為具有多個命名空間和標籤的選擇器建立 EKS Fargate 設定檔，以及用於啟動 Pod 的子網路 ID。  

```
aws eks create-fargate-profile \
    --cluster-name my-eks-cluster \
    --pod-execution-role-arn arn:aws:iam::111122223333:role/role-name \
    --fargate-profile-name my-fargate-profile \
    --selectors '[{"namespace": "prod*", "labels": {"labelname*?": "*value1"}}, {"namespace": "*dev*", "labels": {"labelname*?": "*value*"}}]' \
    --subnets '["subnet-09d912bb63ef21b9a", "subnet-04ad87f71c6e5ab4d", "subnet-0e2907431c9988b72"]' \
    --tags '{"eks-fargate-profile-key-1": "value-1" , "eks-fargate-profile-key-2": "value-2"}'
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/e8c72bd6-5966-0bfe-b77b-1802893e5a6f",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-03-19T13:05:20.550000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "prod*",
                "labels": {
                    "labelname*?": "*value1"
                }
            },
            {
                "namespace": "*dev*",
                "labels": {
                    "labelname*?": "*value*"
                }
            }
        ],
        "status": "CREATING",
        "tags": {
            "eks-fargate-profile-key-2": "value-2",
            "eks-fargate-profile-key-1": "value-1"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的 [AWS Fargate 設定檔 - 建立 Fargate 設定檔。](https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html#create-fargate-profile)  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateFargateProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-fargate-profile.html)。

### `create-nodegroup`
<a name="eks_CreateNodegroup_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-nodegroup`。

**AWS CLI**  
**範例 1：為 Amazon EKS 叢集建立受管節點群組**  
下列 `create-nodegroup` 範例會為 Amazon EKS 叢集建立受管節點群組。  

```
aws eks create-nodegroup \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --node-role arn:aws:iam::111122223333:role/role-name \
    --subnets "subnet-0e2907431c9988b72" "subnet-04ad87f71c6e5ab4d" "subnet-09d912bb63ef21b9a" \
    --scaling-config minSize=1,maxSize=3,desiredSize=1 \
    --region us-east-2
```
輸出：  

```
{
    "nodegroup": {
        "nodegroupName": "my-eks-nodegroup",
        "nodegroupArn": "arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-nodegroup/bac7550f-b8b8-5fbb-4f3e-7502a931119e",
        "clusterName": "my-eks-cluster",
        "version": "1.26",
        "releaseVersion": "1.26.12-20240329",
        "createdAt": "2024-04-04T13:19:32.260000-04:00",
        "modifiedAt": "2024-04-04T13:19:32.260000-04:00",
        "status": "CREATING",
        "capacityType": "ON_DEMAND",
        "scalingConfig": {
            "minSize": 1,
            "maxSize": 3,
            "desiredSize": 1
        },
        "instanceTypes": [
            "t3.medium"
        ],
        "subnets": [
            "subnet-0e2907431c9988b72, subnet-04ad87f71c6e5ab4d, subnet-09d912bb63ef21b9a"
        ],
        "amiType": "AL2_x86_64",
        "nodeRole": "arn:aws:iam::111122223333:role/role-name",
        "diskSize": 20,
        "health": {
            "issues": []
        },
        "updateConfig": {
            "maxUnavailable": 1
        },
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html)。  
**範例 2：為具有自訂執行個體類型和磁碟大小的 Amazon EKS 叢集，建立受管節點群組**  
下列 `create-nodegroup` 範例會為具有自訂執行個體類型和磁碟大小的 Amazon EKS 叢集，建立受管節點群組。  

```
aws eks create-nodegroup \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --node-role arn:aws:iam::111122223333:role/role-name \
    --subnets "subnet-0e2907431c9988b72" "subnet-04ad87f71c6e5ab4d" "subnet-09d912bb63ef21b9a" \
    --scaling-config minSize=1,maxSize=3,desiredSize=1 \
    --capacity-type ON_DEMAND \
    --instance-types 'm5.large' \
    --disk-size 50 \
    --region us-east-2
```
輸出：  

```
{
    "nodegroup": {
        "nodegroupName": "my-eks-nodegroup",
        "nodegroupArn": "arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-nodegroup/c0c7551b-e4f9-73d9-992c-a450fdb82322",
        "clusterName": "my-eks-cluster",
        "version": "1.26",
        "releaseVersion": "1.26.12-20240329",
        "createdAt": "2024-04-04T13:46:07.595000-04:00",
        "modifiedAt": "2024-04-04T13:46:07.595000-04:00",
        "status": "CREATING",
        "capacityType": "ON_DEMAND",
        "scalingConfig": {
            "minSize": 1,
            "maxSize": 3,
            "desiredSize": 1
        },
        "instanceTypes": [
            "m5.large"
        ],
        "subnets": [
            "subnet-0e2907431c9988b72",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-09d912bb63ef21b9a"
        ],
        "amiType": "AL2_x86_64",
        "nodeRole": "arn:aws:iam::111122223333:role/role-name",
        "diskSize": 50,
        "health": {
            "issues": []
        },
        "updateConfig": {
            "maxUnavailable": 1
        },
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html)。  
**範例 3：為具有自訂執行個體類型、磁碟大小、ami 類型、容量類型、更新組態、標籤、污點和標籤的 Amazon EKS 叢集，建立受管節點群組。**  
範下列 `create-nodegroup` 範例會為具有自訂執行個體類型、磁碟大小、ami 類型、容量類型、更新組態、標籤、污點和標籤的 Amazon EKS 叢集，建立受管節點群組。  

```
aws eks create-nodegroup  \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --node-role arn:aws:iam::111122223333:role/role-name \
    --subnets "subnet-0e2907431c9988b72" "subnet-04ad87f71c6e5ab4d" "subnet-09d912bb63ef21b9a" \
    --scaling-config minSize=1,maxSize=5,desiredSize=4 \
    --instance-types 't3.large' \
    --disk-size 50 \
    --ami-type AL2_x86_64 \
    --capacity-type SPOT \
    --update-config maxUnavailable=2 \
    --labels '{"my-eks-nodegroup-label-1": "value-1" , "my-eks-nodegroup-label-2": "value-2"}' \
    --taints '{"key": "taint-key-1" , "value": "taint-value-1", "effect": "NO_EXECUTE"}' \
    --tags '{"my-eks-nodegroup-key-1": "value-1" , "my-eks-nodegroup-key-2": "value-2"}'
```
輸出：  

```
{
    "nodegroup": {
        "nodegroupName": "my-eks-nodegroup",
        "nodegroupArn": "arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-nodegroup/88c75524-97af-0cb9-a9c5-7c0423ab5314",
        "clusterName": "my-eks-cluster",
        "version": "1.26",
        "releaseVersion": "1.26.12-20240329",
        "createdAt": "2024-04-04T14:05:07.940000-04:00",
        "modifiedAt": "2024-04-04T14:05:07.940000-04:00",
        "status": "CREATING",
        "capacityType": "SPOT",
        "scalingConfig": {
            "minSize": 1,
            "maxSize": 5,
            "desiredSize": 4
        },
        "instanceTypes": [
            "t3.large"
        ],
        "subnets": [
            "subnet-0e2907431c9988b72",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-09d912bb63ef21b9a"
        ],
        "amiType": "AL2_x86_64",
        "nodeRole": "arn:aws:iam::111122223333:role/role-name",
        "labels": {
            "my-eks-nodegroup-label-2": "value-2",
            "my-eks-nodegroup-label-1": "value-1"
        },
        "taints": [
            {
                "key": "taint-key-1",
                "value": "taint-value-1",
                "effect": "NO_EXECUTE"
            }
        ],
        "diskSize": 50,
        "health": {
            "issues": []
        },
        "updateConfig": {
            "maxUnavailable": 2
        },
        "tags": {
            "my-eks-nodegroup-key-1": "value-1",
            "my-eks-nodegroup-key-2": "value-2"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [CreateNodegroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-nodegroup.html)。

### `create-pod-identity-association`
<a name="eks_CreatePodIdentityAssociation_cli_topic"></a>

以下程式碼範例顯示如何使用 `create-pod-identity-association`。

**AWS CLI**  
**範例 1：在 EKS 叢集中建立 EKS Pod 身分識別關聯**  
下列 `create-pod-identity-association` 範例會在 EKS 叢集中的服務帳戶，與 IAM 角色之間，建立 EKS Pod 身分識別關聯。  

```
aws eks create-pod-identity-association \
    --cluster-name eks-customer \
    --namespace default \
    --service-account default \
    --role-arn arn:aws:iam::111122223333:role/my-role
```
輸出：  

```
{
    "association": {
        "clusterName": "eks-customer",
        "namespace": "default",
        "serviceAccount": "default",
        "roleArn": "arn:aws:iam::111122223333:role/my-role",
        "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-8mvwvh57cu74mgcst",
        "associationId": "a-8mvwvh57cu74mgcst",
        "tags": {},
        "createdAt": "2025-05-24T19:40:13.961000-05:00",
        "modifiedAt": "2025-05-24T19:40:13.961000-05:00"
    }
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
**範例 2：在具有標籤的 EKS 叢集中，建立 EKS Pod 身分識別關聯**  
以下 `create-pod-identity-association` 會在服務帳戶與 EKS 叢集中具有標籤的 IAM 角色之間，建立 EKS Pod 身分識別關聯。  

```
aws eks create-pod-identity-association \
    --cluster-name eks-customer \
    --namespace default \
    --service-account default \
    --role-arn arn:aws:iam::111122223333:role/my-role \
    --tags Key1=value1,Key2=value2
```
輸出：  

```
{
    "association": {
        "clusterName": "eks-customer",
        "namespace": "default",
        "serviceAccount": "default",
        "roleArn": "arn:aws:iam::111122223333:role/my-role",
        "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-9njjin9gfghecgoda",
        "associationId": "a-9njjin9gfghecgoda",
        "tags": {
            "Key2": "value2",
            "Key1": "value1"
        },
        "createdAt": "2025-05-24T19:52:14.135000-05:00",
        "modifiedAt": "2025-05-24T19:52:14.135000-05:00"
    }
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [CreatePodIdentityAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/create-pod-identity-association.html)。

### `delete-access-entry`
<a name="eks_DeleteAccessEntry_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-access-entry`。

**AWS CLI**  
**刪除與叢集相關聯的存取項目**  
以下 `delete-access-entry` 會刪除與名為 `eks-customer` 的 EKS 叢集相關聯的存取項目。  

```
aws eks delete-access-entry \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:role/Admin
```
此命令不會產生輸出。  
如需詳細資訊，請參閱《Amazon EKS 使用者指南》**中的[刪除存取項目](https://docs.aws.amazon.com/eks/latest/userguide/deleting-access-entries.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteAccessEntry](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/delete-access-entry.html)。

### `delete-addon`
<a name="eks_DeleteAddon_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-addon`。

**AWS CLI**  
**範例 1. 刪除 Amazon EKS 附加元件，但保留 EKS 叢集上的附加元件軟體**  
下列 `delete-addon` 範例命令會刪除 Amazon EKS 附加元件，但會保留 EKS 叢集上的附加元件軟體。  

```
aws eks delete-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon \
    --preserve
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "DELETING",
        "addonVersion": "v1.9.3-eksbuild.7",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/a8c71ed3-944e-898b-9167-c763856af4b8",
        "createdAt": "2024-03-14T11:49:09.009000-04:00",
        "modifiedAt": "2024-03-14T12:03:49.776000-04:00",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱 *Amazon EKS* 中的[管理 Amazon EKS 附加元件 - 刪除附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#removing-an-add-on)。  
**範例 2. 刪除 Amazon EKS 附加元件，以及從 EKS 叢集刪除附加元件軟體**  
下列 `delete-addon` 範例命令會刪除 Amazon EKS 附加元件，也會從 EKS 叢集刪除附加元件軟體。  

```
aws eks delete-addon \
    --cluster-name my-eks-cluster \
    --addon-name my-eks-addon
```
輸出：  

```
{
    "addon": {
        "addonName": "my-eks-addon",
        "clusterName": "my-eks-cluster",
        "status": "DELETING",
        "addonVersion": "v1.15.1-eksbuild.1",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/bac71ed1-ec43-3bb6-88ea-f243cdb58954",
        "createdAt": "2024-03-14T11:45:31.983000-04:00",
        "modifiedAt": "2024-03-14T11:58:40.136000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱 *Amazon EKS* 中的[管理 Amazon EKS 附加元件 - 刪除附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#removing-an-add-on)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteAddon](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/delete-addon.html)。

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

以下程式碼範例顯示如何使用 `delete-cluster`。

**AWS CLI**  
**刪除 Amazon EKS 叢集控制平面**  
下列 `delete-cluster` 範例會刪除 Amazon EKS 叢集控制平面。  

```
aws eks delete-cluster \
    --name my-eks-cluster
```
輸出：  

```
{
    "cluster": {
        "name": "my-eks-cluster",
        "arn": "arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster",
        "createdAt": "2024-03-14T11:31:44.348000-04:00",
        "version": "1.27",
        "endpoint": "https://DALSJ343KE23J3RN45653DSKJTT647TYD.yl4.us-east-2.eks.amazonaws.com",
        "roleArn": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-cluster-ServiceRole-zMF6CBakwwbW",
        "resourcesVpcConfig": {
            "subnetIds": [
                "subnet-0fb75d2d8401716e7",
                "subnet-02184492f67a3d0f9",
                "subnet-04098063527aab776",
                "subnet-0e2907431c9988b72",
                "subnet-04ad87f71c6e5ab4d",
                "subnet-09d912bb63ef21b9a"
            ],
            "securityGroupIds": [
                "sg-0c1327f6270afbb36"
            ],
            "clusterSecurityGroupId": "sg-01c84d09d70f39a7f",
            "vpcId": "vpc-0012b8e1cc0abb17d",
            "endpointPublicAccess": true,
            "endpointPrivateAccess": true,
            "publicAccessCidrs": [
                "0.0.0.0/0"
            ]
        },
        "kubernetesNetworkConfig": {
            "serviceIpv4Cidr": "10.100.0.0/16",
            "ipFamily": "ipv4"
        },
        "logging": {
            "clusterLogging": [
                {
                    "types": [
                        "api",
                        "audit",
                        "authenticator",
                        "controllerManager",
                        "scheduler"
                    ],
                    "enabled": true
                }
            ]
        },
        "identity": {
            "oidc": {
                "issuer": "https://oidc.eks.us-east-2.amazonaws.com/id/DALSJ343KE23J3RN45653DSKJTT647TYD"
            }
        },
        "status": "DELETING",
        "certificateAuthority": {
            "data": "XXX_CA_DATA_XXX"
        },
        "platformVersion": "eks.16",
        "tags": {
            "aws:cloudformation:stack-name": "eksctl-my-eks-cluster-cluster",
            "alpha.eksctl.io/cluster-name": "my-eks-cluster",
            "karpenter.sh/discovery": "my-eks-cluster",
            "aws:cloudformation:stack-id": "arn:aws:cloudformation:us-east-2:111122223333:stack/eksctl-my-eks-cluster-cluster/e752ea00-e217-11ee-beae-0a9599c8c7ed",
            "auto-delete": "no",
            "eksctl.cluster.k8s.io/v1alpha1/cluster-name": "my-eks-cluster",
            "EKS-Cluster-Name": "my-eks-cluster",
            "alpha.eksctl.io/cluster-oidc-enabled": "true",
            "aws:cloudformation:logical-id": "ControlPlane",
            "alpha.eksctl.io/eksctl-version": "0.173.0-dev+a7ee89342.2024-03-01T03:40:57Z",
            "Name": "eksctl-my-eks-cluster-cluster/ControlPlane"
        },
        "accessConfig": {
            "authenticationMode": "API_AND_CONFIG_MAP"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[刪除 Amazon EKS 叢集](https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/delete-cluster.html)。

### `delete-fargate-profile`
<a name="eks_DeleteFargateProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-fargate-profile`。

**AWS CLI**  
**範例 1：為具有命名空間的選擇器建立 EKS Fargate 設定檔**  
下列 `delete-fargate-profile` 範例會為具有命名空間的選擇器，建立 EKS Fargate 設定檔。  

```
aws eks delete-fargate-profile \
    --cluster-name my-eks-cluster \
    --fargate-profile-name my-fargate-profile
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/1ac72bb3-3fc6-2631-f1e1-98bff53bed62",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-03-19T11:48:39.975000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/role-name",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "default",
                "labels": {
                    "foo": "bar"
                }
            }
        ],
        "status": "DELETING",
        "tags": {}
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的 [AWS Fargate 設定檔 - 刪除立 Fargate](https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html#delete-fargate-profile)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteFargateProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/delete-fargate-profile.html)。

### `delete-nodegroup`
<a name="eks_DeleteNodegroup_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-nodegroup`。

**AWS CLI**  
**範例 1：刪除 Amazon EKS 叢集的受管節點群組**  
下列 `delete-nodegroup` 範例會刪除 Amazon EKS 叢集的受管節點群組。  

```
aws eks delete-nodegroup \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup
```
輸出：  

```
{
    "nodegroup": {
        "nodegroupName": "my-eks-nodegroup",
        "nodegroupArn": "arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-nodegroup/1ec75f5f-0e21-dcc0-b46e-f9c442685cd8",
        "clusterName": "my-eks-cluster",
        "version": "1.26",
        "releaseVersion": "1.26.12-20240329",
        "createdAt": "2024-04-08T13:25:15.033000-04:00",
        "modifiedAt": "2024-04-08T13:25:31.252000-04:00",
        "status": "DELETING",
        "capacityType": "SPOT",
        "scalingConfig": {
            "minSize": 1,
            "maxSize": 5,
            "desiredSize": 4
        },
        "instanceTypes": [
            "t3.large"
        ],
        "subnets": [
            "subnet-0e2907431c9988b72",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-09d912bb63ef21b9a"
        ],
        "amiType": "AL2_x86_64",
        "nodeRole": "arn:aws:iam::111122223333:role/role-name",
        "labels": {
            "my-eks-nodegroup-label-2": "value-2",
            "my-eks-nodegroup-label-1": "value-1"
        },
        "taints": [
            {
                "key": "taint-key-1",
                "value": "taint-value-1",
                "effect": "NO_EXECUTE"
            }
        ],
        "diskSize": 50,
        "health": {
            "issues": []
        },
        "updateConfig": {
            "maxUnavailable": 2
        },
        "tags": {
            "my-eks-nodegroup-key-1": "value-1",
            "my-eks-nodegroup-key-2": "value-2"
        }
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeleteNodegroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/delete-nodegroup.html)。

### `delete-pod-identity-association`
<a name="eks_DeletePodIdentityAssociation_cli_topic"></a>

以下程式碼範例顯示如何使用 `delete-pod-identity-association`。

**AWS CLI**  
**刪除 EKS Pod 身分識別關聯**  
下列 `delete-pod-identity-association` 範例會從名為 `eks-customer` 的 EKS 叢集中，刪除 EKS Pod 身分識別關聯與關聯 ID `a-9njjin9gfghecgocd`。  

```
aws eks delete-pod-identity-association \
    --cluster-name eks-customer \
    --association-id a-9njjin9gfghecgocd
```
輸出：  

```
{
    "association": {
        "clusterName": "eks-customer",
        "namespace": "default",
        "serviceAccount": "default",
        "roleArn": "arn:aws:iam::111122223333:role/s3-role",
        "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-9njjin9gfghecgocd",
        "associationId": "a-9njjin9gfghecgocd",
        "tags": {
            "Key2": "value2",
            "Key1": "value1"
        },
        "createdAt": "2025-05-24T19:52:14.135000-05:00",
        "modifiedAt": "2025-05-25T21:10:56.923000-05:00"
    }
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeletePodIdentityAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/delete-pod-identity-association.html)。

### `deregister-cluster`
<a name="eks_DeregisterCluster_cli_topic"></a>

以下程式碼範例顯示如何使用 `deregister-cluster`。

**AWS CLI**  
**取消註冊已連線的叢集，將其從 Amazon EKS 控制平面移除**  
下列 `deregister-cluster` 範例會取消註冊已連線的叢集，將其從 Amazon EKS 控制平面移除。  

```
aws eks deregister-cluster \
    --name my-eks-anywhere-cluster
```
輸出：  

```
{
    "cluster": {
        "name": "my-eks-anywhere-cluster",
        "arn": "arn:aws:eks:us-east-2:111122223333:cluster/my-eks-anywhere-cluster",
        "createdAt": "2024-04-12T12:38:37.561000-04:00",
        "status": "DELETING",
        "tags": {},
        "connectorConfig": {
            "activationId": "dfb5ad28-13c3-4e26-8a19-5b2457638c74",
            "activationExpiry": "2024-04-15T12:38:37.082000-04:00",
            "provider": "EKS_ANYWHERE",
            "roleArn": "arn:aws:iam::111122223333:role/AmazonEKSConnectorAgentRole"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[取消註冊叢集](https://docs.aws.amazon.com/eks/latest/userguide/deregister-connected-cluster.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DeregisterCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/deregister-cluster.html)。

### `describe-access-entry`
<a name="eks_DescribeAccessEntry_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-access-entry`。

**AWS CLI**  
**描述 EKS 叢集的存取項目**  
下列 `describe-access-entry` 範例描述 EKS 叢集的存取項目。  

```
aws eks describe-access-entry \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:user/eks-admin-user
```
輸出：  

```
{
    "accessEntry": {
        "clusterName": "eks-customer",
        "principalArn": "arn:aws:iam::111122223333:user/eks-admin-user",
        "kubernetesGroups": [],
        "accessEntryArn": "arn:aws:eks:us-west-2:111122223333:access-entry/eks-customer/user/111122223333/eks-admin-user/0acb1bc6-cb0a-ede6-11ae-a6506e3d36p0",
        "createdAt": "2025-04-14T22:45:48.097000-05:00",
        "modifiedAt": "2025-04-14T22:45:48.097000-05:00",
        "tags": {},
        "username": "arn:aws:iam::111122223333:user/eks-admin-user",
        "type": "STANDARD"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[使用 EKS 存取項目授予 IAM 使用者對 Kubernetes 的存取權](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAccessEntry](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-access-entry.html)。

### `describe-addon-configuration`
<a name="eks_DescribeAddonConfiguration_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-addon-configuration`。

**AWS CLI**  
**範例 1：建立或更新 Amazon vpc-cni AddOns 時可用的組態選項**  
下列 `describe-addon-configuration` 範例會傳回為具有對應版本的 vpc-cni 附加元件建立或更新附加元件時，您所使用的所有可用組態結構描述。  

```
aws eks describe-addon-configuration \
    --addon-name vpc-cni \
    --addon-version v1.15.1-eksbuild.1
```
輸出：  

```
{
    "addonName": "vpc-cni",
    "addonVersion": "v1.15.1-eksbuild.1",
    "configurationSchema": "{\"$ref\":\"#/definitions/VpcCni\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"definitions\":{\"Affinity\":{\"type\":[\"object\",\"null\"]},\"EniConfig\":{\"additionalProperties\":false,\"properties\":{\"create\":{\"type\":\"boolean\"},\"region\":{\"type\":\"string\"},\"subnets\":{\"additionalProperties\":{\"additionalProperties\":false,\"properties\":{\"id\":{\"type\":\"string\"},\"securityGroups\":{\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"id\"],\"type\":\"object\"},\"minProperties\":1,\"type\":\"object\"}},\"required\":[\"create\",\"region\",\"subnets\"],\"type\":\"object\"},\"Env\":{\"additionalProperties\":false,\"properties\":{\"ADDITIONAL_ENI_TAGS\":{\"type\":\"string\"},\"ANNOTATE_POD_IP\":{\"format\":\"boolean\",\"type\":\"string\"},\"AWS_EC2_ENDPOINT\":{\"type\":\"string\"},\"AWS_EXTERNAL_SERVICE_CIDRS\":{\"type\":\"string\"},\"AWS_MANAGE_ENIS_NON_SCHEDULABLE\":{\"format\":\"boolean\",\"type\":\"string\"},\"AWS_VPC_CNI_NODE_PORT_SUPPORT\":{\"format\":\"boolean\",\"type\":\"string\"},\"AWS_VPC_ENI_MTU\":{\"format\":\"integer\",\"type\":\"string\"},\"AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG\":{\"format\":\"boolean\",\"type\":\"string\"},\"AWS_VPC_K8S_CNI_EXCLUDE_SNAT_CIDRS\":{\"type\":\"string\"},\"AWS_VPC_K8S_CNI_EXTERNALSNAT\":{\"format\":\"boolean\",\"type\":\"string\"},\"AWS_VPC_K8S_CNI_LOGLEVEL\":{\"type\":\"string\"},\"AWS_VPC_K8S_CNI_LOG_FILE\":{\"type\":\"string\"},\"AWS_VPC_K8S_CNI_RANDOMIZESNAT\":{\"type\":\"string\"},\"AWS_VPC_K8S_CNI_VETHPREFIX\":{\"type\":\"string\"},\"AWS_VPC_K8S_PLUGIN_LOG_FILE\":{\"type\":\"string\"},\"AWS_VPC_K8S_PLUGIN_LOG_LEVEL\":{\"type\":\"string\"},\"CLUSTER_ENDPOINT\":{\"type\":\"string\"},\"DISABLE_INTROSPECTION\":{\"format\":\"boolean\",\"type\":\"string\"},\"DISABLE_LEAKED_ENI_CLEANUP\":{\"format\":\"boolean\",\"type\":\"string\"},\"DISABLE_METRICS\":{\"format\":\"boolean\",\"type\":\"string\"},\"DISABLE_NETWORK_RESOURCE_PROVISIONING\":{\"format\":\"boolean\",\"type\":\"string\"},\"DISABLE_POD_V6\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENABLE_BANDWIDTH_PLUGIN\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENABLE_POD_ENI\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENABLE_PREFIX_DELEGATION\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENABLE_V4_EGRESS\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENABLE_V6_EGRESS\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENI_CONFIG_ANNOTATION_DEF\":{\"type\":\"string\"},\"ENI_CONFIG_LABEL_DEF\":{\"type\":\"string\"},\"INTROSPECTION_BIND_ADDRESS\":{\"type\":\"string\"},\"IP_COOLDOWN_PERIOD\":{\"format\":\"integer\",\"type\":\"string\"},\"MAX_ENI\":{\"format\":\"integer\",\"type\":\"string\"},\"MINIMUM_IP_TARGET\":{\"format\":\"integer\",\"type\":\"string\"},\"POD_SECURITY_GROUP_ENFORCING_MODE\":{\"type\":\"string\"},\"WARM_ENI_TARGET\":{\"format\":\"integer\",\"type\":\"string\"},\"WARM_IP_TARGET\":{\"format\":\"integer\",\"type\":\"string\"},\"WARM_PREFIX_TARGET\":{\"format\":\"integer\",\"type\":\"string\"}},\"title\":\"Env\",\"type\":\"object\"},\"Init\":{\"additionalProperties\":false,\"properties\":{\"env\":{\"$ref\":\"#/definitions/InitEnv\"}},\"title\":\"Init\",\"type\":\"object\"},\"InitEnv\":{\"additionalProperties\":false,\"properties\":{\"DISABLE_TCP_EARLY_DEMUX\":{\"format\":\"boolean\",\"type\":\"string\"},\"ENABLE_V6_EGRESS\":{\"format\":\"boolean\",\"type\":\"string\"}},\"title\":\"InitEnv\",\"type\":\"object\"},\"Limits\":{\"additionalProperties\":false,\"properties\":{\"cpu\":{\"type\":\"string\"},\"memory\":{\"type\":\"string\"}},\"title\":\"Limits\",\"type\":\"object\"},\"NodeAgent\":{\"additionalProperties\":false,\"properties\":{\"enableCloudWatchLogs\":{\"format\":\"boolean\",\"type\":\"string\"},\"enablePolicyEventLogs\":{\"format\":\"boolean\",\"type\":\"string\"},\"healthProbeBindAddr\":{\"format\":\"integer\",\"type\":\"string\"},\"metricsBindAddr\":{\"format\":\"integer\",\"type\":\"string\"}},\"title\":\"NodeAgent\",\"type\":\"object\"},\"Resources\":{\"additionalProperties\":false,\"properties\":{\"limits\":{\"$ref\":\"#/definitions/Limits\"},\"requests\":{\"$ref\":\"#/definitions/Limits\"}},\"title\":\"Resources\",\"type\":\"object\"},\"Tolerations\":{\"additionalProperties\":false,\"items\":{\"type\":\"object\"},\"type\":\"array\"},\"VpcCni\":{\"additionalProperties\":false,\"properties\":{\"affinity\":{\"$ref\":\"#/definitions/Affinity\"},\"enableNetworkPolicy\":{\"format\":\"boolean\",\"type\":\"string\"},\"enableWindowsIpam\":{\"format\":\"boolean\",\"type\":\"string\"},\"eniConfig\":{\"$ref\":\"#/definitions/EniConfig\"},\"env\":{\"$ref\":\"#/definitions/Env\"},\"init\":{\"$ref\":\"#/definitions/Init\"},\"livenessProbeTimeoutSeconds\":{\"type\":\"integer\"},\"nodeAgent\":{\"$ref\":\"#/definitions/NodeAgent\"},\"readinessProbeTimeoutSeconds\":{\"type\":\"integer\"},\"resources\":{\"$ref\":\"#/definitions/Resources\"},\"tolerations\":{\"$ref\":\"#/definitions/Tolerations\"}},\"title\":\"VpcCni\",\"type\":\"object\"}},\"description\":\"vpc-cni\"}"
}
```
**範例 2：建立或更新 Amazon coredns AddOns 時，可用的組態選項**  
下列 `describe-addon-configuration` 範例會傳回為具有對應版本的 coredns 附加元件建立或更新附加元件時，您所使用的所有可用組態結構描述。  

```
aws eks describe-addon-configuration \
    --addon-name coredns \
    --addon-version v1.8.7-eksbuild.4
```
輸出：  

```
{
    "addonName": "coredns",
    "addonVersion": "v1.8.7-eksbuild.4",
    "configurationSchema": "{\"$ref\":\"#/definitions/Coredns\",\"$schema\":\"http://json-schema.org/draft-06/schema#\",\"definitions\":{\"Coredns\":{\"additionalProperties\":false,\"properties\":{\"computeType\":{\"type\":\"string\"},\"corefile\":{\"description\":\"Entire corefile contents to use with installation\",\"type\":\"string\"},\"nodeSelector\":{\"additionalProperties\":{\"type\":\"string\"},\"type\":\"object\"},\"replicaCount\":{\"type\":\"integer\"},\"resources\":{\"$ref\":\"#/definitions/Resources\"}},\"title\":\"Coredns\",\"type\":\"object\"},\"Limits\":{\"additionalProperties\":false,\"properties\":{\"cpu\":{\"type\":\"string\"},\"memory\":{\"type\":\"string\"}},\"title\":\"Limits\",\"type\":\"object\"},\"Resources\":{\"additionalProperties\":false,\"properties\":{\"limits\":{\"$ref\":\"#/definitions/Limits\"},\"requests\":{\"$ref\":\"#/definitions/Limits\"}},\"title\":\"Resources\",\"type\":\"object\"}}}"
}
```
如需詳細資訊，請參閱 *Amazon EKS* 中的[針對 Amazon EKS 叢集建立或更新 kubeconfig 檔案](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAddonConfiguration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-addon-configuration.html)。

### `describe-addon-versions`
<a name="eks_DescribeAddonVersions_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-addon-versions`。

**AWS CLI**  
**範例 1：列出 EKS 叢集的所有可用附加元件**  
下列`describe-addon-versions`範例列出所有可用的 AWS 附加元件。  

```
aws eks describe-addon-versions  \
    --query 'sort_by(addons  &owner)[].{publisher: publisher, owner: owner, addonName: addonName, type: type}' \
    --output table
```
輸出：  

```
--------------------------------------------------------------------------------------------------------------------
|                                               DescribeAddonVersions                                              |
+---------------------------------------------+------------------+-----------------------+-------------------------+
|                  addonName                  |      owner       |       publisher       |          type           |
+---------------------------------------------+------------------+-----------------------+-------------------------+
|  vpc-cni                                    |  aws             |  eks                  |  networking             |
|  snapshot-controller                        |  aws             |  eks                  |  storage                |
|  kube-proxy                                 |  aws             |  eks                  |  networking             |
|  eks-pod-identity-agent                     |  aws             |  eks                  |  security               |
|  coredns                                    |  aws             |  eks                  |  networking             |
|  aws-mountpoint-s3-csi-driver               |  aws             |  s3                   |  storage                |
|  aws-guardduty-agent                        |  aws             |  eks                  |  security               |
|  aws-efs-csi-driver                         |  aws             |  eks                  |  storage                |
|  aws-ebs-csi-driver                         |  aws             |  eks                  |  storage                |
|  amazon-cloudwatch-observability            |  aws             |  eks                  |  observability          |
|  adot                                       |  aws             |  eks                  |  observability          |
|  upwind-security_upwind-operator            |  aws-marketplace |  Upwind Security      |  security               |
|  upbound_universal-crossplane               |  aws-marketplace |  upbound              |  infra-management       |
|  tetrate-io_istio-distro                    |  aws-marketplace |  tetrate-io           |  policy-management      |
|  teleport_teleport                          |  aws-marketplace |  teleport             |  policy-management      |
|  stormforge_optimize-live                   |  aws-marketplace |  StormForge           |  cost-management        |
|  splunk_splunk-otel-collector-chart         |  aws-marketplace |  Splunk               |  monitoring             |
|  solo-io_istio-distro                       |  aws-marketplace |  Solo.io              |  service-mesh           |
|  rafay-systems_rafay-operator               |  aws-marketplace |  rafay-systems        |  kubernetes-management  |
|  new-relic_kubernetes-operator              |  aws-marketplace |  New Relic            |  observability          |
|  netapp_trident-operator                    |  aws-marketplace |  NetApp Inc.          |  storage                |
|  leaksignal_leakagent                       |  aws-marketplace |  leaksignal           |  monitoring             |
|  kubecost_kubecost                          |  aws-marketplace |  kubecost             |  cost-management        |
|  kong_konnect-ri                            |  aws-marketplace |  kong                 |  ingress-service-type   |
|  kasten_k10                                 |  aws-marketplace |  Kasten by Veeam      |  data-protection        |
|  haproxy-technologies_kubernetes-ingress-ee |  aws-marketplace |  HAProxy Technologies |  ingress-controller     |
|  groundcover_agent                          |  aws-marketplace |  groundcover          |  monitoring             |
|  grafana-labs_kubernetes-monitoring         |  aws-marketplace |  Grafana Labs         |  monitoring             |
|  factorhouse_kpow                           |  aws-marketplace |  factorhouse          |  monitoring             |
|  dynatrace_dynatrace-operator               |  aws-marketplace |  dynatrace            |  monitoring             |
|  datree_engine-pro                          |  aws-marketplace |  datree               |  policy-management      |
|  datadog_operator                           |  aws-marketplace |  Datadog              |  monitoring             |
|  cribl_cribledge                            |  aws-marketplace |  Cribl                |  observability          |
|  calyptia_fluent-bit                        |  aws-marketplace |  Calyptia Inc         |  observability          |
|  accuknox_kubearmor                         |  aws-marketplace |  AccuKnox             |  security               |
+---------------------------------------------+------------------+-----------------------+-------------------------+
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
**範例 2：列出 EKS 支援之指定 Kubernetes 版本的所有可用附加元件**  
下列`describe-addon-versions`範例列出 EKS 支援的指定 Kubernetes 版本的所有可用附加元件。  

```
aws eks describe-addon-versions  \
    --kubernetes-version=1.26 \
    --query 'sort_by(addons  &owner)[].{publisher: publisher, owner: owner, addonName: addonName, type: type}' \
    --output table
```
輸出：  

```
--------------------------------------------------------------------------------------------------------------------
|                                               DescribeAddonVersions                                              |
+---------------------------------------------+------------------+-----------------------+-------------------------+
|                  addonName                  |      owner       |       publisher       |          type           |
+---------------------------------------------+------------------+-----------------------+-------------------------+
|  vpc-cni                                    |  aws             |  eks                  |  networking             |
|  snapshot-controller                        |  aws             |  eks                  |  storage                |
|  kube-proxy                                 |  aws             |  eks                  |  networking             |
|  eks-pod-identity-agent                     |  aws             |  eks                  |  security               |
|  coredns                                    |  aws             |  eks                  |  networking             |
|  aws-mountpoint-s3-csi-driver               |  aws             |  s3                   |  storage                |
|  aws-guardduty-agent                        |  aws             |  eks                  |  security               |
|  aws-efs-csi-driver                         |  aws             |  eks                  |  storage                |
|  aws-ebs-csi-driver                         |  aws             |  eks                  |  storage                |
|  amazon-cloudwatch-observability            |  aws             |  eks                  |  observability          |
|  adot                                       |  aws             |  eks                  |  observability          |
|  upwind-security_upwind-operator            |  aws-marketplace |  Upwind Security      |  security               |
|  tetrate-io_istio-distro                    |  aws-marketplace |  tetrate-io           |  policy-management      |
|  stormforge_optimize-live                   |  aws-marketplace |  StormForge           |  cost-management        |
|  splunk_splunk-otel-collector-chart         |  aws-marketplace |  Splunk               |  monitoring             |
|  solo-io_istio-distro                       |  aws-marketplace |  Solo.io              |  service-mesh           |
|  rafay-systems_rafay-operator               |  aws-marketplace |  rafay-systems        |  kubernetes-management  |
|  new-relic_kubernetes-operator              |  aws-marketplace |  New Relic            |  observability          |
|  netapp_trident-operator                    |  aws-marketplace |  NetApp Inc.          |  storage                |
|  leaksignal_leakagent                       |  aws-marketplace |  leaksignal           |  monitoring             |
|  kubecost_kubecost                          |  aws-marketplace |  kubecost             |  cost-management        |
|  kong_konnect-ri                            |  aws-marketplace |  kong                 |  ingress-service-type   |
|  haproxy-technologies_kubernetes-ingress-ee |  aws-marketplace |  HAProxy Technologies |  ingress-controller     |
|  groundcover_agent                          |  aws-marketplace |  groundcover          |  monitoring             |
|  grafana-labs_kubernetes-monitoring         |  aws-marketplace |  Grafana Labs         |  monitoring             |
|  dynatrace_dynatrace-operator               |  aws-marketplace |  dynatrace            |  monitoring             |
|  datadog_operator                           |  aws-marketplace |  Datadog              |  monitoring             |
|  cribl_cribledge                            |  aws-marketplace |  Cribl                |  observability          |
|  calyptia_fluent-bit                        |  aws-marketplace |  Calyptia Inc         |  observability          |
|  accuknox_kubearmor                         |  aws-marketplace |  AccuKnox             |  security               |
+---------------------------------------------+------------------+-----------------------+-------------------------+
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
**範例 3：列出 EKS 支援的指定 Kubernetes 版本的所有可用 vpc-cni 附加元件版本**  
下列`describe-addon-versions`範例列出 EKS 支援的指定 Kubernetes 版本的所有可用 vpc-cni 附加元件版本。  

```
aws eks describe-addon-versions \
    --kubernetes-version=1.26 \
    --addon-name=vpc-cni \
    --query='addons[].addonVersions[].addonVersion'
```
輸出：  

```
[
    "v1.18.0-eksbuild.1",
    "v1.17.1-eksbuild.1",
    "v1.16.4-eksbuild.2",
    "v1.16.3-eksbuild.2",
    "v1.16.2-eksbuild.1",
    "v1.16.0-eksbuild.1",
    "v1.15.5-eksbuild.1",
    "v1.15.4-eksbuild.1",
    "v1.15.3-eksbuild.1",
    "v1.15.1-eksbuild.1",
    "v1.15.0-eksbuild.2",
    "v1.14.1-eksbuild.1",
    "v1.14.0-eksbuild.3",
    "v1.13.4-eksbuild.1",
    "v1.13.3-eksbuild.1",
    "v1.13.2-eksbuild.1",
    "v1.13.0-eksbuild.1",
    "v1.12.6-eksbuild.2",
    "v1.12.6-eksbuild.1",
    "v1.12.5-eksbuild.2",
    "v1.12.0-eksbuild.2"
]
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAddonVersions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-addon-versions.html)。

### `describe-addon`
<a name="eks_DescribeAddon_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-addon`。

**AWS CLI**  
**描述在您的 Amazon EKS 叢集中主動執行 EKS 附加元件**  
下列 `describe-addon` 範例會在 Amazon EKS 叢集中主動執行 EKS 附加元件。  

```
aws eks describe-addon \
    --cluster-name my-eks-cluster \
    --addon-name vpc-cni
```
輸出：  

```
{
    "addon": {
        "addonName": "vpc-cni",
        "clusterName": "my-eks-cluster",
        "status": "ACTIVE",
        "addonVersion": "v1.16.4-eksbuild.2",
        "health": {
            "issues": []
        },
        "addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/vpc-cni/0ec71efc-98dd-3203-60b0-4b939b2a5e5f",
        "createdAt": "2024-03-14T13:18:45.417000-04:00",
        "modifiedAt": "2024-03-14T13:18:49.557000-04:00",
        "serviceAccountRoleArn": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm",
        "tags": {
            "eks-addon-key-3": "value-3",
            "eks-addon-key-4": "value-4"
        },
        "configurationValues": "resources:\n    limits:\n        cpu: '100m'\nenv:\n    AWS_VPC_K8S_CNI_LOGLEVEL: 'DEBUG'"
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeAddon](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-addon.html)。

### `describe-cluster`
<a name="eks_DescribeCluster_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-cluster`。

**AWS CLI**  
**描述在您的 Amazon EKS 叢集中主動執行 EKS 附加元件**  
下列 `describe-cluster` 範例會在 Amazon EKS 叢集中主動執行 EKS 附加元件。  

```
aws eks describe-cluster \
    --name my-eks-cluster
```
輸出：  

```
{
    "cluster": {
        "name": "my-eks-cluster",
        "arn": "arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster",
        "createdAt": "2024-03-14T11:31:44.348000-04:00",
        "version": "1.26",
        "endpoint": "https://JSA79429HJDASKJDJ8223829MNDNASW.yl4.us-east-2.eks.amazonaws.com",
        "roleArn": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-cluster-ServiceRole-zMF6CBakwwbW",
        "resourcesVpcConfig": {
            "subnetIds": [
                "subnet-0fb75d2d8401716e7",
                "subnet-02184492f67a3d0f9",
                "subnet-04098063527aab776",
                "subnet-0e2907431c9988b72",
                "subnet-04ad87f71c6e5ab4d",
                "subnet-09d912bb63ef21b9a"
            ],
            "securityGroupIds": [
                "sg-0c1327f6270afbb36"
            ],
            "clusterSecurityGroupId": "sg-01c84d09d70f39a7f",
            "vpcId": "vpc-0012b8e1cc0abb17d",
            "endpointPublicAccess": true,
            "endpointPrivateAccess": true,
            "publicAccessCidrs": [
                "22.19.18.2/32"
            ]
        },
        "kubernetesNetworkConfig": {
            "serviceIpv4Cidr": "10.100.0.0/16",
            "ipFamily": "ipv4"
        },
        "logging": {
            "clusterLogging": [
                {
                    "types": [
                        "api",
                        "audit",
                        "authenticator",
                        "controllerManager",
                        "scheduler"
                    ],
                    "enabled": true
                }
            ]
        },
        "identity": {
            "oidc": {
                "issuer": "https://oidc.eks.us-east-2.amazonaws.com/id/JSA79429HJDASKJDJ8223829MNDNASW"
            }
        },
        "status": "ACTIVE",
        "certificateAuthority": {
            "data": "CA_DATA_STRING..."
        },
        "platformVersion": "eks.14",
        "tags": {
            "aws:cloudformation:stack-name": "eksctl-my-eks-cluster-cluster",
            "alpha.eksctl.io/cluster-name": "my-eks-cluster",
            "karpenter.sh/discovery": "my-eks-cluster",
            "aws:cloudformation:stack-id": "arn:aws:cloudformation:us-east-2:111122223333:stack/eksctl-my-eks-cluster-cluster/e752ea00-e217-11ee-beae-0a9599c8c7ed",
            "auto-delete": "no",
            "eksctl.cluster.k8s.io/v1alpha1/cluster-name": "my-eks-cluster",
            "EKS-Cluster-Name": "my-eks-cluster",
            "alpha.eksctl.io/cluster-oidc-enabled": "true",
            "aws:cloudformation:logical-id": "ControlPlane",
            "alpha.eksctl.io/eksctl-version": "0.173.0-dev+a7ee89342.2024-03-01T03:40:57Z",
            "Name": "eksctl-my-eks-cluster-cluster/ControlPlane"
        },
        "health": {
            "issues": []
        },
        "accessConfig": {
            "authenticationMode": "API_AND_CONFIG_MAP"
        }
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-cluster.html)。

### `describe-fargate-profile`
<a name="eks_DescribeFargateProfile_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-fargate-profile`。

**AWS CLI**  
**描述 Fargate 設定檔**  
下列 `describe-fargate-profile` 範例描述 Fargate 設定檔。  

```
aws eks describe-fargate-profile \
    --cluster-name my-eks-cluster \
    --fargate-profile-name my-fargate-profile
```
輸出：  

```
{
    "fargateProfile": {
        "fargateProfileName": "my-fargate-profile",
        "fargateProfileArn": "arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/96c766ce-43d2-f9c9-954c-647334391198",
        "clusterName": "my-eks-cluster",
        "createdAt": "2024-04-11T10:42:52.486000-04:00",
        "podExecutionRoleArn": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-farga-FargatePodExecutionRole-1htfAaJdJUEO",
        "subnets": [
            "subnet-09d912bb63ef21b9a",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-0e2907431c9988b72"
        ],
        "selectors": [
            {
                "namespace": "prod*",
                "labels": {
                    "labelname*?": "*value1"
                }
            },
            {
                "namespace": "*dev*",
                "labels": {
                    "labelname*?": "*value*"
                }
            }
        ],
        "status": "ACTIVE",
        "tags": {
            "eks-fargate-profile-key-2": "value-2",
            "eks-fargate-profile-key-1": "value-1"
        }
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeFargateProfile](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-fargate-profile.html)。

### `describe-identity-provider-config`
<a name="eks_DescribeIdentityProviderConfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-identity-provider-config`。

**AWS CLI**  
**描述與 Amazon EKS 叢集相關聯的身分提供者組態**  
下列 `describe-identity-provider-config` 範例描述與您的 Amazon EKS 叢集相關聯的身分提供者組態。  

```
aws eks describe-identity-provider-config \
    --cluster-name my-eks-cluster \
    --identity-provider-config type=oidc,name=my-identity-provider
```
輸出：  

```
{
    "identityProviderConfig": {
        "oidc": {
            "identityProviderConfigName": "my-identity-provider",
            "identityProviderConfigArn": "arn:aws:eks:us-east-2:111122223333:identityproviderconfig/my-eks-cluster/oidc/my-identity-provider/8ac76722-78e4-cec1-ed76-d49eea058622",
            "clusterName": "my-eks-cluster",
            "issuerUrl": "https://oidc.eks.us-east-2.amazonaws.com/id/38D6A4619A0A69E342B113ED7F1A7652",
            "clientId": "kubernetes",
            "usernameClaim": "email",
            "usernamePrefix": "my-username-prefix",
            "groupsClaim": "my-claim",
            "groupsPrefix": "my-groups-prefix",
            "requiredClaims": {
                "Claim1": "value1",
                "Claim2": "value2"
            },
            "tags": {
                "env": "dev"
            },
            "status": "ACTIVE"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[從 OpenID Connect 身分提供者驗證叢集的使用者](https://docs.aws.amazon.com/eks/latest/userguide/authenticate-oidc-identity-provider.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeIdentityProviderConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-identity-provider-config.html)。

### `describe-insight`
<a name="eks_DescribeInsight_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-insight`。

**AWS CLI**  
**使用 EKS 叢集的 ID 取得洞見的詳細資訊**  
下列 `describe-insight` 範例會傳回使用叢集名稱和洞見 ID 所指定洞見的詳細資訊。  

```
aws eks describe-insight \
    --cluster-name eks-customer \
    --id 38ea7a64-a14f-4e0e-95c7-8dbcab3c3623
```
輸出：  

```
{
    "insight": {
        "id": "38ea7a64-a14f-4e0e-95c7-8dbcab3c3623",
        "name": "Kubelet version skew",
        "category": "UPGRADE_READINESS",
        "kubernetesVersion": "1.33",
        "lastRefreshTime": "2025-05-24T11:22:50-05:00",
        "lastTransitionTime": "2025-05-24T11:22:50-05:00",
        "description": "Checks for kubelet versions of worker nodes in the cluster to see if upgrade would cause noncompliance with supported Kubernetes kubelet version skew policy.",
        "insightStatus": {
            "status": "PASSING",
            "reason": "Node kubelet versions match the cluster control plane version."
        },
        "recommendation": "Upgrade your worker nodes to match the Kubernetes version of your cluster control plane.",
        "additionalInfo": {
            "Kubelet version skew policy": "https://kubernetes.io/releases/version-skew-policy/#kubelet",
            "Updating a managed node group": "https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html"
        },
        "resources": [],
        "categorySpecificSummary": {
            "deprecationDetails": []
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[檢視叢集洞見](https://docs.aws.amazon.com/eks/latest/userguide/view-cluster-insights.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeInsight](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-insight.html)。

### `describe-nodegroup`
<a name="eks_DescribeNodegroup_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-nodegroup`。

**AWS CLI**  
**描述 Amazon EKS 叢集的受管節點群組**  
下列 `describe-nodegroup` 範例描述 Amazon EKS 叢集的受管節點群組。  

```
aws eks describe-nodegroup \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup
```
輸出：  

```
{
    "nodegroup": {
        "nodegroupName": "my-eks-nodegroup",
        "nodegroupArn": "arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-nodegroup/a8c75f2f-df78-a72f-4063-4b69af3de5b1",
        "clusterName": "my-eks-cluster",
        "version": "1.26",
        "releaseVersion": "1.26.12-20240329",
        "createdAt": "2024-04-08T11:42:10.555000-04:00",
        "modifiedAt": "2024-04-08T11:44:12.402000-04:00",
        "status": "ACTIVE",
        "capacityType": "ON_DEMAND",
        "scalingConfig": {
            "minSize": 1,
            "maxSize": 3,
            "desiredSize": 1
        },
        "instanceTypes": [
            "t3.medium"
        ],
        "subnets": [
            "subnet-0e2907431c9988b72",
            "subnet-04ad87f71c6e5ab4d",
            "subnet-09d912bb63ef21b9a"
        ],
        "amiType": "AL2_x86_64",
        "nodeRole": "arn:aws:iam::111122223333:role/role-name",
        "labels": {},
        "resources": {
            "autoScalingGroups": [
                {
                    "name": "eks-my-eks-nodegroup-a8c75f2f-df78-a72f-4063-4b69af3de5b1"
                }
            ]
        },
        "diskSize": 20,
        "health": {
            "issues": []
        },
        "updateConfig": {
            "maxUnavailable": 1
        },
        "tags": {}
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeNodegroup](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-nodegroup.html)。

### `describe-pod-identity-association`
<a name="eks_DescribePodIdentityAssociation_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-pod-identity-association`。

**AWS CLI**  
**提供 Pod 身分識別關聯的詳細資訊**  
下列 `describe-pod-identity-association` 範例描述 EKS 叢集中的 Pod 身分識別關聯。  

```
aws eks describe-pod-identity-association \
    --cluster-name eks-customer \
    --association-id a-9njjin9gfghecgocd
```
輸出：  

```
{
    "association": {
        "clusterName": "eks-customer",
        "namespace": "default",
        "serviceAccount": "default",
        "roleArn": "arn:aws:iam::111122223333:role/my-role",
        "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-9njjin9gfghecgocd",
        "associationId": "a-9njjin9gfghecgocd",
        "tags": {
            "Key2": "value2",
            "Key1": "value1"
        },
        "createdAt": "2025-05-24T19:52:14.135000-05:00",
        "modifiedAt": "2025-05-24T19:52:14.135000-05:00"
    }
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribePodIdentityAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-pod-identity-association.html)。

### `describe-update`
<a name="eks_DescribeUpdate_cli_topic"></a>

以下程式碼範例顯示如何使用 `describe-update`。

**AWS CLI**  
**範例 1：描述叢集的更新**  
下列 `describe-update` 範例描述具名之叢集的更新。  

```
aws eks describe-update \
    --name my-eks-cluster \
    --update-id 10bddb13-a71b-425a-b0a6-71cd03e59161
```
輸出：  

```
{
    "update": {
        "id": "10bddb13-a71b-425a-b0a6-71cd03e59161",
        "status": "Successful",
        "type": "EndpointAccessUpdate",
        "params": [
            {
                "type": "EndpointPublicAccess",
                "value": "false"
            },
            {
                "type": "EndpointPrivateAccess",
                "value": "true"
            }
        ],
        "createdAt": "2024-03-14T10:01:26.297000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新 Amazon EKS 叢集 Kubernetes 版本](https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html)。  
**範例 2：描述叢集的更新**  
下列 `describe-update` 範例描述具名之叢集的更新。  

```
aws eks describe-update \
    --name my-eks-cluster \
    --update-id e4994991-4c0f-475a-a040-427e6da52966
```
輸出：  

```
{
    "update": {
        "id": "e4994991-4c0f-475a-a040-427e6da52966",
        "status": "Successful",
        "type": "AssociateEncryptionConfig",
        "params": [
            {
                "type": "EncryptionConfig",
                "value": "[{\"resources\":[\"secrets\"],\"provider\":{\"keyArn\":\"arn:aws:kms:region-code:account:key/key\"}}]"
            }
        ],
        "createdAt": "2024-03-14T11:01:26.297000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新 Amazon EKS 叢集 Kubernetes 版本](https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html)。  
**範例 3：描述叢集的更新**  
下列 `describe-update` 範例描述具名之叢集的更新。  

```
aws eks describe-update \
    --name my-eks-cluster \
    --update-id b5f0ba18-9a87-4450-b5a0-825e6e84496f
```
輸出：  

```
{
    "update": {
        "id": "b5f0ba18-9a87-4450-b5a0-825e6e84496f",
        "status": "Successful",
        "type": "VersionUpdate",
        "params": [
            {
                "type": "Version",
                "value": "1.29"
            },
            {
                "type": "PlatformVersion",
                "value": "eks.1"
            }
        ],
        "createdAt": "2024-03-14T12:05:26.297000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新 Amazon EKS 叢集 Kubernetes 版本](https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html)。  
+  如需 API 詳細資訊，請參閱*《AWS CLI 命令參考》*中的 [DescribeUpdate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/describe-update.html)。

### `disassociate-access-policy`
<a name="eks_DisassociateAccessPolicy_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-access-policy`。

**AWS CLI**  
**取消存取政策與存取項目的關聯**  
以下 `disassociate-access-policy` 移除與存取項目相關聯的存取政策。  

```
aws eks disassociate-access-policy \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:role/Admin \
    --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy
```
此命令不會產生輸出。  
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[將存取政策與存取項目相關聯](https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html)。  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [DisassociateAccessPolicy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/disassociate-access-policy.html)。

### `disassociate-identity-provider-config`
<a name="eks_DisassociateIdentityProviderConfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `disassociate-identity-provider-config`。

**AWS CLI**  
**取消身分提供者與您的 Amazon EKS 叢集的關聯**  
下列 `disassociate-identity-provider-config` 範例會取消身分提供者與 Amazon EKS 叢集的關聯。  

```
aws eks disassociate-identity-provider-config \
    --cluster-name my-eks-cluster \
    --identity-provider-config 'type=oidc,name=my-identity-provider'
```
輸出：  

```
{
    "update": {
        "id": "5f78d14e-c57b-4857-a3e4-cf664ae20949",
        "status": "InProgress",
        "type": "DisassociateIdentityProviderConfig",
        "params": [
            {
                "type": "IdentityProviderConfig",
                "value": "[]"
            }
        ],
        "createdAt": "2024-04-11T13:53:43.314000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[從 OpenID Connect 身分提供者驗證叢集的使用者 - 取消 OIDC 身分提供者與叢集的關聯](https://docs.aws.amazon.com/eks/latest/userguide/authenticate-oidc-identity-provider.html#disassociate-oidc-identity-provider)。  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [DisassociateIdentityProviderConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/disassociate-identity-provider-config.html)。

### `get-token`
<a name="eks_GetToken_cli_topic"></a>

以下程式碼範例顯示如何使用 `get-token`。

**AWS CLI**  
**範例 1：取得名為 `my-eks-cluster` 之 Amazon EKS 叢集的身分驗證字符**  
下列 `get-token` 範例取得名為 my-eks-cluster 之 Amazon EKS 叢集的身分驗證字符。  

```
aws eks get-token \
    --cluster-name my-eks-cluster
```
輸出：  

```
{
    "kind": "ExecCredential",
    "apiVersion": "client.authentication.k8s.io/v1beta1",
    "spec": {},
    "status": {
        "expirationTimestamp": "2024-04-11T20:59:56Z",
        "token": "k8s-aws-v1.EXAMPLE_TOKEN_DATA_STRING..."
    }
}
```
**範例 2：在簽署字符時，承擔此憑證的 roleARN，以取得名為 `my-eks-cluster` 之 Amazon EKS 叢集的身分驗證字符**  
下列 `get-token` 範例會透過在簽署字符時承擔此憑證的 roleARN，以取得名為 my-eks-cluster 之 Amazon EKS 叢集的身分驗證字符。  

```
aws eks get-token \
    --cluster-name my-eks-cluster \
    --role-arn arn:aws:iam::111122223333:role/eksctl-EKS-Linux-Cluster-v1-24-cluster-ServiceRole-j1k7AfTIQtnM
```
輸出：  

```
{
    "kind": "ExecCredential",
    "apiVersion": "client.authentication.k8s.io/v1beta1",
    "spec": {},
    "status": {
        "expirationTimestamp": "2024-04-11T21:05:26Z",
        "token": "k8s-aws-v1.EXAMPLE_TOKEN_DATA_STRING..."
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetToken](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/get-token.html)。

### `list-access-entries`
<a name="eks_ListAccessEntries_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-access-entries`。

**AWS CLI**  
**列出 EKS 叢集的存取項目**  
以下 `list-access-entries` 會傳回與 EKS 叢集 `eks-customer` 相關聯的存取項目清單。  

```
aws eks list-access-entries \
    --cluster-name eks-customer
```
輸出：  

```
{
    "accessEntries": [
        "arn:aws:iam::111122223333:role/Admin",
        "arn:aws:iam::111122223333:role/admin-test-ip",
        "arn:aws:iam::111122223333:role/assume-worker-node-role",
        "arn:aws:iam::111122223333:user/eks-admin-user"
    ]
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[使用 EKS 存取項目授予 IAM 使用者對 Kubernetes 的存取權](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAccessEntries](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-access-entries.html)。

### `list-access-policies`
<a name="eks_ListAccessPolicies_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-access-policies`。

**AWS CLI**  
**列出所有可用的存取政策**  
此 `list-access-policies` 範例會傳回所有可用存取政策的清單。  

```
aws eks list-access-policies
```
輸出：  

```
{
    "accessPolicies": [
        {
            "name": "AmazonEKSAdminPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminPolicy"
        },
        {
            "name": "AmazonEKSAdminViewPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminViewPolicy"
        },
        {
            "name": "AmazonEKSAutoNodePolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSAutoNodePolicy"
        },
        {
            "name": "AmazonEKSBlockStorageClusterPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSBlockStorageClusterPolicy"
        },
        {
            "name": "AmazonEKSBlockStoragePolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSBlockStoragePolicy"
        },
        {
            "name": "AmazonEKSClusterAdminPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy"
        },
        {
            "name": "AmazonEKSComputeClusterPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSComputeClusterPolicy"
        },
        {
            "name": "AmazonEKSComputePolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSComputePolicy"
        },
        {
            "name": "AmazonEKSEditPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy"
        },
        {
            "name": "AmazonEKSHybridPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSHybridPolicy"
        },
        {
            "name": "AmazonEKSLoadBalancingClusterPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSLoadBalancingClusterPolicy"
        },
        {
            "name": "AmazonEKSLoadBalancingPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSLoadBalancingPolicy"
        },
        {
            "name": "AmazonEKSNetworkingClusterPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSNetworkingClusterPolicy"
        },
        {
            "name": "AmazonEKSNetworkingPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSNetworkingPolicy"
        },
        {
            "name": "AmazonEKSViewPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy"
        },
        {
            "name": "AmazonEMRJobPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonEMRJobPolicy"
        },
        {
            "name": "AmazonSagemakerHyperpodClusterPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonSagemakerHyperpodClusterPolicy"
        },
        {
            "name": "AmazonSagemakerHyperpodControllerPolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonSagemakerHyperpodControllerPolicy"
        },
        {
            "name": "AmazonSagemakerHyperpodSystemNamespacePolicy",
            "arn": "arn:aws:eks::aws:cluster-access-policy/AmazonSagemakerHyperpodSystemNamespacePolicy"
        }
    ]
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[將存取政策與存取項目相關聯](https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAccessPolicies](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-access-policies.html)。

### `list-addons`
<a name="eks_ListAddons_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-addons`。

**AWS CLI**  
**列出 Amazon EKS 叢集中名為 `my-eks-cluster` 的所有已安裝附加元件**  
下列 `list-addons` 範例列出 Amazon EKS 叢集中名為 my-eks-cluster 的所有已安裝附加元件。  

```
aws eks list-addons \
    --cluster-name my-eks-cluster
```
輸出：  

```
{
    "addons": [
        "kube-proxy",
        "vpc-cni"
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAddons](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-addons.html)。

### `list-associated-access-policies`
<a name="eks_ListAssociatedAccessPolicies_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-associated-access-policies`。

**AWS CLI**  
**列出與存取項目相關聯的存取政策**  
下列 `list-associated-access-policies` 範例會傳回與 EKS 叢集中的存取項目相關聯的存取政策清單。  

```
aws eks list-associated-access-policies \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:role/Admin
```
輸出：  

```
{
    "associatedAccessPolicies": [
        {
            "policyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSAdminPolicy",
            "accessScope": {
                "type": "cluster",
                "namespaces": []
            },
            "associatedAt": "2025-05-24T17:26:22.935000-05:00",
            "modifiedAt": "2025-05-24T17:26:22.935000-05:00"
        }
    ],
    "clusterName": "eks-customer",
    "principalArn": "arn:aws:iam::111122223333:role/Admin"
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[使用 EKS 存取項目授予 IAM 使用者對 Kubernetes 的存取權](https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListAssociatedAccessPolicies](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-associated-access-policies.html)。

### `list-clusters`
<a name="eks_ListClusters_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-clusters`。

**AWS CLI**  
**列出 Amazon EKS 叢集中名為 `my-eks-cluster` 的所有已安裝附加元件**  
下列 `list-clusters` 範例列出 Amazon EKS 叢集中名為 my-eks-cluster 的所有已安裝附加元件。  

```
aws eks list-clusters
```
輸出：  

```
{
    "clusters": [
        "prod",
        "qa",
        "stage",
        "my-eks-cluster"
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListClusters](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-clusters.html)。

### `list-fargate-profiles`
<a name="eks_ListFargateProfiles_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-fargate-profiles`。

**AWS CLI**  
**列出 Amazon EKS 叢集中名為 `my-eks-cluster` 的所有 Fargate 設定檔**  
下列 `list-fargate-profiles` 範例列出 Amazon EKS 叢集中名為 my-eks-cluster 的所有 Fargate 設定檔。  

```
aws eks list-fargate-profiles \
    --cluster-name my-eks-cluster
```
輸出：  

```
{
    "fargateProfileNames": [
        "my-fargate-profile"
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListFargateProfiles](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-fargate-profiles.html)。

### `list-identity-provider-configs`
<a name="eks_ListIdentityProviderConfigs_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-identity-provider-configs`。

**AWS CLI**  
**列出與 Amazon EKS 叢集相關聯的身分提供者**  
下列 `list-identity-provider-configs` 範例列出與 Amazon EKS 叢集相關聯的身分提供者。  

```
aws eks list-identity-provider-configs \
    --cluster-name my-eks-cluster
```
輸出：  

```
{
    "identityProviderConfigs": [
        {
            "type": "oidc",
            "name": "my-identity-provider"
        }
    ]
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[從 OpenID Connect 身分提供者驗證叢集的使用者](https://docs.aws.amazon.com/eks/latest/userguide/authenticate-oidc-identity-provider.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListIdentityProviderConfigs](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-identity-provider-configs.html)。

### `list-insights`
<a name="eks_ListInsights_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-insights`。

**AWS CLI**  
**列出指定之叢集的所有洞見**  
下列 `list-insights` 範例會傳回針對指定之叢集檢查的所有洞見清單。  

```
aws eks list-insights \
--cluster-name eks-customer
```
輸出：  

```
{
    "insights": [
        {
            "id": "38ea7a64-a14f-4e0e-95c7-8dbcab3c3616",
            "name": "Kubelet version skew",
            "category": "UPGRADE_READINESS",
            "kubernetesVersion": "1.33",
            "lastRefreshTime": "2025-05-24T11:22:50-05:00",
            "lastTransitionTime": "2025-05-24T11:22:50-05:00",
            "description": "Checks for kubelet versions of worker nodes in the cluster to see if upgrade would cause noncompliance with supported Kubernetes kubelet version skew policy.",
            "insightStatus": {
                "status": "PASSING",
                "reason": "Node kubelet versions match the cluster control plane version."
            }
        },
        {
            "id": "9cd91472-f99c-45a9-b7d7-54d4900dee23",
            "name": "EKS add-on version compatibility",
            "category": "UPGRADE_READINESS",
            "kubernetesVersion": "1.33",
            "lastRefreshTime": "2025-05-24T11:22:59-05:00",
            "lastTransitionTime": "2025-05-24T11:22:50-05:00",
            "description": "Checks version of installed EKS add-ons to ensure they are compatible with the next version of Kubernetes. ",
            "insightStatus": {
                "status": "PASSING",
                "reason": "All installed EKS add-on versions are compatible with next Kubernetes version."
            }
        },
        {
            "id": "0deb269d-b1e1-458c-a2b4-7a57f940c875",
            "name": "Cluster health issues",
            "category": "UPGRADE_READINESS",
            "kubernetesVersion": "1.33",
            "lastRefreshTime": "2025-05-24T11:22:59-05:00",
            "lastTransitionTime": "2025-05-24T11:22:50-05:00",
            "description": "Checks for any cluster health issues that prevent successful upgrade to the next Kubernetes version on EKS.",
            "insightStatus": {
                "status": "PASSING",
                "reason": "No cluster health issues detected."
            }
        },
        {
            "id": "214fa274-344f-420b-812a-5049ce72c9ww",
            "name": "kube-proxy version skew",
            "category": "UPGRADE_READINESS",
            "kubernetesVersion": "1.33",
            "lastRefreshTime": "2025-05-24T11:22:50-05:00",
            "lastTransitionTime": "2025-05-24T11:22:50-05:00",
            "description": "Checks version of kube-proxy in cluster to see if upgrade would cause noncompliance with supported Kubernetes kube-proxy version skew policy.",
            "insightStatus": {
                "status": "PASSING",
                "reason": "kube-proxy versions match the cluster control plane version."
            }
        }
    ]
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[檢視叢集洞見](https://docs.aws.amazon.com/eks/latest/userguide/view-cluster-insights.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListInsights](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-insights.html)。

### `list-nodegroups`
<a name="eks_ListNodegroups_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-nodegroups`。

**AWS CLI**  
**列出 Amazon EKS 叢集中的所有節點群組**  
下列 `list-nodegroups` 範例列出 Amazon EKS 叢集中的所有節點群組。  

```
aws eks list-nodegroups \
    --cluster-name my-eks-cluster
```
輸出：  

```
{
    "nodegroups": [
        "my-eks-managed-node-group",
        "my-eks-nodegroup"
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListNodegroups](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-nodegroups.html)。

### `list-pod-identity-associations`
<a name="eks_ListPodIdentityAssociations_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-pod-identity-associations`。

**AWS CLI**  
**範例 1：列出 EKS 叢集中的 Pod 身分識別關聯**  
以下 `list-pod-identity-associations` 會傳回與在所有命名空間和服務帳戶中名為 `eks-customer` 的 EKS 叢集相關聯的 Pod 身分識別關聯清單。  

```
aws eks list-pod-identity-associations \
    --cluster-name eks-customer
```
輸出：  

```
{
    "associations": [
        {
            "clusterName": "eks-customer",
            "namespace": "default",
            "serviceAccount": "default",
            "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-9njjin9gfghecgocd",
            "associationId": "a-9njjin9gfghecgocd"
        },
        {
            "clusterName": "eks-customer",
            "namespace": "kube-system",
            "serviceAccount": "eks-customer",
            "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-dvtacahdvjn01ffbc",
            "associationId": "a-dvtacahdvjn01ffbc"
        },
        {
            "clusterName": "eks-customer",
            "namespace": "kube-system",
            "serviceAccount": "coredns",
            "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-yrpsdroc4ei7k6xps",
            "associationId": "a-yrpsdroc4ei7k6xps"
        }
    ]
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
**範例 2：根據命名空間和服務帳戶，列出 EKS 叢集中的 Pod 身分識別關聯**  
以下 `list-pod-identity-associations` 會根據命名空間和服務帳戶，傳回 EKS 叢集中的 Pod 身分識別關聯清單。  

```
aws eks list-pod-identity-associations \
    --cluster-name eks-customer \
    --namespace kube-system \
    --service-account eks-customer
```
輸出：  

```
{
    "associations": [
        {
            "clusterName": "eks-customer",
            "namespace": "kube-system",
            "serviceAccount": "eks-customer",
            "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-dvtacahdvjn01ffbc",
            "associationId": "a-dvtacahdvjn01ffbc"
        }
    ]
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListPodIdentityAssociations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-pod-identity-associations.html)。

### `list-tags-for-resource`
<a name="eks_ListTagsForResource_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-tags-for-resource`。

**AWS CLI**  
**範例 1：列出 Amazon EKS 叢集 ARN 的所有標籤**  
下列 `list-tags-for-resource` 範例列出 Amazon EKS 叢集 ARN 的所有標籤。  

```
aws eks list-tags-for-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster
```
輸出：  

```
{
    "tags": {
        "aws:cloudformation:stack-name": "eksctl-my-eks-cluster-cluster",
        "alpha.eksctl.io/cluster-name": "my-eks-cluster",
        "karpenter.sh/discovery": "my-eks-cluster",
        "aws:cloudformation:stack-id": "arn:aws:cloudformation:us-east-2:111122223333:stack/eksctl-my-eks-cluster-cluster/e752ea00-e217-11ee-beae-0a9599c8c7ed",
        "auto-delete": "no",
        "eksctl.cluster.k8s.io/v1alpha1/cluster-name": "my-eks-cluster",
        "EKS-Cluster-Name": "my-eks-cluster",
        "alpha.eksctl.io/cluster-oidc-enabled": "true",
        "aws:cloudformation:logical-id": "ControlPlane",
        "alpha.eksctl.io/eksctl-version": "0.173.0-dev+a7ee89342.2024-03-01T03:40:57Z",
        "Name": "eksctl-my-eks-cluster-cluster/ControlPlane"
    }
}
```
**範例 2：列出 Amazon EKS 節點群組 ARN 的所有標籤**  
下列 `list-tags-for-resource` 範例列出 Amazon EKS 節點群組 ARN 的所有標籤。  

```
aws eks list-tags-for-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-managed-node-group/60c71ed2-2cfb-020f-a5f4-ad32477f198c
```
輸出：  

```
{
    "tags": {
        "aws:cloudformation:stack-name": "eksctl-my-eks-cluster-nodegroup-my-eks-managed-node-group",
        "aws:cloudformation:stack-id": "arn:aws:cloudformation:us-east-2:111122223333:stack/eksctl-my-eks-cluster-nodegroup-my-eks-managed-node-group/eaa20310-e219-11ee-b851-0ab9ad8228ff",
        "eksctl.cluster.k8s.io/v1alpha1/cluster-name": "my-eks-cluster",
        "EKS-Cluster-Name": "my-eks-cluster",
        "alpha.eksctl.io/nodegroup-type": "managed",
        "NodeGroup Name 1": "my-eks-managed-node-group",
        "k8s.io/cluster-autoscaler/enabled": "true",
        "nodegroup-role": "worker",
        "alpha.eksctl.io/cluster-name": "my-eks-cluster",
        "alpha.eksctl.io/nodegroup-name": "my-eks-managed-node-group",
        "karpenter.sh/discovery": "my-eks-cluster",
        "NodeGroup Name 2": "AmazonLinux-Linux-Managed-NG-v1-26-v1",
        "auto-delete": "no",
        "k8s.io/cluster-autoscaler/my-eks-cluster": "owned",
        "aws:cloudformation:logical-id": "ManagedNodeGroup",
        "alpha.eksctl.io/eksctl-version": "0.173.0-dev+a7ee89342.2024-03-01T03:40:57Z"
    }
}
```
**範例 3：列出 Amazon EKS Fargate 設定檔 ARNe 上的所有標籤**  
下列 `list-tags-for-resource` 範例列出 Amazon EKS Fargate 設定檔 ARN 的所有標籤。  

```
aws eks list-tags-for-resource  \
    --resource-arn arn:aws:eks:us-east-2:111122223333:fargateprofile/my-eks-cluster/my-fargate-profile/d6c76780-e541-0725-c816-36754cab734b
```
輸出：  

```
{
    "tags": {
        "eks-fargate-profile-key-2": "value-2",
        "eks-fargate-profile-key-1": "value-1"
    }
}
```
**範例 4：列出 Amazon EKS 附加元件 ARN 的所有標籤**  
下列 `list-tags-for-resource` 範例列出 Amazon EKS 附加元件 ARN 的所有標籤。  

```
aws eks list-tags-for-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/vpc-cni/0ec71efc-98dd-3203-60b0-4b939b2a5e5f
```
輸出：  

```
{
    "tags": {
        "eks-addon-key-2": "value-2",
        "eks-addon-key-1": "value-1"
    }
}
```
**範例 5：列出 Amazon EKS OIDC 身分提供者 ARN 的所有標籤**  
下列 `list-tags-for-resource` 範例列出 Amazon EKS OIDC 身分提供者 ARN 的所有標籤。  

```
aws eks list-tags-for-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:identityproviderconfig/my-eks-cluster/oidc/my-identity-provider/8ac76722-78e4-cec1-ed76-d49eea058622
```
輸出：  

```
{
    "tags": {
        "my-identity-provider": "test"
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListTagsForResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-tags-for-resource.html)。

### `list-update`
<a name="eks_ListUpdate_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-update`。

**AWS CLI**  
**範例 1：列出與 Amazon EKS 叢集名稱相關聯的更新**  
下列 `list-updates` 範例列出 Amazon EKS 叢集名稱的所有更新 ID。  

```
aws eks list-updates \
    --name my-eks-cluster
```
輸出：  

```
{
    "updateIds": [
        "5f78d14e-c57b-4857-a3e4-cf664ae20949",
        "760e5a3f-adad-48c7-88d3-7ac283c09c26",
        "cd4ec863-bc55-47d5-a377-3971502f529b",
        "f12657ce-e869-4f17-b158-a82ab8b7d937"
    ]
}
```
**範例 2：列出 Amazon EKS 節點群組的所有更新 ID**  
下列 `list-updates` 範例列出 Amazon EKS 節點群組的所有更新 ID。  

```
aws eks list-updates \
    --name my-eks-cluster \
    --nodegroup-name my-eks-managed-node-group
```
輸出：  

```
{
    "updateIds": [
        "8c6c1bef-61fe-42ac-a242-89412387b8e7"
    ]
}
```
**範例 3：列出 Amazon EKS 附加元件上的所有更新 ID**  
下列 `list-updates` 範例列出 Amazon EKS 附加元件的所有更新 ID。  

```
aws eks list-updates \
    --name my-eks-cluster \
    --addon-name vpc-cni
```
輸出：  

```
{
    "updateIds": [
        "9cdba8d4-79fb-3c83-afe8-00b508d33268"
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListUpdate](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-update.html)。

### `list-updates`
<a name="eks_ListUpdates_cli_topic"></a>

以下程式碼範例顯示如何使用 `list-updates`。

**AWS CLI**  
**列出叢集的更新**  
此範例命令列出預設區域中名為 `example` 之叢集的目前更新。  
命令：  

```
aws eks list-updates --name example
```
輸出：  

```
{
    "updateIds": [
        "10bddb13-a71b-425a-b0a6-71cd03e59161"
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [ListUpdates](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/list-updates.html)。

### `register-cluster`
<a name="eks_RegisterCluster_cli_topic"></a>

以下程式碼範例顯示如何使用 `register-cluster`。

**AWS CLI**  
**範例 1：將外部 EKS\$1ANYWHERE Kubernetes 叢集註冊到 Amazon EKS**  
下列 `register-cluster` 範例會將外部 EKS\$1ANYWHERE Kubernetes 叢集註冊至 Amazon EKS。  

```
aws eks register-cluster \
    --name my-eks-anywhere-cluster \
    --connector-config 'roleArn=arn:aws:iam::111122223333:role/AmazonEKSConnectorAgentRole,provider=EKS_ANYWHERE'
```
輸出：  

```
{
    "cluster": {
        "name": "my-eks-anywhere-cluster",
        "arn": "arn:aws:eks:us-east-2:111122223333:cluster/my-eks-anywhere-cluster",
        "createdAt": "2024-04-12T12:38:37.561000-04:00",
        "status": "PENDING",
        "tags": {},
        "connectorConfig": {
            "activationId": "xxxxxxxxACTIVATION_IDxxxxxxxx",
            "activationCode": "xxxxxxxxACTIVATION_CODExxxxxxxx",
            "activationExpiry": "2024-04-15T12:38:37.082000-04:00",
            "provider": "EKS_ANYWHERE",
            "roleArn": "arn:aws:iam::111122223333:role/AmazonEKSConnectorAgentRole"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[連接外部叢集](https://docs.aws.amazon.com/eks/latest/userguide/connecting-cluster.html)。  
**範例 2：將外部 Kubernetes 叢集註冊到 Amazon EKS**  
下列 `register-cluster` 範例會將外部 EKS\$1ANYWHERE Kubernetes 叢集註冊至 Amazon EKS。  

```
aws eks register-cluster \
    --name my-eks-anywhere-cluster \
    --connector-config 'roleArn=arn:aws:iam::111122223333:role/AmazonEKSConnectorAgentRole,provider=OTHER'
```
輸出：  

```
{
    "cluster": {
        "name": "my-onprem-k8s-cluster",
        "arn": "arn:aws:eks:us-east-2:111122223333:cluster/my-onprem-k8s-cluster",
        "createdAt": "2024-04-12T12:42:10.861000-04:00",
        "status": "PENDING",
        "tags": {},
        "connectorConfig": {
            "activationId": "xxxxxxxxACTIVATION_IDxxxxxxxx",
            "activationCode": "xxxxxxxxACTIVATION_CODExxxxxxxx",
            "activationExpiry": "2024-04-15T12:42:10.339000-04:00",
            "provider": "OTHER",
            "roleArn": "arn:aws:iam::111122223333:role/AmazonEKSConnectorAgentRole"
        }
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[連接外部叢集](https://docs.aws.amazon.com/eks/latest/userguide/connecting-cluster.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [RegisterCluster](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/register-cluster.html)。

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

以下程式碼範例顯示如何使用 `tag-resource`。

**AWS CLI**  
**範例 1：將指定的標籤新增至 Amazon EKS 叢集**  
下列 `tag-resource` 範例會將指定的標籤新增至 Amazon EKS 叢集。  

```
aws eks tag-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster \
    --tag 'my-eks-cluster-test-1=test-value-1,my-eks-cluster-dev-1=dev-value-2'
```
此命令不會產生輸出。  
**範例 2：將指定的標籤新增至 Amazon EKS 節點群組**  
下列 `tag-resource` 範例會將指定的標籤新增至 Amazon EKS 節點群組。  

```
aws eks tag-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-managed-node-group/60c71ed2-2cfb-020f-a5f4-ad32477f198c \
    --tag 'my-eks-nodegroup-test-1=test-value-1,my-eks-nodegroup-dev-1=dev-value-2'
```
此命令不會產生輸出。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [TagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/tag-resource.html)。

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

以下程式碼範例顯示如何使用 `untag-resource`。

**AWS CLI**  
**範例 1：從 Amazon EKS 叢集刪除指定的標籤**  
下列 `untag-resource` 範例會從 Amazon EKS 叢集刪除指定的標籤。  

```
aws eks untag-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster \
    --tag-keys "my-eks-cluster-test-1" "my-eks-cluster-dev-1"
```
此命令不會產生輸出。  
**範例 2：從 Amazon EKS 節點群組刪除指定的標籤**  
下列 `untag-resource` 範例會從 Amazon EKS 節點群組刪除指定的標籤。  

```
aws eks untag-resource \
    --resource-arn arn:aws:eks:us-east-2:111122223333:nodegroup/my-eks-cluster/my-eks-managed-node-group/60c71ed2-2cfb-020f-a5f4-ad32477f198c \
    --tag-keys "my-eks-nodegroup-test-1" "my-eks-nodegroup-dev-1"
```
此命令不會產生輸出。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UntagResource](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/untag-resource.html)。

### `update-access-entry`
<a name="eks_UpdateAccessEntry_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-access-entry`。

**AWS CLI**  
**更新 EKS 叢集的存取項目**  
以下 `update-access-entry` 透過新增 Kubernetes 群組更新 EKS 叢集的存取項目`tester`。  

```
aws eks update-access-entry \
    --cluster-name eks-customer \
    --principal-arn arn:aws:iam::111122223333:role/Admin \
    --kubernetes-groups tester
```
輸出：  

```
{
    "accessEntry": {
        "clusterName": "eks-customer",
        "principalArn": "arn:aws:iam::111122223333:role/Admin",
        "kubernetesGroups": [
            "tester"
        ],
        "accessEntryArn": "arn:aws:eks:us-west-2:111122223333:access-entry/eks-customer/role/111122223333/Admin/d2cb8183-d6ec-b82a-d967-eca21902a4b4",
        "createdAt": "2025-05-24T11:02:04.432000-05:00",
        "modifiedAt": "2025-05-24T17:08:01.608000-05:00",
        "tags": {},
        "username": "arn:aws:sts::111122223333:assumed-role/Admin/{{SessionName}}",
        "type": "STANDARD"
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新存取項目](https://docs.aws.amazon.com/eks/latest/userguide/updating-access-entries.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateAccessEntry](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-access-entry.html)。

### `update-addon`
<a name="eks_UpdateAddon_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-addon`。

**AWS CLI**  
**範例 1. 使用服務帳戶角色 ARN 更新 Amazon EKS 附加元件**  
下列 `update-addon` 範例命令會使用服務帳戶角色 ARN，更新 Amazon EKS 附加元件。  

```
aws eks update-addon \
    --cluster-name my-eks-cluster \
    --addon-name vpc-cni \
    --service-account-role-arn arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm
```
輸出：  

```
{
    "update": {
        "id": "c00d2de2-c2e4-3d30-929e-46b8edec2ce4",
        "status": "InProgress",
        "type": "AddonUpdate",
        "params": [
            {
                "type": "ServiceAccountRoleArn",
                "value": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm"
            }
        ],
        "updatedAt": "2024-04-12T16:04:55.614000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件 - 更新附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#updating-an-add-on)。  
**範例 2. 使用特定附加元件版本更新 Amazon EKS 附加元件**  
下列 `update-addon` 範例命令會使用特定附加元件版本，更新 Amazon EKS 附加元件。  

```
aws eks update-addon \
    --cluster-name my-eks-cluster \
    --addon-name vpc-cni \
    --service-account-role-arn arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm \
    --addon-version v1.16.4-eksbuild.2
```
輸出：  

```
{
    "update": {
        "id": "f58dc0b0-2b18-34bd-bc6a-e4abc0011f36",
        "status": "InProgress",
        "type": "AddonUpdate",
        "params": [
            {
                "type": "AddonVersion",
                "value": "v1.16.4-eksbuild.2"
            },
            {
                "type": "ServiceAccountRoleArn",
                "value": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm"
            }
        ],
        "createdAt": "2024-04-12T16:07:16.550000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件 - 更新附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#updating-an-add-on)。  
**範例 3. 使用自訂組態值更新 Amazon EKS 附加元件，並解決衝突詳細資訊**  
下列 `update-addon` 範例命令會使用自訂組態值更新 Amazon EKS 附加元件，並解決衝突詳細資訊。  

```
aws eks update-addon \
    --cluster-name my-eks-cluster \
    --addon-name vpc-cni \
    --service-account-role-arn arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm \
    --addon-version v1.16.4-eksbuild.2 \
    --configuration-values '{"resources": {"limits":{"cpu":"100m"}, "requests":{"cpu":"50m"}}}' \
    --resolve-conflicts PRESERVE
```
輸出：  

```
{
    "update": {
        "id": "cd9f2173-a8d8-3004-a90f-032f14326520",
        "status": "InProgress",
        "type": "AddonUpdate",
        "params": [
            {
                "type": "AddonVersion",
                "value": "v1.16.4-eksbuild.2"
            },
            {
                "type": "ServiceAccountRoleArn",
                "value": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm"
            },
            {
                "type": "ResolveConflicts",
                "value": "PRESERVE"
            },
            {
                "type": "ConfigurationValues",
                "value": "{\"resources\": {\"limits\":{\"cpu\":\"100m\"}, \"requests\":{\"cpu\":\"50m\"}}}"
            }
        ],
        "createdAt": "2024-04-12T16:16:27.363000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件 - 更新附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#updating-an-add-on)。  
**範例 4. 使用自訂 JSON 組態值檔案更新 Amazon EKS 附加元件**  
下列 `update-addon` 範例命令會使用自訂 JSON 組態值更新 Amazon EKS 附加元件，並解決衝突詳細資訊。  

```
aws eks update-addon \
    --cluster-name my-eks-cluster \
    --addon-name vpc-cni \
    --service-account-role-arn arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm \
    --addon-version v1.17.1-eksbuild.1 \
    --configuration-values 'file://configuration-values.json' \
    --resolve-conflicts PRESERVE
```
`configuration-values.json` 的內容：  

```
{
    "resources": {
        "limits": {
            "cpu": "100m"
        },
        "requests": {
            "cpu": "50m"
        }
    },
    "env": {
        "AWS_VPC_K8S_CNI_LOGLEVEL": "ERROR"
    }
}
```
輸出：  

```
{
    "update": {
        "id": "6881a437-174f-346b-9a63-6e91763507cc",
        "status": "InProgress",
        "type": "AddonUpdate",
        "params": [
            {
                "type": "AddonVersion",
                "value": "v1.17.1-eksbuild.1"
            },
            {
                "type": "ServiceAccountRoleArn",
                "value": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm"
            },
            {
                "type": "ResolveConflicts",
                "value": "PRESERVE"
            },
            {
                "type": "ConfigurationValues",
                "value": "{\n    \"resources\": {\n        \"limits\": {\n            \"cpu\": \"100m\"\n        },\n        \"requests\": {\n            \"cpu\": \"50m\"\n        }\n    },\n    \"env\": {\n        \"AWS_VPC_K8S_CNI_LOGLEVEL\": \"ERROR\"\n    }\n}"
            }
        ],
        "createdAt": "2024-04-12T16:22:55.519000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件 - 更新附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#updating-an-add-on)。  
**範例 5. 使用自訂 YAML 組態值檔案更新 Amazon EKS 附加元件**  
下列 `update-addon` 範例命令會使用自訂 YAML 組態值更新 Amazon EKS 附加元件，並解決衝突詳細資訊。  

```
aws eks update-addon \
    --cluster-name my-eks-cluster \
    --addon-name vpc-cni \
    --service-account-role-arn arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm \
    --addon-version v1.18.0-eksbuild.1 \
    --configuration-values 'file://configuration-values.yaml' \
    --resolve-conflicts PRESERVE
```
`configuration-values.yaml` 的內容：  

```
resources:
    limits:
        cpu: '100m'
    requests:
        cpu: '50m'
env:
    AWS_VPC_K8S_CNI_LOGLEVEL: 'DEBUG'
```
輸出：  

```
{
    "update": {
        "id": "a067a4c9-69d0-3769-ace9-d235c5b16701",
        "status": "InProgress",
        "type": "AddonUpdate",
        "params": [
            {
                "type": "AddonVersion",
                "value": "v1.18.0-eksbuild.1"
            },
            {
                "type": "ServiceAccountRoleArn",
                "value": "arn:aws:iam::111122223333:role/eksctl-my-eks-cluster-addon-vpc-cni-Role1-YfakrqOC1UTm"
            },
            {
                "type": "ResolveConflicts",
                "value": "PRESERVE"
            },
            {
                "type": "ConfigurationValues",
                "value": "resources:\n    limits:\n        cpu: '100m'\n    requests:\n        cpu: '50m'\nenv:\n    AWS_VPC_K8S_CNI_LOGLEVEL: 'DEBUG'"
            }
        ],
        "createdAt": "2024-04-12T16:25:07.212000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[管理 Amazon EKS 附加元件 - 更新附加元件](https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#updating-an-add-on)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateAddon](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-addon.html)。

### `update-cluster-config`
<a name="eks_UpdateClusterConfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-cluster-config`。

**AWS CLI**  
**更新叢集端點存取**  
此範例命令會更新叢集，以停用端點公有存取，並啟用私有端點存取。  
命令：  

```
aws eks update-cluster-config --name example \
--resources-vpc-config endpointPublicAccess=false,endpointPrivateAccess=true
```
輸出：  

```
{
    "update": {
        "id": "ec883c93-2e9e-407c-a22f-8f6fa6e67d4f",
        "status": "InProgress",
        "type": "EndpointAccessUpdate",
        "params": [
            {
                "type": "EndpointPublicAccess",
                "value": "false"
            },
            {
                "type": "EndpointPrivateAccess",
                "value": "true"
            }
        ],
        "createdAt": 1565806986.506,
        "errors": []
    }
}
```
**啟用叢集的稽核記錄**  
此範例命令會啟用名為 `example` 之叢集的所有叢集控制平面記錄類型。  
命令：  

```
aws eks update-cluster-config --name example \
--logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'
```
輸出：  

```
{
    "update": {
        "id": "7551c64b-1d27-4b1e-9f8e-c45f056eb6fd",
        "status": "InProgress",
        "type": "LoggingUpdate",
        "params": [
            {
                "type": "ClusterLogging",
                "value": "{\"clusterLogging\":[{\"types\":[\"api\",\"audit\",\"authenticator\",\"controllerManager\",\"scheduler\"],\"enabled\":true}]}"
            }
        ],
        "createdAt": 1565807210.37,
        "errors": []
    }
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateClusterConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-config.html)。

### `update-cluster-version`
<a name="eks_UpdateClusterVersion_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-cluster-version`。

**AWS CLI**  
**將名為 `my-eks-cluster` 的 Amazon EKS 叢集，更新為指定的 Kubernetes 版本**  
下列 `update-cluster-version` 範例會將 Amazon EKS 叢集更新為指定的 Kubernetes 版本。  

```
aws eks update-cluster-version \
    --name my-eks-cluster \
    --kubernetes-version 1.27
```
輸出：  

```
{
    "update": {
        "id": "e4091a28-ea14-48fd-a8c7-975aeb469e8a",
        "status": "InProgress",
        "type": "VersionUpdate",
        "params": [
            {
                "type": "Version",
                "value": "1.27"
            },
            {
                "type": "PlatformVersion",
                "value": "eks.16"
            }
        ],
        "createdAt": "2024-04-12T16:56:01.082000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新 Amazon EKS 叢集 Kubernetes 版本](https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateClusterVersion](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-cluster-version.html)。

### `update-kubeconfig`
<a name="eks_UpdateKubeconfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-kubeconfig`。

**AWS CLI**  
**範例 1：透過建立或更新 kubeconfig 來設定您的 kubectl，如此您才能連線至名為 `my-eks-cluster` 的 Amazon EKS 叢集**  
下列 `update-kubeconfig` 範例會透過建立或更新 kubeconfig 來設定您的 kubectl，如此您才能連線至名為 my-eks-cluster 的 Amazon EKS 叢集。  

```
aws eks update-kubeconfig \
    --name my-eks-cluster
```
輸出：  

```
Updated context arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster in /Users/xxx/.kube/config
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立或更新 Amazon EKS 叢集的 kubeconfig 檔案](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html)。  
**範例 2：透過建立或更新 kubeconfig (使用 role-arn 選項來擔任叢集身分驗證的角色) 來設定您的 kubectl，如此您才能連線至名為 `my-eks-cluster` 的 Amazon EKS 叢集**  
下列 `update-kubeconfig` 範例會透過建立或更新 kubeconfig (使用 role-arn 選項來擔任叢集身分驗證的角色) 來設定 kubectl，如此您才能連線至名為 my-eks-cluster 的 Amazon EKS 叢集。  

```
aws eks update-kubeconfig \
    --name my-eks-cluster \
    --role-arn arn:aws:iam::111122223333:role/eksctl-EKS-Linux-Cluster-v1-24-cluster-ServiceRole-j1k7AfTIQtnM
```
輸出：  

```
Updated context arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster in /Users/xxx/.kube/config
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立或更新 Amazon EKS 叢集的 kubeconfig 檔案](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html)。  
**範例 3：透過建立或更新 kubeconfig (使用 role-arn 選項來擔任叢集身分驗證的角色，以及自訂叢集別名和使用者別名) 來設定您的 kubectl，如此您才能連線至名為 `my-eks-cluster` 的 Amazon EKS 叢集**  
下列 `update-kubeconfig` 範例透過建立或更新 kubeconfig (使用 role-arn 選項來擔任叢集身分驗證的角色，以及自訂叢集別名和使用者別名) 來設定您的 kubectl，如此您才能連線至名為 my-eks-cluster 的 Amazon EKS 叢集。  

```
aws eks update-kubeconfig \
    --name my-eks-cluster \
    --role-arn arn:aws:iam::111122223333:role/eksctl-EKS-Linux-Cluster-v1-24-cluster-ServiceRole-j1k7AfTIQtnM \
    --alias stage-eks-cluster \
    --user-alias john
```
輸出：  

```
Updated context stage-eks-cluster in /Users/dubaria/.kube/config
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立或更新 Amazon EKS 叢集的 kubeconfig 檔案](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html)。  
**範例 4：列印 kubeconfig 檔案項目以供檢閱和設定 kubectl，如此您才能連線至名為 `my-eks-cluster` 的 Amazon EKS 叢集**  
下列 `update-kubeconfig` 範例透過建立或更新 kubeconfig (使用 role-arn 選項來擔任叢集身分驗證的角色，以及自訂叢集別名和使用者別名) 來設定您的 kubectl，如此您才能連線至名為 my-eks-cluster 的 Amazon EKS 叢集。  

```
aws eks update-kubeconfig \
    --name my-eks-cluster \
    --role-arn arn:aws:iam::111122223333:role/eksctl-EKS-Linux-Cluster-v1-24-cluster-ServiceRole-j1k7AfTIQtnM \
    --alias stage-eks-cluster \
    --user-alias john \
    --verbose
```
輸出：  

```
Updated context stage-eks-cluster in /Users/dubaria/.kube/config
Entries:

context:
cluster: arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster
user: john
name: stage-eks-cluster

name: john
user:
exec:
    apiVersion: client.authentication.k8s.io/v1beta1
    args:
    - --region
    - us-east-2
    - eks
    - get-token
    - --cluster-name
    - my-eks-cluster
    - --output
    - json
    - --role
    - arn:aws:iam::111122223333:role/eksctl-EKS-Linux-Cluster-v1-24-cluster-ServiceRole-j1k7AfTIQtnM
    command: aws

cluster:
certificate-authority-data: xxx_CA_DATA_xxx
server: https://DALSJ343KE23J3RN45653DSKJTT647TYD.yl4.us-east-2.eks.amazonaws.com
name: arn:aws:eks:us-east-2:111122223333:cluster/my-eks-cluster
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[建立或更新 Amazon EKS 叢集的 kubeconfig 檔案](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html)。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateKubeconfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-kubeconfig.html)。

### `update-nodegroup-config`
<a name="eks_UpdateNodegroupConfig_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-nodegroup-config`。

**AWS CLI**  
**範例 1：更新受管節點群組，將 Amazon EKS 叢集的新標籤和污點新增至 EKS 工作節點**  
下列 `update-nodegroup-config` 範例會更新受管節點群組，將新標籤和污點新增至 Amazon EKS 叢集的 EKS 工作節點。  

```
aws eks update-nodegroup-config \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --labels 'addOrUpdateLabels={my-eks-nodegroup-label-1=value-1,my-eks-nodegroup-label-2=value-2}' \
    --taints 'addOrUpdateTaints=[{key=taint-key-1,value=taint-value-1,effect=NO_EXECUTE}]'
```
輸出：  

```
{
    "update": {
        "id": "e66d21d3-bd8b-3ad1-a5aa-b196dc08c7c1",
        "status": "InProgress",
        "type": "ConfigUpdate",
        "params": [
            {
                "type": "LabelsToAdd",
                "value": "{\"my-eks-nodegroup-label-2\":\"value-2\",\"my-eks-nodegroup-label-1\":\"value-1\"}"
            },
            {
                "type": "TaintsToAdd",
                "value": "[{\"effect\":\"NO_EXECUTE\",\"value\":\"taint-value-1\",\"key\":\"taint-key-1\"}]"
            }
        ],
        "createdAt": "2024-04-08T12:05:19.161000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html)。  
**範例 2：更新受管節點群組以移除 Amazon EKS 叢集 EKS 工作節點的標籤和污點**  
下列 `update-nodegroup-config` 範例會更新受管節點群組，以移除 Amazon EKS 叢集 EKS 工作節點的標籤和污點。  

```
aws eks update-nodegroup-config \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --labels 'removeLabels=my-eks-nodegroup-label-1, my-eks-nodegroup-label-2' \
    --taints 'removeTaints=[{key=taint-key-1,value=taint-value-1,effect=NO_EXECUTE}]'
```
輸出：  

```
{
    "update": {
        "id": "67a08692-9e59-3ace-a916-13929f44cec3",
        "status": "InProgress",
        "type": "ConfigUpdate",
        "params": [
            {
                "type": "LabelsToRemove",
                "value": "[\"my-eks-nodegroup-label-1\",\"my-eks-nodegroup-label-2\"]"
            },
            {
                "type": "TaintsToRemove",
                "value": "[{\"effect\":\"NO_EXECUTE\",\"value\":\"taint-value-1\",\"key\":\"taint-key-1\"}]"
            }
        ],
        "createdAt": "2024-04-08T12:17:31.817000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html)。  
**範例 3：更新受管節點群組以移除和新增 Amazon EKS 叢集 EKS 工作節點的標籤和污點**  
下列 `update-nodegroup-config` 範例會更新受管節點群組，以移除和新增 Amazon EKS 叢集 EKS 工作節點的標籤和污點。  

```
aws eks update-nodegroup-config \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --labels 'addOrUpdateLabels={my-eks-nodegroup-new-label-1=new-value-1,my-eks-nodegroup-new-label-2=new-value-2},removeLabels=my-eks-nodegroup-label-1, my-eks-nodegroup-label-2' \
    --taints 'addOrUpdateTaints=[{key=taint-new-key-1,value=taint-new-value-1,effect=PREFER_NO_SCHEDULE}],removeTaints=[{key=taint-key-1,value=taint-value-1,effect=NO_EXECUTE}]'
```
輸出：  

```
{
    "update": {
        "id": "4a9c8c45-6ac7-3115-be71-d6412a2339b7",
        "status": "InProgress",
        "type": "ConfigUpdate",
        "params": [
            {
                "type": "LabelsToAdd",
                "value": "{\"my-eks-nodegroup-new-label-1\":\"new-value-1\",\"my-eks-nodegroup-new-label-2\":\"new-value-2\"}"
            },
            {
                "type": "LabelsToRemove",
                "value": "[\"my-eks-nodegroup-label-1\",\"my-eks-nodegroup-label-2\"]"
            },
            {
                "type": "TaintsToAdd",
                "value": "[{\"effect\":\"PREFER_NO_SCHEDULE\",\"value\":\"taint-new-value-1\",\"key\":\"taint-new-key-1\"}]"
            },
            {
                "type": "TaintsToRemove",
                "value": "[{\"effect\":\"NO_EXECUTE\",\"value\":\"taint-value-1\",\"key\":\"taint-key-1\"}]"
            }
        ],
        "createdAt": "2024-04-08T12:30:55.486000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html)。  
**範例 4：更新受管節點群組以更新 Amazon EKS 叢集 EKS 工作節點的 scaling-config 和 update-config**  
下列 `update-nodegroup-config` 範例會更新受管節點群組，以更新 Amazon EKS 叢集 EKS 工作節點的 scaling-config 和 update-config。  

```
aws eks update-nodegroup-config \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --scaling-config minSize=1,maxSize=5,desiredSize=2 \
    --update-config maxUnavailable=2
```
輸出：  

```
{
    "update": {
        "id": "a977160f-59bf-3023-805d-c9826e460aea",
        "status": "InProgress",
        "type": "ConfigUpdate",
        "params": [
            {
                "type": "MinSize",
                "value": "1"
            },
            {
                "type": "MaxSize",
                "value": "5"
            },
            {
                "type": "DesiredSize",
                "value": "2"
            },
            {
                "type": "MaxUnavailable",
                "value": "2"
            }
        ],
        "createdAt": "2024-04-08T12:35:17.036000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html)。  
+  如需 API 詳細資訊，請參閱《*AWS CLI 命令參考*》中的 [UpdateNodegroupConfig](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-nodegroup-config.html)。

### `update-nodegroup-version`
<a name="eks_UpdateNodegroupVersion_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-nodegroup-version`。

**AWS CLI**  
**範例 1：更新 Amazon EKS 受管節點群組的 Kubernetes 版本或 AMI 版本**  
下列 `update-nodegroup-version` 範例會將 Amazon EKS 受管節點群組的 Kubernetes 版本或 AMI 版本更新為 Kubernetes 叢集的最新可用版本。  

```
aws eks update-nodegroup-version \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --no-force
```
輸出：  

```
{
    "update": {
        "id": "a94ebfc3-6bf8-307a-89e6-7dbaa36421f7",
        "status": "InProgress",
        "type": "VersionUpdate",
        "params": [
            {
                "type": "Version",
                "value": "1.26"
            },
            {
                "type": "ReleaseVersion",
                "value": "1.26.12-20240329"
            }
        ],
        "createdAt": "2024-04-08T13:16:00.724000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的[更新受管節點群組](https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html)。  
**範例 2：更新 Amazon EKS 受管節點群組的 Kubernetes 版本或 AMI 版本**  
下列 `update-nodegroup-version` 範例會將 Amazon EKS 受管節點群組的 Kubernetes 版本或 AMI 版本更新為指定的 AMI 發行版本。  

```
aws eks update-nodegroup-version \
    --cluster-name my-eks-cluster \
    --nodegroup-name my-eks-nodegroup \
    --kubernetes-version '1.26' \
    --release-version '1.26.12-20240307' \
    --no-force
```
輸出：  

```
{
    "update": {
        "id": "4db06fe1-088d-336b-bdcd-3fdb94995fb7",
        "status": "InProgress",
        "type": "VersionUpdate",
        "params": [
            {
                "type": "Version",
                "value": "1.26"
            },
            {
                "type": "ReleaseVersion",
                "value": "1.26.12-20240307"
            }
        ],
        "createdAt": "2024-04-08T13:13:58.595000-04:00",
        "errors": []
    }
}
```
如需詳細資訊，請參閱《*Amazon EKS 使用者指南*》中的更新受管節點群組 - <https://docs.aws.amazon.com/eks/latest/userguide/update-managed-node-group.html>`。  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdateNodegroupVersion](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-nodegroup-version.html)。

### `update-pod-identity-association`
<a name="eks_UpdatePodIdentityAssociation_cli_topic"></a>

以下程式碼範例顯示如何使用 `update-pod-identity-association`。

**AWS CLI**  
**更新 EKS Pod 身分識別關聯**  
下列 `update-pod-identity-association` 範例會將關聯 ID `a-9njjin9gfghecgocd` 的關聯 IAM 角色從 `arn:aws:iam::111122223333:role/my-role` 變更為 `arn:aws:iam::111122223333:role/s3-role`，以更新 EKS Pod 身分識別關聯。此 API 僅允許更新相關聯的 IAM 角色。  

```
aws eks update-pod-identity-association \
    --cluster-name eks-customer \
    --association-id a-9njjin9gfghecgocd \
    --role-arn arn:aws:iam::111122223333:role/s3-role
```
輸出：  

```
{
    "association": {
        "clusterName": "eks-customer",
        "namespace": "default",
        "serviceAccount": "default",
        "roleArn": "arn:aws:iam::111122223333:role/s3-role",
        "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-9njjin9gfghecgocd",
        "associationId": "a-9njjin9gfghecgocd",
        "tags": {
            "Key2": "value2",
            "Key1": "value1"
        },
        "createdAt": "2025-05-24T19:52:14.135000-05:00",
        "modifiedAt": "2025-05-25T21:01:53.120000-05:00"
    }
}
```
如需詳細資訊，請參閱《Amazon [EKS 使用者指南》中的了解 EKS Pod Identity 如何授予 Pod 對 AWS 服務的存取權](https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html)。 **  
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [UpdatePodIdentityAssociation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-pod-identity-association.html)。