#!/bin/sh # Note: if cluster was created without OIDC provider attached, # you need to run the following command. It is idempotent. #eksctl utils associate-iam-oidc-provider --cluster cluster-name-12341234 --approve if [ "$1" ]; then CLUSTER="$1" else echo "Please indicate cluster to use. Available clusters:" aws eks list-clusters --output table exit 1 fi ACCOUNT=$(aws sts get-caller-identity | jq -r .Account) OIDC=$(aws eks describe-cluster --name $CLUSTER --query cluster.identity.oidc.issuer --output text | cut -d/ -f3-) ROLE_NAME=s3-reader-container-training TRUST_POLICY=$(envsubst <