Created
April 14, 2020 19:39
-
-
Save hsm207/d26f8dd20213de9e4c93ef2941df78f5 to your computer and use it in GitHub Desktop.
Install the aws iam authenticator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html | |
BUCKET=amazon-eks | |
VERSION=`aws s3 ls s3://$BUCKET/ | | |
grep --invert-match "cloudformation\|manifests" | | |
awk '{print $2}' | | |
cut -d/ -f 1 | | |
sort --version-sort --reverse | | |
head -n 1` | |
echo "The latest aws-iam-authenticator version is" $VERSION | |
KEY=`aws s3 ls --recursive s3://$BUCKET/$VERSION/ | | |
grep linux/amd64/aws-iam-authenticator$ | | |
tr -s ' ' | | |
cut -d ' ' -f 4` | |
echo "Copying aws-iam-authenticator from" s3://$BUCKET/$KEY | |
aws s3 cp s3://$BUCKET/$KEY . | |
chmod +x ./aws-iam-authenticator | |
sudo mv aws-iam-authenticator /usr/local/bin | |
# verify installation | |
aws-iam-authenticator help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment