Created
February 18, 2021 10:51
-
-
Save mjaromi/9ec01e308a77df5e6f47595defcba802 to your computer and use it in GitHub Desktop.
AWS EKS ConfigMap
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
AWS_PROFILE=${AWS_PROFILE:-default} | |
EKS_CLUSTER_NAME= | |
KUBECONFIG=/root/.kube/config | |
TF_STATE=$(terragrunt output -json config_map_aws_auth | jq '.[].metadata[]') | |
CONFIG_MAP_NAMESPACE=$(echo "${TF_STATE}" | jq -r '.namespace') | |
CONFIG_MAP_NAME=$(echo "${TF_STATE}" | jq -r '.name') | |
curl -k \ | |
-H "Authorization: Bearer $(AWS_PROFILE=${AWS_PROFILE} aws eks get-token --cluster-name ${EKS_CLUSTER_NAME} | jq -r .status.token)" \ | |
-H 'Accept: application/json' \ | |
$(yq e '.clusters[].cluster.server' ${KUBECONFIG})/api/v1/namespaces/${CONFIG_MAP_NAMESPACE}/configmaps/${CONFIG_MAP_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment