Skip to content

AWS_REGION env var on EKS pods overrides region set in task configuration #612

@danielasher115

Description

@danielasher115

Describe the bug

When using self-hosted Azure DevOps agents hosted in Amazon EKS, the pods have an AWS_REGION environment variable injected by the cluster (e.g. via IAM Roles for Service Accounts / pod identity or node-level defaults). The AWS Toolkit tasks appear to read this environment variable instead of (or with higher priority than) the region explicitly configured in the task definition, causing tasks to run against the wrong region or fail entirely.

To reproduce

  1. Host a self-hosted Azure DevOps agent inside an EKS pod.
  2. Ensure the pod has AWS_REGION set (e.g. us-east-1) - this is commonly injected automatically by EKS/IRSA.
  3. Configure an AWS Toolkit task (e.g. S3 Upload, CloudFormation Deploy) with a different region explicitly set in the task parameters (e.g. eu-west-1).
  4. Run the pipeline.
  5. Observe that the task targets the region from the environment variable, not the one defined in the task.

Expected behavior

The region explicitly set in the task configuration should always take precedence over any AWS_REGION environment variable present in the agent's environment. The task-level setting should be the authoritative source of truth.

Screenshots

Your Environment

  • On-prem or cloud based?: Cloud
  • AWS Toolkit for Azure DevOps version: 1.24.0
  • Agent type: Self-hosted, running in Amazon EKS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions