#!/bin/bash set -e export AWS_PAGER="" AWS_REGION=${1-eu-west-1} EKS_NAME=${2} FILESYSTEM_ID=${3} SUFFIX=${4-temp} if [ "$#" -ne 3 ]; then echo "Please pass, 1) AWS Region, 2) EKS name 3) FileSystem Id 4) SUFFIX" exit 1 fi account_id=$(aws sts get-caller-identity --query "Account" --output text) oidc_provider=$(aws eks describe-cluster --name "${EKS_NAME}" --region "${AWS_REGION}" --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///") # Role for EFS CSI service account cat >policy-cdrp-efs-csi-${SUFFIX}.json <trust-relationship-efs-${SUFFIX}.json <policy-cdrp-ext-secrets-${SUFFIX}.json <trust-relationship-ext-secrets-${SUFFIX}.json <