Skip to content

Commit

Permalink
updated .envrc-aws
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Dec 16, 2024
1 parent 5b982bc commit e20a8ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .envrc-aws
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ if [ -n "${EKS_CLUSTER:-}" ]; then
# kubectl context is easily created by running adjacent aws_kube_creds.sh script first
export EKS_CONTEXT="arn:aws:eks:$AWS_DEFAULT_REGION:$AWS_ACCOUNT_ID:cluster/$EKS_CLUSTER"

if command -v kubectl &>/dev/null; then
if ! kubectl config get-clusters | grep -Fxq "$EKS_CONTEXT"; then
echo "EKS Cluster '$EKS_CLUSTER' not configured, configuring now"
aws eks update-kubeconfig --name "$EKS_CLUSTER"
echo
fi
fi

# XXX: safer to inline .envrc-kubernetes if you're worried about changes to it bypassing 'direnv allow' authorization
# shellcheck disable=SC1090,SC1091
. "$srcdir/.envrc-kubernetes" "$EKS_CONTEXT" ${EKS_NAMESPACE:+"$EKS_NAMESPACE"}
Expand Down

0 comments on commit e20a8ee

Please sign in to comment.