Deploy an application with App Lifecycle Manager
App Lifecycle Manager lets you automate the deployment and lifecycle management of multi-component applications, which helps you provision consistent environments across Google Cloud. In this quickstart, you model a composite application template with Cloud Run and Cloud Storage in Application Design Center, and then provision a live unit.
Before you begin
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the App Lifecycle Manager, Artifact Registry, Cloud Build, Cloud Run, Cloud Storage, Developer Connect, Infrastructure Manager, App Design Center, App Hub, Resource Manager, Identity and Access Management, Cloud Asset Inventory, Cloud Monitoring, Cloud Logging, and Service Health APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
Create a service account:
-
Ensure that you have the Create Service Accounts IAM role
(
roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles. -
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart. - Click Create and continue.
-
Grant the Project > Owner role to the service account.
To grant the role, find the Select a role list, then select Project > Owner.
- Click Continue.
-
Click Done to finish creating the service account.
-
Ensure that you have the Create Service Accounts IAM role
(
- Grant the App Lifecycle Manager
service account the required permissions:
In the Google Cloud console, go to App Lifecycle Manager > Overview > Get started.
- If the banner with the message The required permissions for App Lifecycle Manager account haven't been granted appears, click Grant permissions.
Model your offering using a composite template
Use App Lifecycle Manager and Application Design Center to model a composite
template (run-storage-quickstart) that connects a Cloud Run
service to a Cloud Storage bucket.
Configure your SaaS offering
In Google Cloud console, go to App Lifecycle Manager > SaaS offering.
Click Create.
In the SaaS offering name field, enter
run-storage-quickstart-offering.In the Region list, select the following regions, and then click OK:
us-central1us-east1us-east5
Click Create. Creating
run-storage-quickstart-offeringtakes a few minutes.When the SaaS offering is created, the SaaS offering details page opens.
Create a composite template
- On the SaaS offering details page, click Create new template.
On the Create a new composite template page, configure the template:
- In the Template ID field, enter
run-storage-quickstart. Click Create template.
When App Lifecycle Manager finishes creating the composite template, its details appear in the Connected application template section of the SaaS offering details page.
- In the Template ID field, enter
In the Connected application template section, click Manage template, and then click Configure in canvas.
App Design Center opens in the Google Cloud console.
In the Components area, add the following components to the design canvas:
- Click Cloud Run (Service) to add a
cloud-run-1component to the canvas. - Click Cloud Storage to add a
cloud-storage-1component to the canvas.
- Click Cloud Run (Service) to add a
On the canvas, drag from the cloud-run-1 component to the cloud-storage-1 component to create a connection.
Connecting the components passes the Cloud Run service account to the Cloud Storage bucket's IAM binding with the
roles/storage.objectAdminrole.On the canvas, click the cloud-run-1 component to open the Configuration panel:
- In the Containers area, expand Container 1.
- In the Container Image field, enter the public sample container image
us-docker.pkg.dev/cloudrun/container/hello:latest. - Click Save.
Click Continue > Deploy at scale with App Lifecycle Manager.
App Lifecycle Manager opens in the Google Cloud console.
In the Connected application template section, click Update template revision.
On the Update template revision page, select
r-2in the Revision list, and then click Update.The Connected application template section displays Importing Application Template. When the import finishes, the Unit kinds tab lists the generated
u-native-componentsunit kind.
Provision the application using App Lifecycle Manager
On the SaaS offering details page of
run-storage-quickstart-offering, click Provision.The Provision page opens.
On the Provision page, select
us-central1in the Region list, and then click Add.On the Add unit to provision panel, configure the unit:
- In the Unit name field, enter
run-storage-quickstart-unit-1. - In the Unit kind list, select the
u-native-componentsunit kind. - In the Release list, select the generated release for your template revision.
- In the Service account list, select the actuation service account that you created in the Before you begin section.
- In the Unit name field, enter
Click Add tenant project variables, and then select your project, which will be used to provision the resources.
In the Other input variables area, click Add input variable and enter values for the following component input variables:
- Name:
cloud-run-1_project_id, Variable type:String, and Variable value: your project ID - Name:
cloud-run-1_location, Variable type:String, and Variable value:us-central1 - Name:
cloud-run-1_service_name, Variable type:String, and Variable value:quickstart-web - Name:
cloud-storage-1_project_id, Variable type:String, and Variable value: your project ID - Name:
cloud-storage-1_location, Variable type:String, and Variable value:us-central1 - Name:
cloud-storage-1_name, Variable type:String, and Variable value: a globally unique bucket name, such asPROJECT_ID-quickstart-bkt
- Name:
Click Add. The
run-storage-quickstart-unit-1unit appears in the Units to be provisioned table.Click Provision to deploy
run-storage-quickstart-unit-1.The Cloud Run service and Cloud Storage provision after a few minutes.
To provision additional units in other regions, select the region from the Region list and then click Add.
View the deployed unit
Verify that App Lifecycle Manager provisioned your unit and its resources.
In Google Cloud console, go to the App Lifecycle Manager > Units page.
Click
run-storage-quickstart-unit-1to open the Unit details page.On the Unit details page, check the State field:
- Ready: the Cloud Run service and Cloud Storage bucket are provisioned.
- Provisioning: the deployment operation is still in progress.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
Delete the project
If you deployed the application resources in a new Google Cloud project, and if you no longer need the project, then delete it by completing the following steps:
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- At the prompt, type the project ID, and then click Shut down.
What's next
- To import and deploy custom Terraform components, see the Design and deploy SaaS offerings tutorial.
- To understand more about App Lifecycle Manager, see App Lifecycle Manager overview.
- To get started with App Lifecycle Manager, begin with Create a SaaS offering.
- To understand how service accounts are used and how to grant the required permissions for these accounts, see App Lifecycle Manager service accounts.
- For the steps to update the release, see Update a SaaS offering.