update documentation on automatic lookup of credentials.

Reverts work in #4612
This commit is contained in:
Matthew Hooker 2017-06-13 16:24:50 -07:00
parent dca38b379a
commit 160d31a568
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
2 changed files with 2791 additions and 23 deletions

View File

@ -70,31 +70,17 @@ Credentials are resolved in the following order:
### Automatic Lookup ### Automatic Lookup
If no AWS credentials are found in a packer template, we proceed on to the Packer depends on the [AWS
following steps: SDK](https://aws.amazon.com/documentation/sdk-for-go/) to perform automatic
lookup using _credential chains_. In short, the SDK looks for credentials in
the following order:
1. Lookup via environment variables. 1. Environment variables.
- First `AWS_ACCESS_KEY_ID`, then `AWS_ACCESS_KEY` 2. Shared credentials file.
- First `AWS_SECRET_ACCESS_KEY`, then `AWS_SECRET_KEY` 3. If your application is running on an Amazon EC2 instance, IAM role for Amazon EC2.
- With optional `AWS_SESSION_TOKEN`
2. Look for [local AWS configuration Please refer to the SDK's documentation on [specifying
files](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files) credentials](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#id2) for more information.
- Looks for the credentials file in the `AWS_SHARED_CREDENTIALS_FILE`
environment variable, and if that's empty, use the default credentials
file (`~/.aws/credentials`) in the user's home directory.
- Uses the profile name set in the `AWS_PROFILE` environment variable. If
the environment variable is not set, uses "default" as the profile name.
3. Automatically looked up from an EC2 Instance or ECS Task IAM Role
~> **Subtle details of automatic lookup may change over time.** The most
reliable way to specify your configuration is by setting them in template
variables (directly or indirectly), or by using the `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` environment variables.
Environment variables provide the best portability, allowing you to run your
packer build on your workstation, in Atlas, or on another build server.
## Using an IAM Task or Instance Role ## Using an IAM Task or Instance Role

2782
website/wgetlog Normal file

File diff suppressed because it is too large Load Diff