Skip to content

Support alternate AWS profiles#73

Open
raymondbutcher wants to merge 3 commits intomasterfrom
ray/alternate-aws-profiles
Open

Support alternate AWS profiles#73
raymondbutcher wants to merge 3 commits intomasterfrom
ray/alternate-aws-profiles

Conversation

@raymondbutcher
Copy link
Contributor

@raymondbutcher raymondbutcher commented Apr 7, 2020

We have a case where a customer has a different naming convention for their AWS profiles, so this configuration will work for them but not us:

config "production" {
  aws {
    profile_name = "production"
  }
  ...
}

This PR allows setting the profile name with an environment variable (we'll use direnv) and if it's not set then it will fallback to the other profile name.

The configuration file will look something like this:

config "production" {
  aws {
    profile_name = ["${env.PRODUCTION_AWS_PROFILE}", "production"]
  }
  ...
}

If both users have direnv, then we'll need to put some logic into the .envrc file to conditionally set this PRODUCTION_AWS_PROFILE environment variable. One option is to grep ~/.aws/config for the profile name that we want to use.

@raymondbutcher raymondbutcher force-pushed the ray/alternate-aws-profiles branch from ad2628e to fd3ea53 Compare April 7, 2020 10:48
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.

1 participant