in ws_setup.py [0:0]
def setup_iam_role(self):
result = None
try:
cf = boto3.client('cloudformation')
stacks = cf.describe_stacks(StackName=CFStackName)
for stack in stacks["Stacks"]:
outputs = stack["Outputs"]
for output in outputs:
print(output["OutputKey"] + ":" + output["OutputValue"])
if output["OutputKey"] == "IAMRole":
result = output["OutputValue"]
except Exception as e:
errlog("Exception : %s" % str(e))
return None
if result == None:
errlog("IAMRole couldn't be found in the CloudFormation stack")
return None
return result