[Bug] AWS_REGION and AWS_DEFAULT_REGION support broken for `eksctl` commands
What were you trying to accomplish?
eksctl should support AWS_REGION and AWS_DEFAULT_REGION environment variables
What happened?
After updating to 0.148.0 setting AWS_REGION via environment variables doesn't work anymore and just RegionUSWest2 is used
How to reproduce it?
1. AWS_DEFAULT_REGION=eu-central-1 eksctl utils write-kubeconfig --cluster $CLUSTERNAME --kubeconfig=test // broken
2. AWS_REGION=eu-central-1 eksctl utils write-kubeconfig --cluster$CLUSTERNAME --kubeconfig=test // broken
3. eksctl utils write-kubeconfig --region eu-central-1 --cluster$CLUSTERNAME --kubeconfig=test // working
Logs
1. Error: unable to describe cluster control plane: operation error EKS: DescribeCluster, https response error StatusCode: 404, RequestID: 4d81a24f-dc40-4d1d-9718-f5ced4ed3ca4, ResourceNotFoundException: No cluster found for name: $CLUSTERNAME
2. Error: unable to describe cluster control plane: operation error EKS: DescribeCluster, https response error StatusCode: 404, RequestID: 6cbcdc97-2f9c-4ca1-8294-bf749421c34f, ResourceNotFoundException: No cluster found for name: $CLUSTERNAME
3. 2023-07-07 17:01:46 [✔] saved kubeconfig as "test"
Anything else we need to know? Caused by: https://github.com/weaveworks/eksctl/pull/6747
Maybe? https://github.com/weaveworks/eksctl/commit/38d294b75fb84aa3f605e2116b0a0363dc92bb18#diff-6cb45ad9f4ca49a198b4b736bee189dccb0e862901d5fad102cdd5c69023e7f0R35
Versions
$ eksctl info
eksctl version: 0.148.0
kubectl version: v1.27.3
OS: darwin
Hello wind0r :wave: Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website
yes, this seems to be an issue for us too! Commenting to track the progress here.
This also happens when running eksctl get cluster. So need to provide --region now.
v0.147.0 works fine
This is a breaking change. We now have to force v0.147.0 as this is blocking us with some old scripts that don't use the --region flag as they rely on the AWS_DEFAULT_REGION and AWS_REGION env vars.
It seems like a regression not picking up ENVs anymore :thinking: