This repository contains code snippets and examples of an AWS Lambda handler function that implements tenant management requests sent via Amazon SNS & SQS.
There are three main function that represent a tenant management SDK that help service to integrate with the tenant management service (tm_sdk.py):
- parse_tenant_mgmt_requests - parse input of SQS batch messages according to the tenant management service schemas
- verify_tenant_mgmt_request - conduct security checks and verifications
- send_response_to_tenant_mgmt_sqs - reply with success or failure to the tenant management SQS
In the architecture diagram, this is a sample implementation of 'Service x' or Service y', which triggers the tenant provisioning on their end.
This naive implementation assumes tenant creation takes less than 15 minutes (maximum time of a lambda).
For advanced use cases, you can use a step function state machine to handle the service tenant provision.
Further reading and general architecture: SaaS factory demo of Tenant management service SDK and usage