in functions/source/c1cconnectorapi.py [0:0]
def get_account_id(self, aws_account_id):
try:
all_accounts = self.request(GET, "/accounts")
for account in all_accounts.get("data", []):
if account.get("attributes").get("awsaccount-id") == aws_account_id:
logger.info(
"Found account id: "
+ account.get("id")
+ " for "
+ aws_account_id
)
return account.get("id")
except Exception as e:
logger.error(f"could not get account ID from Conformity: {e}")
raise e