little-orange-65618
07/01/2023, 2:20 AMtry:
user = Output(ccloud.get_user_output(email=config['email'])).apply(lambda user: user)
id = IdHolder(user.id)
return id
except:
inv = ccloud.Invitation(resource_name=name, email=config['email'], opts=ResourceOptions(retain_on_delete=True))
id = IdHolder(inv.users[0].id)
return id
The use case is, see if a user exists if not send an invite. Wrapping the .get_user_output() call with a Output() finally lets the except block execute, creating the invitation, but then the program stops no other resources are created