ECR should take AWS_DEFAULT_REGION into account #1580
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Right now when you create new application on AWS EKS, jx reads only
AWS_REGION
environment variable. At the same timejx install --provider=eks
respectsAWS_DEFAULT_REGION
. As a result if you have onlyAWS_DEFAULT_REGION=us-east-1
set on your machine, jx will create EKS cluster inus-east-1
, but new repositories will be created inus-west-1
(which is current default). Also application build respects originalAWS_DEFAULT_REGION
, so eventually application build fail on Jenkins as it tries to push repository in wrong region (west instead of east).According to AWS CLI documentation
AWS_DEFAULT_REGION
is the proper env to set to indicate AWS region. However it is also common for tools to useAWS_REGION
.I propose then that
ecr#NewAwsSession
should respect bothAWS_DEFAULT_REGION
andAWS_REGION
. This simple fix solves the problem.