Skip to content

Instantly share code, notes, and snippets.

@mjaromi
Created February 18, 2021 10:51
Show Gist options
  • Save mjaromi/9ec01e308a77df5e6f47595defcba802 to your computer and use it in GitHub Desktop.
Save mjaromi/9ec01e308a77df5e6f47595defcba802 to your computer and use it in GitHub Desktop.
AWS EKS ConfigMap
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