LinuxCommandLibrary

aws-eks

Manage Amazon EKS clusters from the command line

TLDR

Create an EKS Cluster

$ aws eks create-cluster --name [cluster_name] --role-arn [eks_service_role_arn] --resources-vpc-config subnetIds=[subnet_ids],securityGroupIds=[security_group_ids]
copy

Update kubeconfig to connect to the EKS Cluster
$ aws eks update-kubeconfig --name [cluster_name]
copy

List available EKS clusters
$ aws eks list-clusters
copy

Describe EKS cluster details
$ aws eks describe-cluster --name [cluster_name]
copy

Delete an EKS Cluster
$ aws eks delete-cluster --name [cluster_name]
copy

List nodegroups in an EKS cluster
$ aws eks list-nodegroups --cluster-name [cluster_name]
copy

Describe nodegroup details
$ aws eks describe-nodegroup --cluster-name [cluster_name] --nodegroup-name [nodegroup_name]
copy

SYNOPSIS

aws eks [--region <REGION>] [--output <FORMAT>] [--profile <PROFILE>] <subcommand> [<args>]

PARAMETERS

--cli-input-json
    Perform the operation using JSON input.

--cli-auto-prompt
    Automatically prompt for missing required parameters.

--no-cli-pager
    Disable cli pager for output.

--cli-binary-format
    Base64 encoding for binary data.

--region
    AWS region (e.g., us-west-2).

--output
    Output format: json|text|table.

--profile
    Named profile from AWS config file.

--debug
    Enable debug logging.

--endpoint-url
    Custom endpoint URL.

--no-verify-ssl
    Disable SSL certificate verification.

DESCRIPTION

The aws eks command is a subcommand of the AWS Command Line Interface (CLI) for interacting with Amazon Elastic Kubernetes Service (EKS), AWS's managed Kubernetes platform. It enables users to create, configure, update, and delete EKS clusters, node groups, Fargate profiles, add-ons, and identity providers.

EKS simplifies running Kubernetes without managing the control plane. Use aws eks to list clusters (list-clusters), describe resources, associate VPCs, manage access entries, and generate kubeconfig for kubectl integration via update-kubeconfig.

Requires AWS CLI v2 (recommended), configured credentials (via aws configure), and IAM permissions like eks:CreateCluster. Outputs JSON by default; specify --output table for readability. Supports regions where EKS is available. Integrates with other AWS services like EC2, VPC, and IAM.

Common workflow: create cluster, add node group, deploy apps via Kubernetes tools.

CAVEATS

Requires AWS CLI installed/configured and EKS IAM permissions. Not all features available in all regions. High costs for clusters/node groups; monitor via AWS Cost Explorer. Subcommands have specific quotas/limits (e.g., 100 clusters/region).

KEY SUBCOMMANDS

list-clusters: List clusters.
create-cluster: Create cluster.
delete-cluster: Delete cluster.
update-kubeconfig: Update kubeconfig.
create-nodegroup: Create managed node group.
list-nodegroups: List node groups.
create-fargate-profile: Create Fargate profile.

EXAMPLE USAGE

aws eks list-clusters --region us-west-2
aws eks create-cluster --name my-cluster --role-arn arn:aws:iam::123:role/eks-role --resources-vpc-config subnetIds=subnet-abc,subnet-def --region us-west-2

HISTORY

Introduced in AWS CLI v1.16.156 (July 2018) with EKS public preview; stabilized at GA in late 2018. Enhanced in CLI v2 (2020+) with better performance, Fargate support (2019), and Bottlerocket nodes. Frequent updates align with Kubernetes versions (up to 1.30+).

SEE ALSO

aws(1), kubectl(1), eksctl(1), k9s(1)

Copied to clipboard