> [!WARNING]
>
> **Preview**
>
>
> This product or feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section
> of the [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA products and features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

This guide provides an overview of App Lifecycle Manager tenants and how you can use
them to organize your SaaS offering.

## Tenants and tenant projects

An App Lifecycle Manager *tenant resource* represents a logical customer,
client, or *tenant* of your SaaS offering. It acts primarily as an
organizational tool that helps you to group the units belonging to a specific
tenant.

If your SaaS offering has multiple tenants, we recommend that you
provision each of your tenant's resources into a separate Google Cloud project.
To separate your tenant resources into dedicated Google Cloud projects, you'll
need to create at least two projects:

- *Producer project:* The project where your SaaS offering is configured. You only need *one producer project* for your SaaS application.
- *Tenant projects* : The projects with App Lifecycle Manager resources for a specific tenant. We recommend that you make *one project for each of your
  tenants*.

> [!NOTE]
> **Note:** You are responsible for creating both the *producer* and *tenant* projects. You need to create both projects before you can associate them using App Lifecycle Manager.

Using separate projects for each tenant lets you set configurations
(IAM policies, or network peering, for example) within tenant projects,
and helps you track costs and manage resources for each tenant.

### Actuation service accounts in a tenant project

The *actuation service account* needs permissions in the tenant project
to create and manage the resources defined in your Terraform configuration.
We recommend that you set up a separate actuation account for each of your
tenants.

For more information about actuation service accounts and its potentially
required permissions, see [actuation service account](https://docs.cloud.google.com/saas-runtime/docs/overview#actuation-sa).

### APIs in a tenant project

When App Lifecycle Manager uses Infrastructure Manager and the actuation service
account to create resources (a VM, for example) in a tenant project,
the necessary APIs must be enabled *in that tenant project*. Otherwise,
provisioning will fail.

You must enable APIs for *all* resource types your Terraform configuration
uses within a tenant project.

## Use a provisional unit kind to automate your tenant set-up

When you manually create projects, enable APIs, and configure IAM for each
new tenant, it's time consuming and prone to errors. You can automate the
tenant set up process using App Lifecycle Manager by creating a *provisional unit kind*
containing a Terraform configuration that:

- Creates a new Google Cloud project for the tenant.
- Enables the necessary APIs within that new project.
- Creates a dedicated actuation service account for the provisioned tenant (either in the producer project or the tenant project).
- Grants the necessary IAM permissions to service accounts *within
  the tenant project*.
- Sets up networking, logging, or other baseline infrastructure.

Your provisional unit kind should:

- Define Terraform `output` variables for the `tenant_project_id`, `tenant_project_number`, and the `actuation_sa` email it creates.
- Receive `tenant_project_id`, and `tenant_project_number` as `input` variables.

Configure your application unit kind to depend on the provisional unit kind
and map the output variables to the corresponding input variables of the
application unit.

After you configure your unit kind dependencies, App Lifecycle Manager
verifies that the underlying tenant infrastructure unit is provisioned (creating a
tenant project and setting up its permissions) before the unit containing
your application is provisioned.

See [Manage dependencies between units](https://docs.cloud.google.com/saas-runtime/docs/dependencies) and
[use variables](https://docs.cloud.google.com/saas-runtime/docs/variables) for more details on implementing
this pattern.

## What's next

- Learn how to [create tenant projects and resources](https://docs.cloud.google.com/saas-runtime/docs/create-tenants).
- Find out how to [associate units with tenants](https://docs.cloud.google.com/saas-runtime/docs/associate-tenants)