Skip to content

Instantly share code, notes, and snippets.

@johnbuhay
Created October 31, 2018 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnbuhay/7297cc99ecbca40b63c5785bfa4af787 to your computer and use it in GitHub Desktop.
Save johnbuhay/7297cc99ecbca40b63c5785bfa4af787 to your computer and use it in GitHub Desktop.
aws-iam-authenticator eks heptio-iam-authenticator kubernetes terraform
#!/usr/bin/env sh
set -e
[ -z "$1" ] && exit 1
[ -z "$2" ] && exit 2
AWS_PROFILE=$1 aws-iam-authenticator token -i $2 | jq -M '.status'
#!terraform
# hackity hack, dont come back
data "external" "kube_token" {
program = ["/usr/local/bin/get-token", "saml", "${local.cluster_name}"]
}
provider "external" {
version = "~> 1.0"
}
provider "kubernetes" {
cluster_ca_certificate = "${base64decode(data.terraform_remote_state.infrastructure.cluster_ca_certificate)}"
host = "${data.terraform_remote_state.infrastructure.cluster_endpoint}"
token = "${lookup(data.external.kube_token.result, "token")}"
version = "~> 1.3"
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment