Application Design Center and App Lifecycle Manager let you
standardize and scale multi-tenant SaaS delivery without manually configuring
infrastructure for each customer. You assemble reusable Terraform modules into
composite application templates in App Design Center, and then
package those templates into managed SaaS offerings in
App Lifecycle Manager.

In this tutorial, you provision isolated tenant environments and automate
progressive updates and rollouts. This workflow is designed for platform
engineers, enterprise architects, and DevOps operators.

## Objectives

- Prepare a GitHub repository containing Cloud Run and Cloud Storage Terraform modules.
- Link your GitHub repository to Google Cloud using Developer Connect.
- Import the Terraform modules to create and catalog component templates in App Design Center.
- Design a composite application template that includes your component templates.
- Package your template and deploy a customer environment in App Lifecycle Manager.
- Automate progressive rollouts across your customer environments.

## Costs


In this document, you use the following billable components of Google Cloud:


- [Cloud Run](https://cloud.google.com/run/pricing)
- [Cloud Storage](https://cloud.google.com/storage/pricing)
- [Developer Connect](https://cloud.google.com/developer-connect/pricing)


To generate a cost estimate based on your projected usage,
use the [pricing calculator](https://docs.cloud.google.com/products/calculator).
New Google Cloud users might be eligible for a [free trial](https://docs.cloud.google.com/free).

<br />

When you finish the tasks that are described in this document, you can avoid
continued billing by deleting the resources that you created. For more information, see
[Clean up](https://docs.cloud.google.com/application-design-center/docs/tutorials/adc-alm-deployment.md.txt#clean-up).

## Before you begin

1. Make sure that you have the following Identity and Access Management (IAM) roles on your project:
   - **Application Design Center Admin** (`roles/designcenter.admin`) and **Service Usage Admin** (`roles/serviceusage.serviceUsageAdmin`) to perform the setup.
   - **SaaS Service Management Admin** (`roles/saasservicemgmt.admin`)
   - **Developer Connect Admin** (`roles/developerconnect.admin`)
   - **Project IAM Admin** (`roles/resourcemanager.projectIamAdmin`) or **Security Admin** (`roles/iam.securityAdmin`) to create service accounts and grant IAM roles.
   - **Cloud Run Admin** (`roles/run.admin`)
   - **Storage Admin** (`roles/storage.admin`)
   - **Service Account Admin** (`roles/iam.serviceAccountAdmin`)
2. [Install the Google Cloud CLI](https://docs.cloud.google.com/sdk/docs/install), and then [initialize it](https://docs.cloud.google.com/sdk/docs/initializing):

   ```
   gcloud init
   ```
   Make sure that you have the `beta` components installed:

   ```
   gcloud components install beta
   ```
3. Complete the [setup for Application Design Center](https://docs.cloud.google.com/application-design-center/docs/setup.md.txt) on your project using a single-project application management boundary. The setup enables application management, provisions a storage bucket for Terraform, and creates the `default-space` space and `default-catalog` catalog.
4. Install [Git](https://git-scm.com/downloads) on your local machine.
5. Make sure that you have a GitHub account with permissions to create repositories and generate personal access tokens.

<br />

## Set up the environment and source repository

To set up your environment for this tutorial, specify variable values and
configure your GitHub repository.

### Specify tutorial variables

Set variables in this tutorial and in your command terminal.

1. Set the following variables to update the commands in this tutorial:

   | Variable | Description | Value |
   |---|---|---|
   | `PROJECT_ID` | Your Google Cloud project ID | `PROJECT_ID` |
   | `REGION` | Deployment region for App Design Center resources, Developer Connect, App Lifecycle Manager offerings, and tenant infrastructure | `us-central1` |

2. In your command terminal, configure the active Google Cloud project:

   ```bash
   gcloud config set project PROJECT_ID
   ```
3. Retrieve your Google Cloud project number and store it in an
   environment variable:

   ```bash
   PROJECT_NUM=$(gcloud projects describe PROJECT_ID --format="value(projectNumber)")
   ```

### Create Terraform configuration files

Author modular Terraform definitions for Cloud Run and
Cloud Storage. You'll later import these modules into
App Design Center to package them into reusable architectural
components.

1. Create a local directory structure for your Terraform modules:

   ```bash
   mkdir -p adc-alm-starter/infra/cloud-run
   mkdir -p adc-alm-starter/infra/cloud-storage
   cd adc-alm-starter
   ```
2. In `infra/cloud-run/main.tf`, create the Cloud Run module definition:

   ```terraform
   terraform {
     required_version = ">= 1.5.0"
     required_providers {
       google = {
         source  = "hashicorp/google"
         version = ">= 5.0.0"
       }
     }
   }

   variable "project_id" {
     type        = string
     description = "The Google Cloud project ID."
   }

   variable "region" {
     type        = string
     description = "The deployment region."
     default     = "us-central1"
   }

   variable "service_name" {
     type        = string
     description = "Name of the Cloud Run service."
     default     = "sample-app"
   }

   variable "bucket_name" {
     type        = string
     description = "Name of the Cloud Storage bucket to connect."
     default     = ""
   }

   resource "google_service_account" "app_sa" {
     account_id   = "${var.service_name}-sa"
     display_name = "Service Account for ${var.service_name}"
     project      = var.project_id
   }

   resource "google_cloud_run_v2_service" "app_service" {
     name                = var.service_name
     location            = var.region
     project             = var.project_id
     deletion_protection = false

     template {
       service_account = google_service_account.app_sa.email
       containers {
         image = "us-docker.pkg.dev/cloudrun/container/hello"
         env {
           name  = "STORAGE_BUCKET"
           value = var.bucket_name
         }
         resources {
           limits = {
             cpu    = "1"
             memory = "512Mi"
           }
         }
       }
     }
   }

   output "service_url" {
     description = "URL of the deployed Cloud Run service."
     value       = google_cloud_run_v2_service.app_service.uri
   }

   output "service_account_email" {
     description = "Email of the Cloud Run service account."
     value       = google_service_account.app_sa.email
   }
   ```
3. In `infra/cloud-run/metadata.yaml`, create the module metadata definition:

   ```yaml
   apiVersion: blueprints.cloud.google.com/v1alpha1
   kind: BlueprintMetadata
   metadata:
     name: cloud-run-component
   spec:
     info:
       title: Cloud Run Component
       version: 0.1.0
       actuationTool:
         flavor: Terraform
         version: ">= 1.5.0"
     interfaces:
       variables:
         - name: project_id
           description: The Google Cloud project ID.
           varType: string
           required: true
         - name: region
           description: The deployment region.
           varType: string
           defaultValue: us-central1
         - name: service_name
           description: Name of the Cloud Run service.
           varType: string
           defaultValue: sample-app
         - name: bucket_name
           description: Name of the Cloud Storage bucket to connect.
           varType: string
           defaultValue: ""
       outputs:
         - name: service_url
           description: URL of the deployed Cloud Run service.
         - name: service_account_email
           description: Email of the Cloud Run service account.
   ```
4. In `infra/cloud-storage/main.tf`, create the Cloud Storage module definition:

   ```terraform
   terraform {
     required_version = ">= 1.5.0"
     required_providers {
       google = {
         source  = "hashicorp/google"
         version = ">= 5.0.0"
       }
       random = {
         source  = "hashicorp/random"
         version = ">= 3.5.0"
       }
     }
   }

   variable "project_id" {
     type        = string
     description = "The Google Cloud project ID."
   }

   variable "region" {
     type        = string
     description = "The deployment region."
     default     = "us-central1"
   }

   variable "bucket_name_prefix" {
     type        = string
     description = "Prefix for the Cloud Storage bucket."
     default     = "app-data"
   }

   variable "writer_service_account" {
     type        = string
     description = "Service account email granted objectAdmin permissions."
     default     = ""
   }

   resource "random_id" "bucket_suffix" {
     byte_length = 4
   }

   resource "google_storage_bucket" "bucket" {
     name                        = "${var.bucket_name_prefix}-${random_id.bucket_suffix.hex}"
     location                    = var.region
     project                     = var.project_id
     uniform_bucket_level_access = true
     force_destroy               = true
   }

   resource "google_storage_bucket_iam_member" "writer_grant" {
     count  = var.writer_service_account != "" ? 1 : 0
     bucket = google_storage_bucket.bucket.name
     role   = "roles/storage.objectAdmin"
     member = "serviceAccount:${var.writer_service_account}"
   }

   output "bucket_name" {
     description = "Name of the created storage bucket."
     value       = google_storage_bucket.bucket.name
   }
   ```
5. In `infra/cloud-storage/metadata.yaml`, create the module metadata definition:

   ```yaml
   apiVersion: blueprints.cloud.google.com/v1alpha1
   kind: BlueprintMetadata
   metadata:
     name: cloud-storage-component
   spec:
     info:
       title: Cloud Storage Component
       version: 0.1.0
       actuationTool:
         flavor: Terraform
         version: ">= 1.5.0"
     interfaces:
       variables:
         - name: project_id
           description: The Google Cloud project ID.
           varType: string
           required: true
         - name: region
           description: The deployment region.
           varType: string
           defaultValue: us-central1
         - name: bucket_name_prefix
           description: Prefix for the Cloud Storage bucket.
           varType: string
           defaultValue: app-data
         - name: writer_service_account
           description: Service account email granted objectAdmin permissions.
           varType: string
           defaultValue: ""
       outputs:
         - name: bucket_name
           description: Name of the created storage bucket.
   ```

### Push Terraform to GitHub

Commit your Terraform configurations to a GitHub repository and connect the
repository to Google Cloud through Developer Connect. The
connection gives App Design Center secure access to import
infrastructure revisions directly from source control.

1. In a web browser, create a new GitHub repository named `adc-alm-starter`.

2. Create a fine-grained personal access token in GitHub to authenticate your
   `git push` command. Select the
   `adc-alm-starter`
   repository and grant **Contents: Read and write** permissions.

3. In your command terminal, initialize Git in the `adc-alm-starter`
   directory, commit the files, and push to GitHub:

   ```bash
   cd adc-alm-starter
   git init
   git add infra/
   git commit -m "feat: initialize Cloud Run and Cloud Storage modules"
   git branch -M main
   git remote add origin https://github.com/GITHUB_USER_OR_ORG/adc-alm-starter.git
   git push -u origin main
   ```

   When prompted for authentication, enter your GitHub username and personal
   access token.
4. In the Google Cloud console, go to the **Developer Connect** page:

   [Go to Developer Connect](https://console.cloud.google.com/developer-connect)
5. Create a connection in the `us-central1`
   region for your GitHub account and link your repository. For
   detailed instructions, see
   [Connect to GitHub](https://docs.cloud.google.com/developer-connect/docs/connect-github-repo.md.txt).

6. Identify the **Connection ID** and **Git repository link ID** for the linked
   repository and update the following variables:

   - `CONNECTION_ID`: The Developer Connect connection identifier.
   - `GIT_REPO_LINK_ID`: The linked Git repository identifier.

*** ** * ** ***

## Author templates in App Design Center

To design your Google Cloud infrastructure, import Terraform modules into
App Design Center as component templates. Then create a composite
application template that includes the components.

> [!NOTE]
> **Note:** You can create more elaborate composite templates that include standard application templates and component templates. For more information, see [Design composite templates](https://docs.cloud.google.com/application-design-center/docs/design-composite-templates.md.txt).

### Verify your space and catalog

If you completed the App Design Center
[setup](https://docs.cloud.google.com/application-design-center/docs/tutorials/adc-alm-deployment.md.txt#before-you-begin) in the Google Cloud console, your default space and
catalog were automatically created.

If you completed the setup with the gcloud CLI, do the following:

1. Verify that `default-space`
   exists in your region:

   ```bash
   gcloud design-center spaces describe "default-space" \
       --location="us-central1"
   ```

   Replace `default-space`
   with your App Design Center space ID.
2. If the space doesn't exist, create the space and catalog:

   ```bash
   gcloud design-center spaces create "default-space" \
       --location="us-central1" \
       --display-name="Default Space"

   gcloud design-center spaces catalogs create "default-catalog" \
       --space="default-space" \
       --location="us-central1" \
       --display-name="Default Catalog"
   ```

   Replace `default-catalog`
   with your catalog ID.

### Create component templates

Component templates turn individual Terraform modules into building blocks that
you can add to multi-service application templates.

Create component templates based on the Terraform modules in your Git repository:

1. Create a catalog template for Cloud Run:

   ```bash
   gcloud design-center spaces catalogs templates create "cloud-run-component" \
       --space="default-space" \
       --catalog="default-catalog" \
       --location="us-central1" \
       --display-name="Cloud Run Component" \
       --template-category=component-template
   ```

   Replace `cloud-run-component`
   with the identifier for the Cloud Run component template.
2. Create a catalog template for Cloud Storage:

   ```bash
   gcloud design-center spaces catalogs templates create "cloud-storage-component" \
       --space="default-space" \
       --catalog="default-catalog" \
       --location="us-central1" \
       --display-name="Cloud Storage Component" \
       --template-category=component-template
   ```

   Replace `cloud-storage-component`
   with the Cloud Storage component template identifier.
3. Create a template revision by importing the Cloud Run
   Terraform module from your Git repository:

   ```bash
   gcloud design-center spaces catalogs templates revisions create r-1 \
       --template="cloud-run-component" \
       --catalog="default-catalog" \
       --space="default-space" \
       --location="us-central1" \
       --developer-connect-repo="projects/PROJECT_ID/locations/us-central1/connections/CONNECTION_ID/gitRepositoryLinks/GIT_REPO_LINK_ID" \
       --developer-connect-repo-dir="infra/cloud-run" \
       --developer-connect-repo-ref="refs/heads/main"
   ```

   Replace the following:
   - `CONNECTION_ID`: your Developer Connect connection ID.
   - `GIT_REPO_LINK_ID`: your linked Git repository link ID.
4. Create a template revision by importing the Cloud Storage Terraform
   module from your Git repository:

   ```bash
   gcloud design-center spaces catalogs templates revisions create r-1 \
       --template="cloud-storage-component" \
       --catalog="default-catalog" \
       --space="default-space" \
       --location="us-central1" \
       --developer-connect-repo="projects/PROJECT_ID/locations/us-central1/connections/CONNECTION_ID/gitRepositoryLinks/GIT_REPO_LINK_ID" \
       --developer-connect-repo-dir="infra/cloud-storage" \
       --developer-connect-repo-ref="refs/heads/main"
   ```

   Replace the following:
   - `CONNECTION_ID`: your Developer Connect connection ID.
   - `GIT_REPO_LINK_ID`: your linked Git repository link ID.
5. List the shared templates in your space to retrieve their shared template
   IDs:

   ```bash
   gcloud design-center spaces shared-templates list \
       --space="default-space" \
       --location="us-central1"
   ```

   In the command output, note the `SHARED_TEMPLATE_ID` segment from the `name`
   field (`projects/PROJECT_ID/locations/us-central1/spaces/default-space/sharedTemplates/SHARED_TEMPLATE_ID`)
   for both `cloud-run-component` and `cloud-storage-component`.

### Create a composite application template

Combine your component templates into a composite application template and
configure parameter connections. App Lifecycle Manager uses
composite templates to manage your application topology as a SaaS offering.
You specify outputs and inputs to ensure that the Cloud Run
service automatically receives the bucket name and the necessary
IAM permissions to access Cloud Storage.

1. Create a composite application template:

   ```bash
   gcloud design-center spaces application-templates create "run-storage-app" \
       --space="default-space" \
       --location="us-central1" \
       --display-name="Cloud Run and Storage Multi-Tenant Application" \
       --composition-type=composite
   ```

   Replace `run-storage-app`
   with your composite application template identifier.
2. Add the Cloud Run component to the application template:

   ```bash
   gcloud design-center spaces application-templates components create cloud-run-comp \
       --application-template="run-storage-app" \
       --space="default-space" \
       --location="us-central1" \
       --shared-template-revision-uri="projects/PROJECT_ID/locations/us-central1/spaces/default-space/sharedTemplates/RUN_SHARED_TEMPLATE_ID/revisions/r-1"
   ```

   Replace `RUN_SHARED_TEMPLATE_ID`
   with the `cloud-run-component` shared template ID that you retrieved.
3. Add the Cloud Storage component to the application template:

   ```bash
   gcloud design-center spaces application-templates components create cloud-storage-comp \
       --application-template="run-storage-app" \
       --space="default-space" \
       --location="us-central1" \
       --shared-template-revision-uri="projects/PROJECT_ID/locations/us-central1/spaces/default-space/sharedTemplates/STORAGE_SHARED_TEMPLATE_ID/revisions/r-1"
   ```

   Replace `STORAGE_SHARED_TEMPLATE_ID`
   with the `cloud-storage-component` shared template ID that you retrieved.
4. Create a connection from the Cloud Run service to the
   Cloud Storage bucket. This links the bucket output to the service
   environment variable and grants the service account IAM
   access:

   ```bash
   gcloud design-center spaces application-templates components connections create run-to-storage \
       --component=cloud-run-comp \
       --application-template="run-storage-app" \
       --space="default-space" \
       --location="us-central1" \
       --destination-component-uri="projects/PROJECT_ID/locations/us-central1/spaces/default-space/applicationTemplates/run-storage-app/components/cloud-storage-comp" \
       --source-component-parameters='[{"key": "bucket_name", "value": "module.cloud-storage-comp.bucket_name"}]' \
       --destination-component-parameters='[{"key": "writer_service_account", "value": "module.cloud-run-comp.service_account_email"}]'
   ```
5. Commit the application template to generate an immutable template revision:

   ```bash
   gcloud design-center spaces application-templates commit "run-storage-app" \
       --space="default-space" \
       --location="us-central1"
   ```

   The command output confirms the generated revision identifier (such as `r-1`),
   which you'll reference when you create your SaaS offering in
   App Lifecycle Manager.

*** ** * ** ***

## Deploy customer environments with App Lifecycle Manager

Use App Lifecycle Manager to turn your application template into a
deployable product and provision dedicated environments for each customer.

### Package your application template

Register your template revision with App Lifecycle Manager to
create a deployable SaaS offering:

1. Create the SaaS offering in `us-central1`:

   ```bash
   gcloud beta app-lifecycle-manager saas create "saas-run-storage" \
       --location="us-central1" \
       --locations=name="us-central1" \
       --application-template="projects/PROJECT_ID/locations/us-central1/spaces/default-space/applicationTemplates/run-storage-app" \
       --application-template-revision="projects/PROJECT_ID/locations/us-central1/spaces/default-space/applicationTemplates/run-storage-app/revisions/r-1"
   ```

   Replace `saas-run-storage`
   with your SaaS offering identifier.
2. List the generated releases to retrieve the release ID, unit kind, and
   input variables:

   ```bash
   gcloud beta app-lifecycle-manager releases list \
       --location="us-central1"
   ```

   App Lifecycle Manager builds and packages the composite
   template's blueprint asynchronously. If the list is empty, wait a few
   minutes and re-run the command.

   The command outputs the following information:
   - The `name` field (for example, `projects/PROJECT_ID/locations/us-central1/releases/r-r-1-06c6a0`). The trailing segment is your `RELEASE_ID` (such as `r-r-1-06c6a0`).
   - The `unitKind` field (for example, `projects/PROJECT_ID/locations/us-central1/unitKinds/u-native-components-e97e0c`). The trailing segment is your `UNIT_KIND_ID` (such as `u-native-components-e97e0c`).

### Create a deployment service account

Create a service account that gives App Lifecycle Manager
permission to provision resources on your behalf:

1. Create the actuation service account:

   ```bash
   gcloud iam service-accounts create "tenant-actuation-sa" \
       --display-name="Tenant Actuation Service Account"
   ```

   Replace `tenant-actuation-sa`
   with the name of your actuation service account.
2. Construct the service account email and retrieve the
   App Lifecycle Manager service agent identity:

   ```bash
   ACTUATION_SA="tenant-actuation-sa@PROJECT_ID.iam.gserviceaccount.com"
   ALM_P4SA="service-${PROJECT_NUM}@gcp-sa-saasservicemgmt.iam.gserviceaccount.com"
   INFRA_MANAGER_P4SA="service-${PROJECT_NUM}@gcp-sa-config.iam.gserviceaccount.com"
   ```
3. Grant the actuation service account the necessary roles to create and manage
   tenant infrastructure:

   ```bash
   gcloud projects add-iam-policy-binding "PROJECT_ID" \
       --member="serviceAccount:${ACTUATION_SA}" \
       --role="roles/run.admin" \
       --condition=None

   gcloud projects add-iam-policy-binding "PROJECT_ID" \
       --member="serviceAccount:${ACTUATION_SA}" \
       --role="roles/storage.admin" \
       --condition=None

   gcloud projects add-iam-policy-binding "PROJECT_ID" \
       --member="serviceAccount:${ACTUATION_SA}" \
       --role="roles/iam.serviceAccountAdmin" \
       --condition=None

   gcloud projects add-iam-policy-binding "PROJECT_ID" \
       --member="serviceAccount:${ACTUATION_SA}" \
       --role="roles/iam.serviceAccountUser" \
       --condition=None

   gcloud projects add-iam-policy-binding "PROJECT_ID" \
       --member="serviceAccount:${ACTUATION_SA}" \
       --role="roles/config.admin" \
       --condition=None
   ```
4. Grant the App Lifecycle Manager and Infra Manager
   service agents permission to impersonate the actuation service account:

   ```bash
   gcloud iam service-accounts add-iam-policy-binding "${ACTUATION_SA}" \
       --member="serviceAccount:${ALM_P4SA}" \
       --role="roles/iam.serviceAccountUser" \
       --condition=None

   gcloud iam service-accounts add-iam-policy-binding "${ACTUATION_SA}" \
       --member="serviceAccount:${ALM_P4SA}" \
       --role="roles/iam.serviceAccountTokenCreator" \
       --condition=None

   gcloud iam service-accounts add-iam-policy-binding "${ACTUATION_SA}" \
       --member="serviceAccount:${INFRA_MANAGER_P4SA}" \
       --role="roles/iam.serviceAccountUser" \
       --condition=None
   ```

### Deploy an environment for a customer

Create a customer environment and trigger deployment of their dedicated
infrastructure:

1. Create an environment `Unit` representing an isolated customer tenant using
   the generated unit kind:

   ```bash
   gcloud beta app-lifecycle-manager units create "tenant-1" \
       --location="us-central1" \
       --unit-kind="UNIT_KIND_ID"
   ```

   Replace `tenant-1`
   with your tenant unit identifier.
2. Trigger a unit operation to provision the tenant infrastructure:

   ```bash
   gcloud beta app-lifecycle-manager unit-operations create provision-tenant-1 \
       --location="us-central1" \
       --unit="projects/PROJECT_ID/locations/us-central1/units/tenant-1" \
       --provision \
       --provision-release="RELEASE_ID" \
       --provision-input-variables=variable=project_id,value="PROJECT_ID",type=string \
       --provision-input-variables=variable=project_number,value="${PROJECT_NUM}",type=string \
       --provision-input-variables=variable=actuation_sa,value="${ACTUATION_SA}",type=string \
       --provision-input-variables=variable=cloud-run-comp_project_id,value="PROJECT_ID",type=string \
       --provision-input-variables=variable=cloud-run-comp_region,value="us-central1",type=string \
       --provision-input-variables=variable=cloud-storage-comp_project_id,value="PROJECT_ID",type=string \
       --provision-input-variables=variable=cloud-storage-comp_region,value="us-central1",type=string
   ```
3. Describe the unit operation to monitor provisioning status until it reaches
   `SUCCEEDED`:

   ```bash
   gcloud beta app-lifecycle-manager unit-operations describe provision-tenant-1 \
       --location="us-central1"
   ```

*** ** * ** ***

## Automate updates across customer environments

Use rollouts to safely deploy application updates across all your customer
environments.

### Choose an update strategy

Define how updates are delivered to customer environments, such as deploying all
at once or in phases:

1. Create a `RolloutKind` to define the orchestration strategy for your units:

   ```bash
   gcloud beta app-lifecycle-manager rollout-kinds create "progressive-rollout" \
       --location="us-central1" \
       --unit-kind="projects/PROJECT_ID/locations/us-central1/unitKinds/UNIT_KIND_ID" \
       --rollout-orchestration-strategy="Google.Cloud.Simple.AllAtOnce"
   ```

   Replace `progressive-rollout`
   with the rollout kind identifier.

### Deploy and track the update

Start the rollout and monitor its progress until deployment completes:

1. Trigger the rollout to deploy your release across eligible tenant units:

   ```bash
   gcloud beta app-lifecycle-manager rollouts create "rollout-v1" \
       --location="us-central1" \
       --rollout-kind="projects/PROJECT_ID/locations/us-central1/rolloutKinds/progressive-rollout" \
       --release="projects/PROJECT_ID/locations/us-central1/releases/RELEASE_ID"
   ```

   Replace `rollout-v1`
   with the identifier for your rollout.
2. Describe the rollout to inspect active execution and verify that the status
   reaches `SUCCEEDED`:

   ```bash
   gcloud beta app-lifecycle-manager rollouts describe "rollout-v1" \
       --location="us-central1"
   ```

   The rollout output confirms that your tenant units have been updated to the
   target template revision.

## Clean up


To avoid incurring charges to your Google Cloud account for the resources used in this
tutorial, either delete the project that contains the resources, or keep the project and
delete the individual resources.

### Delete the project

> [!CAUTION]
> **Caution** : Deleting a project has the following effects:
>
> - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.
> - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.
>
>
> If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects
> can help you avoid exceeding project quota limits.

Delete a Google Cloud project:

```
gcloud projects delete PROJECT_ID
```

### Delete individual resources

If you deployed the tutorial resources into an existing project, delete the
individual resources in reverse dependency order to prevent unexpected billing:

1. Deprovision the customer environment infrastructure and wait for completion:

   ```bash
   gcloud beta app-lifecycle-manager unit-operations create deprovision-tenant-1 \
       --location="us-central1" \
       --unit="projects/PROJECT_ID/locations/us-central1/units/tenant-1" \
       --deprovision

   gcloud beta app-lifecycle-manager unit-operations describe deprovision-tenant-1 \
       --location="us-central1"
   ```
2. Delete the App Lifecycle Manager customer environment:

   ```bash
   gcloud beta app-lifecycle-manager units delete "tenant-1" \
       --location="us-central1" \
       --quiet
   ```
3. Delete the App Lifecycle Manager rollout and release
   resources in reverse dependency order:

   ```bash
   gcloud beta app-lifecycle-manager rollouts delete "rollout-v1" \
       --location="us-central1" \
       --quiet

   gcloud beta app-lifecycle-manager rollout-kinds delete "progressive-rollout" \
       --location="us-central1" \
       --quiet

   gcloud beta app-lifecycle-manager releases delete "RELEASE_ID" \
       --location="us-central1" \
       --quiet

   gcloud beta app-lifecycle-manager unit-kinds delete "UNIT_KIND_ID" \
       --location="us-central1" \
       --quiet

   gcloud beta app-lifecycle-manager saas delete "saas-run-storage" \
       --location="us-central1" \
       --quiet
   ```
4. Delete the App Design Center application template, catalog
   entries, and space:

   ```bash
   gcloud design-center spaces application-templates delete "run-storage-app" \
       --space="default-space" \
       --location="us-central1" \
       --force \
       --quiet

   gcloud design-center spaces catalogs templates delete "cloud-run-component" \
       --space="default-space" \
       --catalog="default-catalog" \
       --location="us-central1" \
       --force \
       --quiet

   gcloud design-center spaces catalogs templates delete "cloud-storage-component" \
       --space="default-space" \
       --catalog="default-catalog" \
       --location="us-central1" \
       --force \
       --quiet

   gcloud design-center spaces delete "default-space" \
       --location="us-central1" \
       --force \
       --quiet
   ```
5. Delete the Developer Connect Git repository link and
   connection:

   ```bash
   gcloud developer-connect connections git-repository-links delete "GIT_REPO_LINK_ID" \
       --connection="CONNECTION_ID" \
       --location="us-central1" \
       --quiet

   gcloud developer-connect connections delete "CONNECTION_ID" \
       --location="us-central1" \
       --quiet
   ```
6. Delete the actuation service account:

   ```bash
   gcloud iam service-accounts delete "${ACTUATION_SA}" \
       --quiet
   ```

## What's next

- Learn more about [designing composite application templates](https://docs.cloud.google.com/application-design-center/docs/design-composite-templates.md.txt) in App Design Center.
- Learn more about [rollout orchestration strategies](https://docs.cloud.google.com/app-lifecycle-manager/update-saas-offering.md.txt) in App Lifecycle Manager.
- Explore reference architectures, diagrams, and best practices about Google Cloud. Take a look at our [Cloud Architecture Center](https://docs.cloud.google.com/architecture).