Deploy applications

After you create an application draft from a template, you can deploy the application. When you deploy an application using App Design Center, your application is automatically registered in App Hub. The deployment process lets you do the following:

  • Preview changes that Terraform plans to make to your infrastructure.
  • Enable Google Cloud resource APIs that are required for your application.
  • Investigate deployment issues.
  • Use telemetry data to analyze resource performance.
  • Identify and apply template revisions to your application.

This document helps you deploy, manage, and apply a template revision to your application.

Before you begin

You must have one of the following roles on the app-enabled folder or management project:

  • Application Admin (roles/designcenter.applicationAdmin)
  • Application Operator (roles/designcenter.applicationOperator)

To deploy the application with a service account, you must have one of the following:

  • Your own service account that you configured to deploy applications and underlying resources. For more information, see Grant roles to your service account.
  • The Project IAM Admin (roles/resourcemanager.projectIamAdmin) role on the app-enabled folder. This role lets you create a new service account during deployment.

Deploy your application

Select a service account option and deploy your application. When you deploy an application, Google Cloud resources are created, and you begin to incur charges associated with those resources.

Design canvas

  1. From the navigation menu, click Applications.

    Go to Applications

  2. From the table, click the Application name.

  3. From the Application details page, review the details and click Edit to make changes.

  4. Click Deploy.

  5. Select one of the following service accounts to deploy your application:

    • Select a service account: In the Service account field, enter the name of an existing service account. To configure the service account, see Grant roles to your service account.

    • Create a new service account: You must have the Project IAM Admin (roles/resourcemanager.projectIamAdmin) role, which is used to assign the required deployment roles to the service account.

  6. Click Proceed.

  7. To preview the changes that Terraform plans to make to your infrastructure, do the following:

    1. Click Preview.

    2. Review the changes and click Copy and close. The preview is copied to your clipboard.

    3. To save the preview, paste and save in a document of your choice.

  8. In the Review APIs area, review the list of APIs that are required for your application. The APIs are automatically enabled when you deploy.

  9. Click Deploy. The application details and deployment status are displayed as the deployment completes.

  10. If there are issues with your deployment, do the following:

    1. In the Application details panel, click Deployments.

    2. Review the error messages.

    3. Click View logs to view detailed build information.

  11. To manage your deployed application, see View application details.

gcloud CLI

  1. Preview the application to view the Terraform code before you deploy. This operation might require several minutes to complete. Do one of the following:

    • To automatically create a service account, use the following command:

      gcloud design-center spaces applications preview APPLICATION \
      --project=PROJECT \
      --location=LOCATION \
      --space=SPACE \
      --create-sa \
      --service-account=SERVICE_ACCOUNT
      
    • To use your own service account, use the following command:

      gcloud design-center spaces applications preview APPLICATION \
      --project=PROJECT \
      --location=LOCATION \
      --space=SPACE \
      --service-account=SERVICE_ACCOUNT
      

    Replace the following:

    • APPLICATION: The application ID.
    • PROJECT: Your management project ID.
    • LOCATION: The application region.
    • SPACE: Your space ID.
    • SERVICE_ACCOUNT: Do one of the following:
      • To create a new service account, provide a name for the service account.
      • To use your own service account, provide the full resource name in the format projects/PROJECT/serviceAccounts/EMAIL_ADDRESS.

    For more information, see gcloud design-center spaces applications preview.

  2. Deploy the application asynchronously and copy the full operation name. Do one of the following:

    • To automatically create a service account, use the following command:

       gcloud design-center spaces applications deploy APPLICATION \
       --project=PROJECT \
       --location=LOCATION \
       --space=SPACE \
       --create-sa \
       --service-account=SERVICE_ACCOUNT \
       --async
      
    • To use your own service account, use the following command:

       gcloud design-center spaces applications deploy APPLICATION \
       --project=PROJECT \
       --location=LOCATION \
       --space=SPACE \
       --service-account=SERVICE_ACCOUNT \
       --async
      

    Replace the following:

    • APPLICATION: The application ID.
    • PROJECT: Your management project ID.
    • LOCATION: The application region.
    • SPACE: Your space ID.
    • SERVICE_ACCOUNT: Do one of the following:
      • To create a new service account, provide a name for the service account.
      • To use your own service account, provide the full resource name in the format projects/PROJECT/serviceAccounts/EMAIL_ADDRESS.

    For more information, see gcloud design-center spaces applications deploy.

  3. The deployment requires a few minutes to complete. Track the deployment status.

    gcloud design-center operations describe OPERATION\
    --project=PROJECT \
    --location=LOCATION
    

    Replace the following:

    • OPERATION: The full operation name copied from the deploy command output in the format projects/PROJECT/locations/LOCATION/operations/operation-<var>OPERATION_ID</var>.
    • PROJECT: Your management project ID.
    • LOCATION: The application region.

    For more information, see gcloud design-center operations describe.

View application details

When your application deployment finishes, you can examine its related information. For example, you might view the following:

  • Details such as last update time, revision date, and region.
  • Outputs such as service URI.
  • Deployment status, error information, and links to logs.

To view application details, do the following:

Design canvas

  1. From the navigation menu, click Applications.

    Go to Applications

  2. From the table, click the Application name. The Application details panel displays the following:

    • View app in App Hub: Investigate your application in App Hub. You can view deployed resources and examine telemetry data to diagnose issues and analyze performance. For more information, see Monitor App Hub applications.

    • App Details: View information like the last updated date, source template, region, and service account.

    • Outputs: Identify service URIs, which you can use to interact with your application frontend or backend.

    • Deployments: Examine the deployment status, deployment errors, and links to logs to troubleshoot errors.

gcloud CLI

gcloud design-center spaces applications describe APPLICATION \
--project=PROJECT \
--location=LOCATION \
--space=SPACE

Replace the following:

  • APPLICATION: The application ID.
  • PROJECT: Your management project ID.
  • LOCATION: The application region.
  • SPACE: Your space ID.

For more information, see gcloud design-center spaces applications describe.

Modify deployed applications

If you want to modify a deployed application, do one of the following to make sure that your changes are retained when you redeploy the application:

Apply template revisions

If your application was previously deployed using App Design Center, and an administrator has shared a template revision with you, you can apply the template changes to your application. When you update your application, an application revision is created. You can configure components that were modified or added to the revised template.

You can view available template revisions for your applications using Cloud Hub. For more information, see View deployments.

To apply template revisions to your application, do the following:

Design canvas

  1. From the navigation menu, click Templates.

    Go to Templates

  2. Click the Template ID that contains the revision you want to apply.

  3. From the Configure an app list, select the application that you want to update.

  4. Edit the application details and click Save.

  5. Click each component in the design canvas, and modify component configurations.

  6. Click Deploy. For deployment steps, see Deploy your application.

gcloud CLI

  1. Identify the application template revision URI for the latest revision.

     gcloud design-center spaces application-templates describe APPLICATION_TEMPLATE \
     --project=PROJECT \
     --location=LOCATION \
     --space=SPACE \
     --format='yaml(name,latestRevision)'
    

    Replace the following:

    • APPLICATION_TEMPLATE: The application template ID that is the basis of your application.
    • PROJECT: Your management project ID.
    • LOCATION: The application template region.
    • SPACE: Your space ID.

    For more information, see gcloud design-center spaces application-templates describe.

  2. Copy the latestRevision output.

  3. Update the application to use the application template revision.

     gcloud design-center spaces applications update APPLICATION \
     --project=PROJECT \
     --location=LOCATION \
     --space=SPACE \
     --source-application-template-revision=SOURCE_APPLICATION_TEMPLATE_REVISION
    

    Replace the following:

    • APPLICATION: The application ID.
    • PROJECT: Your management project ID.
    • LOCATION: The application region.
    • SPACE: Your space ID.
    • SOURCE_APPLICATION_TEMPLATE_REVISION: Your application template URI. For example, projects/PROJECT/locations/LOCATION/spaces/SPACE/applicationTemplates/APPLICATION_TEMPLATE/revisions/REVISION

    For more information, see gcloud design-center spaces applications update.

  4. To configure new or updated components in the application, see Configure components and connections.

  5. When you deploy the application, use the --replace flag. For deployment steps, see Deploy your application.