From 71753107cc50c1c41c78d5ace321b8c3ff65bdc6 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Fri, 28 Jun 2019 15:18:39 +0000 Subject: [PATCH] Dont retry endlessly if there is no account alias --- index.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.py b/index.py index 1638c8c..2941f1d 100644 --- a/index.py +++ b/index.py @@ -84,6 +84,10 @@ def get_source(region, account_id): iam = boto3.client('iam') account_aliases[account_id] = iam.list_account_aliases()['AccountAliases'][0] + # if there is no alias disable further retries + if not account_aliases[account_id]: + RESOLVE_ACCOUNT = False + source['account_alias'] = account_aliases[account_id] except(KeyError, IndexError):