-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Unexpected behavior of default environment (region/account) #59
Comments
I fixed it by doing a horrifying thing
|
Actually no, that didn't fix it :( |
I was able to |
That's funky. I use it with environment variables all the time. |
Hmmm. I'll clean some things up and try again but I tried valiantly and it was not happy |
This error could also be consistent with credentials for one particular account but |
Oh interesting - I thought i had those aligned - lemme check |
When you guys get this working could you add a blurb in the readme on how to access an env var? |
Nobody needs to access env vars. People might need to set them, but I think there should be a limit to what we need to explain. Do we also tell people how to start a Terminal window? |
@Doug-AWS using environment variables for credentials should be transparent. However there is an order of precedence which is definitely something we should document well |
+1 for documenting credential loading precedence. Doug is right that it should be consistent with the other AWS development tools. |
Let's work backwards from the desired behavior (without toolkit credentials plugins installed):
Now for some implementation-related issues. I think one of the reasons we keep seeing inconsistencies is because there were previously conflicting instructions on specifying the Since we still need to relay the region/account in case they are not explicitly specified when a |
* Use environment variables in a way that is consistent with what the various AWS SDKs and CLIs do: + `AWS_REGION` has precedence over `AWS_DEFAULT_REGION` + `AWS_SHARED_CREDENTIALS_FILE` can be used to override the location of the `~/.aws/credentials` file + `AWS_CONFIG_FILE` can be used to override the location of the `.aws/config` file * Ensure the environment variable instructing the JS AWS SDK to load up data from the `~/.aws/config` file gets set by the toolkit before `aws-sdk` is loaded * Create `~/.aws/credentials` if `~/.aws/config` exists, since the JS AWS SDK will start by loading configuration from there, and will fail if it does not exist * Retire the `default-account` and `default-region` keys from the `context` map, and replace them with `aws:cdk:toolkit:` keys that cannot be user-provided Fixes #59
* Adopt SDK-standard behavior when no environment is specified * Use environment variables in a way that is consistent with what the various AWS SDKs and CLIs do: + `AWS_REGION` has precedence over `AWS_DEFAULT_REGION` + `AWS_SHARED_CREDENTIALS_FILE` can be used to override the location of the `~/.aws/credentials` file + `AWS_CONFIG_FILE` can be used to override the location of the `.aws/config` file * Ensure the environment variable instructing the JS AWS SDK to load up data from the `~/.aws/config` file gets set by the toolkit before `aws-sdk` is loaded * Create `~/.aws/credentials` if `~/.aws/config` exists, since the JS AWS SDK will start by loading configuration from there, and will fail if it does not exist * Retire the `default-account` and `default-region` keys from the `context` map, and replace them with `aws:cdk:toolkit:` keys that cannot be user-provided Fixes #59
Hiya friends!
AWS IS SO SECURE 🔐
Tl;dr I have some creds in my env
And I'd love to use them:
Is there some magic trick I need to use? The docs would indicate this should work... What am I missing?
The text was updated successfully, but these errors were encountered: