Add AWS_SESSION_TOKEN (#107)

* Add AWS_SESSION_TOKEN

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>

* Update README to include session-token env var

Signed-off-by: Chris Redekop <chris.redekop@d2l.com>
This commit is contained in:
Chris Redekop 2017-10-30 13:39:38 -04:00 committed by Christoph Hartmann
parent 82dc6f3ec7
commit 58b5eed035
2 changed files with 4 additions and 1 deletions

View file

@ -13,11 +13,13 @@ As of now, AWS resources are implemented as an InSpec resource pack. It will shi
## Get started
To run the profile, use InSpec with an environment variable for AWS credentials:
Before running the profile with InSpec, define environment variables with your AWS region and credentials. InSpec supports the following variables:
- `AWS_REGION`
- `AWS_DEFAULT_REGION`
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN`
Those variables are defined in [AWS CLI Docs](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment)

View file

@ -8,6 +8,7 @@ class AWSConnection
credentials: Aws::Credentials.new(
ENV['AWS_ACCESS_KEY_ID'],
ENV['AWS_SECRET_ACCESS_KEY'],
ENV['AWS_SESSION_TOKEN'],
),
}
Aws.config.update(opts)