AWS CLI
Progress checklist
The AWS CLI is how you authenticate to AWS
Amazon Web Services — the cloud platform used throughout this walkthrough. from your machine. Terraform uses the same credential chain to create resources, and aws eks update-kubeconfig uses it to write your kubeconfig after the cluster exists. Getting this right first avoids authentication errors in every subsequent step.
-
Install the AWS CLI. Required
Install via Homebrew brew install awscliIf needed, install
unzipandcurlfirst (e.g.sudo apt install -y unzip curlorsudo dnf install -y unzip curl).Install via curl curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install --updateFor ARM (e.g. Graviton or Raspberry Pi):
Terminal window curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install --updateVerify the installation:
Terminal window aws --versionYou should see
aws-cli/2.x.x— version 2 is required. -
Configure AWS access. Required
Choose the path that matches how you set up access in the previous steps.
You need the Access Key ID and Secret Access Key you created in the AWS Account step.
Terminal window aws configureEnter the following when prompted:
- AWS Access Key ID — the key ID (starts with
AKIA...) - AWS Secret Access Key — the secret
- Default region name — the region you chose (e.g.
ap-southeast-6) - Default output format —
json
This writes credentials to
~/.aws/credentialsand config to~/.aws/config.If you completed the IAM Identity Center step, your profile is already configured. Log in:
Terminal window aws sso login --profile eks-walkthroughTo avoid typing
--profileon every command, set the profile as your shell default:Terminal window export AWS_PROFILE=eks-walkthroughAdd the export to
~/.bashrcor~/.zshrcto persist it across sessions.SSO sessions expire (typically after 1–8 hours depending on your permission set). Re-run
aws sso loginwhen the session expires. - AWS Access Key ID — the key ID (starts with
-
Verify access. Required
Terminal window aws sts get-caller-identityExpected output:
{"UserId": "AIDA...","Account": "123456789012","Arn": "arn:aws:iam::123456789012:user/eks-admin"}For IAM Identity Center the ARN will contain
assumed-roleinstead ofuser. Either is correct as long as the account ID matches your account. -
Confirm the default region.
Terminal window aws configure get regionThe output should match the region you chose. If it’s blank or wrong, set it:
Terminal window aws configure set region ap-southeast-6Replace
ap-southeast-6with your region if different.
Next step
Section titled “Next step”Continue to Terraform to install the infrastructure-as-code tool.