Register existing resources to an application

Registering your existing services and workloads into an application lets you simplify management by organizing resources based on their business purpose. This approach provides unified visibility, monitoring, governance, and operational control.

This guide shows you how to group existing services and workloads running in Google Cloud that are not yet formally defined as an application.

Before you begin

You must complete the initial setup for application management before organizing resources into applications. This process typically involves the following roles and steps:

  • For administrators:

    1. Set up application management . Configure an app-enabled folder or a host project to act as the administrative boundary for your applications.
    2. Enable required APIs. Enable APIs for all resources you intend to use.
    3. Grant access to users . Assign appropriate IAM roles based on user's responsibilities in the application lifecycle.
  • For developers and operators:

    1. Confirm with your administrator that the initial setup is finalized.
    2. Make sure you have the necessary IAM roles for the tasks you want to perform.
    3. Open your app-enabled folder or host project, depending on your setup model .

Create an application

Create an application in App Hub to act as a logical container for your existing services and workloads:

Console

  1. In the Google Cloud console, use the project picker to select your host project or the management project of the app-enabled folder, depending on your setup model .
  2. Navigate to the Applicationspage from App Hub:

    Go to Applications

  3. Click Create application.

  4. In the Choose application region and namepane, select the best location for your application based on your geographic distribution requirements:

    • Select Regionalto create a regional application. Then, select the specific region for your application based on App Hub supported regions .
    • Select Globalto create a global application.

    For more information about the best location for your application, see Global and regional applications .

  5. Enter the Application nameand click Continue. This name is a unique identifier that can only contain lowercase letters, numbers, or hyphens. You can't change this name after you create the application.

  6. Optional: Define the application's top-level attributes to support discoverability and governance :

    • In the Add attributessection, enter the Display name. The display name is not a unique identifier, and you can change it after you create the application.
    • In the Criticalitylist, select a value to indicate the importance of the application.
    • In the Environmentlist, select a value to indicate the stage of the software lifecycle.
    • Add contact information details for owners, including their display name and email address. Note that email addresses must have the format username@yourdomain , for example, jane-doe@gmail.com .
  7. Click Create.

gcloud

  1. Use Google Cloud CLI to create an application from your terminal or Cloud Shell:

     gcloud  
    apphub  
    applications  
    create  
     APPLICATION_NAME 
      
     \ 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --scope-type = 
     LOCATION 
      
     \ 
      
    --location = 
     REGION 
      
     \ 
      
    --display-name = 
     DISPLAY_NAME 
      
     \ 
      
    --criticality-type = 
     CRITICALITY 
      
     \ 
      
    --environment-type = 
     ENVIRONMENT 
      
     \ 
      
    --developer-owners = 
    display-name = 
     DEV_NAME 
    ,email = 
     DEV_EMAIL 
      
     \ 
      
    --operator-owners = 
    display-name = 
     OPERATOR_NAME 
    ,email = 
     OPERATOR_EMAIL 
      
     \ 
      
    --business-owners = 
    display-name = 
     BUSINESS_NAME 
    ,email = 
     BUSINESS_EMAIL 
     
    

    Replace APPLICATION_NAME with the name of your application. This name is a unique identifier that can only contain lowercase letters, numbers, or hyphens.

    Use optional flags such as --criticality-type to define the application's top-level attributes and support discoverability and governance .

    For required and optional flags, replace the following:

    • Required: PROJECT_ID : the ID of the host project or management project, depending on your setup model .
    • Required: LOCATION : the location for your application based on your geographic distribution requirements. Use one of the following values:

      • REGIONAL for regional applications.
      • GLOBAL for global applications.

      For more information about the best location for your application, see Global and regional applications .

    • Required: REGION : the specific region for your application. Use one of the following values:

      • If the --scope-type location for your application is set to REGIONAL , specify an App Hub supported region name .
      • If the --scope-type location for your application is set to GLOBAL , use global .
    • Optional: DISPLAY_NAME : the display name of your application. The display name is not a unique identifier and you can change it after you create the application.

    • Optional: CRITICALITY : the importance level of the application for your operations. Use one of the following values:

      • MISSION_CRITICAL
      • HIGH
      • MEDIUM
      • LOW
    • Optional: ENVIRONMENT : the stage of the software lifecycle. Use one of the following values:

      • PRODUCTION
      • STAGING
      • DEVELOPMENT
      • TEST
    • Optional: DEV_NAME and DEV_EMAIL : the display name and email address of the developer owner, respectively.

    • Optional: OPERATOR_NAME and OPERATOR_EMAIL : the display name and email address of the operator owner, respectively.

    • Optional: BUSINESS_NAME and BUSINESS_EMAIL : the display name and email address of the business owner, respectively.

  2. List the applications in your project:

     gcloud  
    apphub  
    applications  
    list  
     \ 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
     
    

    You must obtain an output similar to the following:

     ID  
    DISPLAY_NAME  
    CREATE_TIME APPLICATION_NAME 
      
     DISPLAY_NAME 
      
     2023 
    -10-31T18:33:48 
    

Terraform

To create an application with Terraform, use the google_apphub_application resource . This resource lets you define the application's properties, including its name, location, and attributes.

The following example creates a regional application in us-central1 with defined criticality, environment, and owner attributes:

  resource 
  
 "google_apphub_application" 
  
 "example" 
  
 { 
  
 project 
  
 = 
  
 "my-project-id" 
  
 location 
  
 = 
  
 "us-central1" 
  
 application_id 
  
 = 
  
 "my-application" 
  
 display_name 
  
 = 
  
 "My Application" 
  
 description 
  
 = 
  
 "This application represents our platform." 
  
 scope 
  
 { 
  
 type 
  
 = 
  
 "REGIONAL" 
  
 } 
  
 attributes 
  
 { 
  
 criticality 
  
 { 
  
 type 
  
 = 
  
 "MISSION_CRITICAL" 
  
 } 
  
 environment 
  
 { 
  
 type 
  
 = 
  
 "PRODUCTION" 
  
 } 
  
 business_owners 
  
 { 
  
 display_name 
  
 = 
  
 "Alice" 
  
 email 
  
 = 
  
 "alice@example.com" 
  
 } 
  
 developer_owners 
  
 { 
  
 display_name 
  
 = 
  
 "Bob" 
  
 email 
  
 = 
  
 "bob@example.com" 
  
 } 
  
 operator_owners 
  
 { 
  
 display_name 
  
 = 
  
 "Charlie" 
  
 email 
  
 = 
  
 "charlie@example.com" 
  
 } 
  
 } 
 } 
 

Register services and workloads

After creating an application , register your existing services and workloads to it:

Console

  1. In the Google Cloud console, use the project picker to select your host project or the management project of the app-enabled folder, depending on your setup model .
  2. Navigate to the Applicationspage from App Hub:

    Go to Applications

  3. Click the name of the application for which you want to register existing services and workloads.

  4. From the application's details page, select the Services and workloadstab. This tab displays the list of existing resources that you can register to the application. App Hub lets you select supported resources located within your resource hierarchy as services and workloads.

  5. For each service or workload you want to register, do the following:

    1. In the Services and workloadstab, click Register service/workload.
    2. Navigate to the Select resourcepane and click Browseto find the service or workload you want to register.
    3. Choose the service or workload and click Select.
    4. In the Select resourcepane, enter a name for the service or workload and click Continue.
    5. Optional: In the Add attributespane, define the resource's top-level attributes to support discoverability and governance .

    6. Click Continue.

    7. Optional: In the Add ownerssection, add more details about the owners of the service or workload.

    8. Click Register.

The Services and workloadstab displays the registered service or workload.

gcloud

App Hub lets you select supported resources located within your resource hierarchy as services and workloads. Use Google Cloud CLI to list services or workloads that you can register to the application from your terminal or Cloud Shell. Commands are slightly different for services and workloads:

Register services

  1. List the available services that you can register to an application:

     gcloud  
    apphub  
    discovered-services  
    list  
     \ 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
      
     \ 
      
    --filter = 
     FILTER_EXPRESSION 
     
    

    For required and optional flags, replace the following:

    • Required: PROJECT_ID : the ID of the host project or management project, depending on your setup model .
    • Required: REGION : the specific region of your service based on your geographic distribution. Use one of the following values:

    • Optional: FILTER_EXPRESSION : the filter expression for the --filter flag to only display services from a specified project or with a specific property, for example:

      • service_properties.gcp_project=projects/ PROJECT_ID
      • service_properties.gcp_project=projects/ PROJECT_ID AND service_reference.uri~"forwardingRules"

    The output is similar to the following example:

     ID  
    SERVICE_REFERENCE  
    SERVICE_PROPERTIES SERVICE_ID 
      
     { 
     'uri' 
    :  
     '//compute.googleapis.com/projects/ PROJECT_NUMBER 
    /regions/ REGION 
    /forwardingRules/forwarding-rule' 
     } 
      
     { 
     'gcpProject' 
    :  
     'projects/ PROJECT_ID 
    ' 
    ,  
     'location' 
    :  
     ' REGION 
    ' 
     } 
     
    
  2. Copy the service ID, SERVICE_ID , from the output.

  3. Register the service to your application:

     gcloud  
    apphub  
    applications  
    services  
    create  
     SERVICE_NAME 
      
     \ 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
      
     \ 
      
    --application = 
     APPLICATION_NAME 
      
     \ 
      
    --discovered-service = 
    projects/ PROJECT_ID 
    /locations/ REGION 
    /discoveredServices/ SERVICE_ID 
      
     \ 
      
    --display-name = 
     SERVICE_DISPLAY_NAME 
      
     \ 
      
    --criticality-type = 
     CRITICALITY 
      
     \ 
      
    --environment-type = 
     ENVIRONMENT 
      
     \ 
      
    --developer-owners = 
    display-name = 
     DEV_NAME 
    ,email = 
     DEV_EMAIL 
      
     \ 
      
    --operator-owners = 
    display-name = 
     OPERATOR_NAME 
    ,email = 
     OPERATOR_EMAIL 
      
     \ 
      
    --business-owners = 
    display-name = 
     BUSINESS_NAME 
    ,email = 
     BUSINESS_EMAIL 
     
    

    Replace SERVICE_NAME with the name you want to use to register the service to the application.

    Use optional flags such as --criticality-type to define the service's top-level attributes and support discoverability and governance .

    For required and optional flags, replace the following:

    • Required: PROJECT_ID : the ID of the host project or management project, depending on your setup model .
    • Required: REGION : the specific region of your service based on your geographic distribution. Use one of the following values:

    • Required: APPLICATION_NAME : the name of the application for which you want to register the service.

    • Required: SERVICE_ID : the service ID you copied from the previous output.

    • Optional: SERVICE_DISPLAY_NAME : the display name of your service.

    • Optional: CRITICALITY : the importance level of the service for your operations. Use one of the following values:

      • MISSION_CRITICAL
      • HIGH
      • MEDIUM
      • LOW
    • Optional: ENVIRONMENT : the stage of the software lifecycle. Use one of the following values:

      • PRODUCTION
      • STAGING
      • DEVELOPMENT
      • TEST
    • Optional: DEV_NAME and DEV_EMAIL : the display name and email address of the developer owner, respectively.

    • Optional: OPERATOR_NAME and OPERATOR_EMAIL : the display name and email address of the operator owner, respectively.

    • Optional: BUSINESS_NAME and BUSINESS_EMAIL : the display name and email address of the business owner, respectively.

  4. List the registered services in your application:

     gcloud  
    apphub  
    applications  
    services  
    list  
     \ 
      
    --application = 
     APPLICATION_NAME 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
     
    

    You must obtain an output similar to the following for each registered service:

     ID  
    DISPLAY_NAME  
    SERVICE_REFERENCE  
    CREATE_TIME SERVICE_NAME 
      
     SERVICE_DISPLAY_NAME 
      
     { 
     'uri' 
    :  
     '//compute.googleapis.com/projects/ PROJECT_NUMBER 
    /regions/ REGION 
    /forwardingRules/forwarding-rule' 
     } 
      
     2023 
    -11-01T21:38:08 
    

Register workloads

  1. List the available workloads that you can register to an application:

     gcloud  
    apphub  
    discovered-workloads  
    list  
     \ 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
      
     \ 
      
    --filter = 
     FILTER_EXPRESSION 
     
    

    For required and optional flags, replace the following:

    • Required: PROJECT_ID : the ID of the host project or management project, depending on your setup model .
    • Required: REGION : the specific region of your workload based on your geographic distribution. Use one of the following values:

    • Optional: FILTER_EXPRESSION : the filter expression for the --filter flag to only display workloads from a specified project or with a specific property, for example, workload_properties.gcp_project=projects/ PROJECT_ID .

    The output is similar to the following example:

     ID  
    WORKLOAD_REFERENCE  
    WORKLOAD_PROPERTIES WORKLOAD_ID 
      
     { 
     'uri' 
    :  
     '//compute.googleapis.com/projects/ PROJECT_NUMBER 
    /regions/ REGION 
    /instanceGroups/mig-name' 
     } 
      
     { 
     'gcpProject' 
    :  
     'projects/ PROJECT_ID 
    ' 
    ,  
     'location' 
    :  
     ' REGION 
    ' 
     } 
     
    
  2. Copy the workload ID, WORKLOAD_ID , from the output.

  3. Register the workload to your application:

     gcloud  
    apphub  
    applications  
    workloads  
    create  
     WORKLOAD_NAME 
      
     \ 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
      
     \ 
      
    --application = 
     APPLICATION_NAME 
      
     \ 
      
    --discovered-workload = 
    projects/ PROJECT_ID 
    /locations/ REGION 
    /discoveredWorkloads/ WORKLOAD_ID 
      
     \ 
      
    --display-name = 
     WORKLOAD_DISPLAY_NAME 
      
     \ 
      
    --criticality-type = 
     CRITICALITY 
      
     \ 
      
    --environment-type = 
     ENVIRONMENT 
      
     \ 
      
    --developer-owners = 
    display-name = 
     DEV_NAME 
    ,email = 
     DEV_EMAIL 
      
     \ 
      
    --operator-owners = 
    display-name = 
     OPERATOR_NAME 
    ,email = 
     OPERATOR_EMAIL 
      
     \ 
      
    --business-owners = 
    display-name = 
     BUSINESS_NAME 
    ,email = 
     BUSINESS_EMAIL 
     
    

    Replace WORKLOAD_NAME with the name you want to use to register the workload to the application.

    Use optional flags such as --criticality-type to define the workload's top-level attributes and support discoverability and governance .

    For required and optional flags, replace the following:

    • Required: PROJECT_ID : the ID of the host project or management project, depending on your setup model .
    • Required: REGION : the specific region of your workload based on your geographic distribution. Use one of the following values:

    • Required: APPLICATION_NAME : the name of the application for which you want to register the workload.

    • Required: WORKLOAD_ID : the workload ID you copied from the previous output.

    • Optional: WORKLOAD_DISPLAY_NAME : the display name of your workload.

    • Optional: CRITICALITY : the importance level of the workload for your operations. Use one of the following values:

      • MISSION_CRITICAL
      • HIGH
      • MEDIUM
      • LOW
    • Optional: ENVIRONMENT : the stage of the software lifecycle. Use one of the following values:

      • PRODUCTION
      • STAGING
      • DEVELOPMENT
      • TEST
    • Optional: DEV_NAME and DEV_EMAIL : the display name and email address of the developer owner, respectively.

    • Optional: OPERATOR_NAME and OPERATOR_EMAIL : the display name and email address of the operator owner, respectively.

    • Optional: BUSINESS_NAME and BUSINESS_EMAIL : the display name and email address of the business owner, respectively.

  4. List the registered workloads in your application:

     gcloud  
    apphub  
    applications  
    workloads  
    list  
     \ 
      
    --application = 
     APPLICATION_NAME 
      
    --project = 
     PROJECT_ID 
      
     \ 
      
    --location = 
     REGION 
     
    

    You must obtain an output similar to the following for each registered workload:

     ID  
    DISPLAY_NAME  
    WORKLOAD_REFERENCE  
    CREATE_TIME WORKLOAD_NAME 
      
     WORKLOAD_DISPLAY_NAME 
      
     { 
     'uri' 
    :  
     '//compute.googleapis.com/projects/ PROJECT_NUMBER 
    /regions/ REGION 
    /instanceGroups/mig-name' 
     } 
      
     2023 
    -11-01T21:38:08 
    

Terraform

To register services or workloads to an application using Terraform, use the google_apphub_discovered_service and google_apphub_discovered_workload data sources to dynamically retrieve information about the resources you want to register.

Then, use the google_apphub_service or google_apphub_workload resources to register services or workloads, respectively.

Register services

  1. Get information about a service using its URI:

      data 
      
     "google_apphub_discovered_service" 
      
     "my-service" 
      
     { 
      
     location 
      
     = 
      
     " REGION 
    " 
      
     service_uri 
      
     = 
      
     " SERVICE_URI 
    " 
     } 
     
    
  2. Register the discovered service to your application, for example:

      resource 
      
     "google_apphub_service" 
      
     "example" 
      
     { 
      
     project 
      
     = 
      
     "my-project-id" 
      
     location 
      
     = 
      
     "us-central1" 
      
     application_id 
      
     = 
      
     google_apphub_application.example.application_id 
      
     service_id 
      
     = 
      
     "frontend-load-balancer" 
      
     discovered_service 
      
     = 
      
     data.google_apphub_discovered_service.my-forwarding-rule.name 
      
     display_name 
      
     = 
      
     "Frontend Load Balancer" 
      
     description 
      
     = 
      
     "The primary load balancer for the frontend." 
     } 
     
    

Register workloads

  1. Get information about a workload using its URI:

      data 
      
     "google_apphub_discovered_workload" 
      
     "my-workload" 
      
     { 
      
     location 
      
     = 
      
     " REGION 
    " 
      
     workload_uri 
      
     = 
      
     " WORKLOAD_URI 
    " 
     } 
     
    
  2. Register the discovered workload to your application, for example:

      resource 
      
     "google_apphub_workload" 
      
     "example" 
      
     { 
      
     project 
      
     = 
      
     "my-project-id" 
      
     location 
      
     = 
      
     "us-central1" 
      
     application_id 
      
     = 
      
     google_apphub_application.example.application_id 
      
     workload_id 
      
     = 
      
     "frontend-instance-group" 
      
     discovered_workload 
      
     = 
      
     data.google_apphub_discovered_workload.my-mig.name 
      
     display_name 
      
     = 
      
     "Frontend Instance Group" 
      
     description 
      
     = 
      
     "The managed instance group for the frontend." 
     } 
     
    

The registration status of services and workloads registered to an application can change to detached if you modify the organizational structure of your Google Cloud resources or delete the underlying resource. Detached services and workloads remain in the application until you unregister them. For more information, see Registration status of services and workloads .

Grant permissions and begin operations

After creating an application and registering your resources in App Hub, you grant user access based on responsibilities and manage this logic grouping as a single unit:

  1. Depending on your access needs, you can grant permissions to your application . For a list of recommended roles, see Grant application-centric roles to your users .
  2. Navigate to Cloud Hub to see a unified operational dashboard for your defined application, including its health, performance, and cost data.
Create a Mobile Website
View Site in Mobile | Classic
Share by: