def on_create()

in lambda/workmail-org-user-domain-lambda/workmailcreateorg.py [0:0]


def on_create(event,orgName):
    props = event["ResourceProperties"]
    print("create new resource with props %s" % props)
    # call workmail organization api
    try:
        workmail_response = client.create_organization(
        Alias = orgName
        )
        print (workmail_response)
        response = {'PhysicalResourceId' : workmail_response['OrganizationId']}
        return response
    except ClientError as q:
        print("Error while creating the organization: %s" % q)