Skip to content

fix(ssh): pass the task region explicitly to aws ecs execute-command - #27

Open
stooit wants to merge 1 commit into
mainfrom
fix/ssh-explicit-region
Open

stooit wants to merge 1 commit into
mainfrom
fix/ssh-explicit-region

Conversation

@stooit

@stooit stooit commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Problem

qc ssh sets only AWS_DEFAULT_REGION from the ssh-access response. AWS CLI v2 gives AWS_REGION (and --region) precedence over AWS_DEFAULT_REGION. If the user's shell has AWS_REGION set to another region, aws ecs execute-command goes to that region. The org-scoped exec policy allows only the platform region, so the call fails:

AccessDeniedException ... is not authorized to perform: ecs:ExecuteCommand on resource: * because no identity-based policy allows the ecs:ExecuteCommand action

Seen in a support ticket on 2026-10-31: CloudTrail showed the denied calls in ap-southeast-2 while the task runs in ap-southeast-4.

Change

  • Pass --region <task region> to aws ecs execute-command.
  • Set AWS_REGION as well as AWS_DEFAULT_REGION in the child environment.

Tests

tsc --noEmit passes. jest shows 59 failures in 6 suites (logger, api, context, project-config, spinner, platform-consistency). The same 59 fail on unchanged origin/main; none cover ssh.ts.

qc ssh set only AWS_DEFAULT_REGION. AWS CLI v2 gives AWS_REGION precedence,
so a shell with AWS_REGION set to another region sent ExecuteCommand there.
The org-scoped exec policy then denied it with 'on resource: *'.

Pass --region and set AWS_REGION as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant