#3774·artillery

fix: support arn:aws-us-gov partition for GovCloud regions

Author: bestickleyCreated Sep 2, 2026Updated Sep 10, 2026

Problem

Two issues block running Artillery in AWS GovCloud (us-gov-*) regions:

  1. ARN partition hardcoded. The Lambda platform, Fargate/ECS platform, and legacy ECS cluster runner hardcode ARN prefixes to arn:aws / arn:aws-cn only. GovCloud uses partition aws-us-gov, so IAM policies and role ARNs built for us-gov-* regions end up malformed.
  2. ECR image pull permissions missing. GovCloud has no reachable public worker image, so WORKER_IMAGE_URL must point at a private ECR repo. The Fargate worker IAM role only grants ecr:GetAuthorizationToken (needed for docker login), but not ecr:BatchGetImage, ecr:GetDownloadUrlForLayer, or ecr:BatchCheckLayerAvailability, so the task can authenticate but can't actually pull image layers.

Fix

I have a fix ready on my fork: https://github.com/bestickley/artillery/tree/fix/govcloud-arn-partition

  • Added a shared getArnPrefix(region) helper (arn:aws / arn:aws-cn / arn:aws-us-gov) and wired it into aws-lambda/index.ts, aws-ecs/ecs.ts, and aws-ecs/legacy/run-cluster.ts, replacing the duplicated ternaries. Also extended the --task-role-name ARN-prefix check in the legacy ECS runner to accept arn:aws-us-gov:iam.
  • Added ecr:BatchGetImage, ecr:GetDownloadUrlForLayer, and ecr:BatchCheckLayerAvailability to the Fargate worker role's ECR policy statement in aws-ecs/ecs.ts, alongside the existing ecr:GetAuthorizationToken.

I tried to open a PR but got: "An owner of this repository has limited the ability to open a pull request to users that are collaborators on this repository." Could someone either grant PR access or pull the branch directly? Happy to answer questions or split this into two PRs if preferred.