From 58b5eed035b052cce7b13d96de5edb2dac3078b9 Mon Sep 17 00:00:00 2001 From: Chris Redekop Date: Mon, 30 Oct 2017 13:39:38 -0400 Subject: [PATCH] Add AWS_SESSION_TOKEN (#107) * Add AWS_SESSION_TOKEN Signed-off-by: Chris Redekop * Update README to include session-token env var Signed-off-by: Chris Redekop --- README.md | 4 +++- libraries/aws_conn.rb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cacfaf4e1..7f4668d82 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/libraries/aws_conn.rb b/libraries/aws_conn.rb index 9e6d74466..8fbd9a026 100644 --- a/libraries/aws_conn.rb +++ b/libraries/aws_conn.rb @@ -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)