in Onboarding/AWS/GrantAccessToEksClusters.py [0:0]
def update_aws_auth_for_region(session: boto3.Session, clusters: Set[str], region: str, roles: List[str], role_to_map: str) -> List[str]:
print(f"Attempting to create iamidentitymapping for {len(clusters)} EKS clusters in {region} region")
with tqdm(clusters, total=len(clusters), bar_format=CUSTOM_BAR_FORMAT, desc=f"Progress in {region}", unit=" cluster", ncols=100, file=sys.stdout, colour="GREEN") as pbar:
for role in roles:
role_credentials = get_role_credentials(session, role)
set_credentials(role_credentials)
clusters = update_clusters(clusters, region, pbar, role_to_map)
if not clusters:
break
return clusters