Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AWS Region with Default region #478

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NickLaMuro
Copy link

Overview

When using the aws plugin, if the DEFAULT_REGION is set in the 1Password item, it will override any usage of AWS_REGION, which should take president normally with the aws cli, preventing the usage of being able to connect to other regions unless you regularly change the DEFAULT_REGION value in the 1Password each time.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

  • Resolves: #
  • Relates: #

How To Test

  • Set a DEFAULT_REGION value in your 1Password item you use for the aws plugin
  • Run a aws s3 ls (or something similar)
    • Validate these are in the region of DEFAULT_REGION
  • Run AWS_REGION=different-region aws s3 ls, using a different-region then the one you have configured
    • Validate the buckets from the previous command are different

In the previous version, this would return the same value for both commands, and this should fix that.

Other options is quering for something specific by ARN that exists in only in the DEFAULT_REGION, and with this patch, the second command will fail, where previously it would find it.

Changelog

Fix DEFAULT_REGION logic for aws plugin to allow for overrides using AWS_REGION.

Copy link
Contributor

github-actions bot commented Aug 6, 2024

⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.

Learn how to use 1Password to sign your commits.

Watch the demo

@NickLaMuro NickLaMuro force-pushed the fix-local-aws-config-default-region-issues branch from c743f7f to 2d45c84 Compare August 6, 2024 00:42
Default region should only be used to fill in a region when
awsConfig.Region doesn't exist (and set it accordingly, but not be the
sole determinant on if there is a difference.  It should defer to what
is already does in the `else if` later, where it sets it if it isn't
blank, but doesn't error.

Right now, it will error if `default region` is set in the 1Password
item, but in reality, it should only do that if `region` (aka:
`hasRegularRegion`) is set.

This updates this logic to reflect that.
Now not used by the error check below, so removing.
@NickLaMuro NickLaMuro force-pushed the fix-local-aws-config-default-region-issues branch from 2d45c84 to ec4ef7a Compare August 6, 2024 00:58
@NickLaMuro NickLaMuro force-pushed the fix-local-aws-config-default-region-issues branch from 97aed46 to f3cded3 Compare August 6, 2024 01:33
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.

2 participants