Prerequisites
Three gates before you start: a recent AWS CLI, a Region with ECS Gateway, and credentials that can create the networking, IAM, ECS, and load balancer resources the lab touches.
Any commercial · lab uses ap-southeast-6
AWS CLI and Region
Section titled “AWS CLI and Region”You need AWS CLI 2.38.3 or later. That is the first v2 release with create-gateway and the other ECS Gateway commands. CLI v1 never includes these commands.
brew install awscli# already installed: brew upgrade awscliInstall unzip and curl first if needed (sudo apt install -y unzip curl or sudo dnf install -y unzip curl).
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install --updateARM:
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/install --updateaws --versionaws sts get-caller-identity >/dev/nullaws ecs create-gateway helpaws --version must show aws-cli/2.38.3 or newer. If help says the command is invalid, the CLI is too old. get-caller-identity only checks that you are signed in; redirect keeps account details out of the terminal scrollback you might copy.
ECS Gateway is available in all commercial Regions. Credentials must be able to call ECS, EC2, IAM, and ELB in the Region where you run the lab. The lab uses ap-southeast-6 (Asia Pacific — New Zealand). Opt in that Region on the account if it is not already enabled.
Permissions
Section titled “Permissions”Your credentials need enough access across four services:
Create roles, attach managed policies, iam:PassRole for the infra and task execution roles
Clusters, task definitions, services, and the gateway APIs (CreateGateway, associate, list/describe routes, delete)
Shell variables
Section titled “Shell variables”Keep one shell for the whole lab. Later pages reuse these names.
export AWS_PAGER=""export AWS_REGION=ap-southeast-6export AWS_DEFAULT_REGION="$AWS_REGION"export NAME=ecs-gw-lab
aws sts get-caller-identity >/dev/nullecho "Authenticated. region=$AWS_REGION NAME=$NAME"Confirm you are signed in. Do not paste account IDs, ARNs, or other identity output into issues, PRs, or docs.