Created
October 31, 2018 23:38
-
-
Save johnbuhay/7297cc99ecbca40b63c5785bfa4af787 to your computer and use it in GitHub Desktop.
aws-iam-authenticator eks heptio-iam-authenticator kubernetes terraform
This file contains 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
#!/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' |
This file contains 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
#!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