kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject kafka git commit: MINOR: improve test README
Date Thu, 22 Jun 2017 23:17:45 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 4baca9172 -> b62cccd07


MINOR: improve test README

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #3416 from mjsax/minor-aws


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/b62cccd0
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/b62cccd0
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/b62cccd0

Branch: refs/heads/trunk
Commit: b62cccd078210a5333a6dbc64881dd36f925e139
Parents: 4baca91
Author: Matthias J. Sax <matthias@confluent.io>
Authored: Thu Jun 22 16:16:07 2017 -0700
Committer: Ewen Cheslack-Postava <me@ewencp.org>
Committed: Thu Jun 22 16:17:27 2017 -0700

----------------------------------------------------------------------
 tests/README.md                      |  7 +++++++
 vagrant/aws/aws-access-keys-commands | 11 ++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/b62cccd0/tests/README.md
----------------------------------------------------------------------
diff --git a/tests/README.md b/tests/README.md
index ec6ab31..7661cab 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -430,6 +430,13 @@ the test driver machine.
 
         $ git clone https://git-wip-us.apache.org/repos/asf/kafka.git kafka
 
+* Update your AWS credentials:
+
+        export AWS_IAM_ROLE=$(curl -s http://169.254.169.254/latest/meta-data/iam/info |
grep InstanceProfileArn | cut -d '"' -f 4 | cut -d '/' -f 2)
+        export AWS_ACCESS_KEY=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE
| grep AccessKeyId | awk -F\" '{ print $4 }')
+        export AWS_SECRET_KEY=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE
| grep SecretAccessKey | awk -F\" '{ print $4 }')
+        export AWS_SESSION_TOKEN=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE
| grep Token | awk -F\" '{ print $4 }')
+
 * Install some dependencies:
 
         $ cd kafka

http://git-wip-us.apache.org/repos/asf/kafka/blob/b62cccd0/vagrant/aws/aws-access-keys-commands
----------------------------------------------------------------------
diff --git a/vagrant/aws/aws-access-keys-commands b/vagrant/aws/aws-access-keys-commands
index 2c69d29..7e1d3c1 100644
--- a/vagrant/aws/aws-access-keys-commands
+++ b/vagrant/aws/aws-access-keys-commands
@@ -13,13 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-if [ -z "$AWS_IAM" ];then
-    echo "Warning: AWS_IAM is not set"
-fi
-
-export AWS_ACCESS_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM
| grep AccessKeyId | awk -F\" '{ print $4 }'`
-export AWS_SECRET_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM
| grep SecretAccessKey | awk -F\" '{ print $4 }'`
-export AWS_SESSION_TOKEN=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM
| grep Token | awk -F\" '{ print $4 }'`
+export AWS_IAM_ROLE=$(curl -s http://169.254.169.254/latest/meta-data/iam/info | grep InstanceProfileArn
| cut -d '"' -f 4 | cut -d '/' -f 2)
+export AWS_ACCESS_KEY=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE
| grep AccessKeyId | awk -F\" '{ print $4 }')
+export AWS_SECRET_KEY=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE
| grep SecretAccessKey | awk -F\" '{ print $4 }')
+export AWS_SESSION_TOKEN=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM_ROLE
| grep Token | awk -F\" '{ print $4 }')
 
 if [ -z "$AWS_ACCESS_KEY" ]; then
     echo "Failed to populate environment variables AWS_ACCESS_KEY, AWS_SECRET_KEY, and AWS_SESSION_TOKEN."


Mime
View raw message