This document provides instructions for setting up App Hub to build, operate, and manage applications on Google Cloud. It's intended for people who set up and administer App Hub.
If you are setting up App Hub, the primary tasks are as follows:
- Decide whether to create a new App Hub host project or use
an existing project as your host project.
- If you plan to have more than one host project, we strongly recommend that you create them in the same folder.
- Host projects in App Hub are not the same as Shared VPC host projects and don't have the same requirements. For example, you don't need a Shared VPC network to use App Hub. In this document, all references to host projects are to App Hub host projects.
- A host project cannot be a service project other than for itself.
- Enable the App Hub API in the host project.
- Add one or more App Hub service projects to the host project.
- Service projects in App Hub are not the same as Shared VPC service projects and don't have the same requirements. In this document, all references to service projects are to App Hub service projects.
- Designate App Hub users as App Hub Admins, App Hub Editors, or App Hub Viewers.
- Create applications.
- Register services and workloads to the application.
Services and workloads
Using App Hub, the resources from service projects attached to the host project are available to you as services and workloads. Registering your services and workloads to an application enable you to observe and monitor the resources. You can designate the following resources as App Hub services and register them to App Hub applications:
- Forwarding rules
- URL maps
- Backend services
You can designate managed instance groups (MIGs), but not individual VMs, as workloads and register them to App Hub applications.
App Hub supports the regional L7 external and internal Application load balancers with HTTP or HTTPS traffic.
Workloads and services that you register must be in the same region as the application; hence the instructions and commands that follow assume that all resources are in the same region. For information on which regions you can designate, see Locations.
Overall setup process
The following list summarizes the steps to set up App Hub:
- Determine which existing resources to include in your application and which projects they belong to.
- Create an App Hub host project and enable the App Hub API in the project. Optionally, based on your business's organizational structure, create more than one host project. If you create multiple projects, we recommend creating them in a new folder.
- Attach service projects. After you configure a host project, attach
service projects with underlying resources that your applications need, to
the host project. Note the following:
- The service projects must be in the same organization as the host project. After you attach a service project to a host project, you can't move it to a different organization. To move the service project to a different organization, you must follow the instructions in this document to remove or detach the service project attachment to the host project. You can then attach the service project to a different organization.
- A service project can't be attached to more than one host project.
- A host project can be its own service project, but it can't be a service project for any other host project.
- After you attach service projects to a host project, querying the host project for services or workloads automatically returns all services and workloads in all of the service projects.
- Create an application to organize multiple workloads and services. Note
the following:
- Make sure the application has a name that is unique in the host project and location.
- A service project can be attached to a host project with multiple applications, but its individual resources can be registered to only one application.
- Query for services and workloads and register them to your application.
After you create an application, you query the host project for available
services and workloads. The queries run against the host project and all
service projects that are attached to the host project. They also return all
services and workloads in those projects. Note the following:
- You can only register a service or workload to a single application.
- Any workloads and services that you register must be in the same region as the application.
- Registered services and workloads aren't affected by updates to the underlying infrastructure resource. In other words, if you delete the underlying resources that act as services and workloads, App Hub doesn't delete the associated workloads and services from your application. You have to separately unregister the workload or service.
Prerequisites
Before you set up App Hub, complete the following tasks.
- Decide which existing project is the host project or create a new project to be the host project. We strongly recommend that you create a new project.
- Ensure that you have decided which individuals hold the Identity and Access Management (IAM) roles for App Hub: App Hub Admin, App Hub Editor, and App Hub Viewer.
Note the following:
- Host projects can have one or more service projects attached.
- A service project can't be attached to more than one host project.
- The person attaching a service project to a host project must have the IAM role App Hub Admin in both the service project and host project. For more information, see App Hub roles and permissions.
Set up App Hub
In this section, you create an example App Hub architecture.
In the example, an organization has three service projects, with their infrastructure resources deployed in the projects as follows:
- Service Project 1 has two infrastructure resources, Service 1 and Service 2.
- Service Project 2 has three infrastructure resources, Service 3, Workload 1, and Workload 2.
- Service Project 3 has three infrastructure resources, Service 4, Workload 3, and Workload 4.
Ensure that the projects you choose for creating the example contain the resources described in this section, or be prepared to adjust the example as you go through the instructions.
The following sections contain the instructions for creating an App Hub example. You create a host project and add service projects to the host project, then create an application and attach services and workloads to the application. The example has three service projects, but you can add fewer or more.
The example assumes that any service projects that you add already exist and they contain services and workloads that you add to your application. Before you create the example, determine which service projects contain the services and workloads that you want to include in the application.
Enable App Hub
In this section, you select or create a new host project, enable the App Hub API, and grant appropriate roles and permissions to individuals in your organization. You also attach service projects to the host project.
Console
In the Google Cloud console, go to the project selector page.
Select or create a Google Cloud project, to be your App Hub host project.
-
Enable the required API.
If you are the project creator, you are granted the basic Owner role (
roles/owner
). By default, this Identity and Access Management (IAM) role includes the permissions necessary for full access to most Google Cloud resources.If you aren't the project creator, required permissions must be granted on the project to the appropriate principal. For example, a principal can be a Google Account (for end users) or a service account (for applications and compute workloads). To get the permissions that you need to complete this tutorial, ask your administrator to grant you the following IAM roles on your project:
In the Google Cloud console, go to the IAM page.
Click
Grant access. The Grant access pane opens.In the New principals field, enter the email address of the individual who will administer App Hub, the App Hub Admin role in the host project.
Click Select a role and in the Filter field, enter App Hub.
Select the App Hub Admin role and click Save.
In each of the App Hub service projects, grant the App Hub Admin role to the same user.
In the Google Cloud console, go to the App Hub Settings page.
On the Settings page, click Attach projects.
Do one of the following:
- From the list of projects, select the checkboxes for the projects you want to add as service projects.
- Search for projects and then select the projects to add as service projects.
Click Select. The Attached Service Project(s) table displays the selected service projects.
Click Close.
gcloud
-
In the Google Cloud console, activate Cloud Shell.
At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.
Make sure that the most recent version of Google Cloud CLI is installed. Run the following command from the Cloud Shell:
gcloud components update
Create or select a new project,
HOST_PROJECT_ID
, to be the host project for App Hub.- Create a Google Cloud project:
gcloud projects create HOST_PROJECT_ID
- Select the Google Cloud project that you created:
gcloud config set project HOST_PROJECT_ID
- Create a Google Cloud project:
Enable the App Hub API in the host project that you just created.
gcloud services enable apphub.googleapis.com \ --project=HOST_PROJECT_ID
If you are the project creator, you are granted the basic Owner role (
roles/owner
). By default, this Identity and Access Management (IAM) role includes the permissions necessary for full access to most Google Cloud resources.If you aren't the project creator, required permissions must be granted on the project to the appropriate principal. For example, a principal can be a Google Account (for end users) or a service account (for applications and compute workloads). To get the permissions that you need to complete this tutorial, ask your administrator to grant you the following IAM roles on your project:
Optionally, grant the individuals who will administer App Hub, the App Hub administrator role in the host project. Repeat the following command for each administrator.
gcloud projects add-iam-policy-binding HOST_PROJECT_ID \ --member='user:HOST_PROJECT_ADMIN' \ --role='roles/apphub.admin'
Replace
HOST_PROJECT_ADMIN
with the user who has the App Hub Admin role in the host project. This value has the formatusername@yourdomain
, for example,robert.smith@example.com
.Grant the App Hub Admin role in the service projects to the individuals who administer App Hub. They must have the App Hub Admin role to add service projects to the host project. You need at least one person with this role for each service project. A single person can have the role in multiple service projects.
gcloud projects add-iam-policy-binding SERVICE_PROJECT_1 \ --member='user:HOST_PROJECT_ADMIN' \ --role='roles/apphub.admin'
gcloud projects add-iam-policy-binding SERVICE_PROJECT_2 \ --member='user:HOST_PROJECT_ADMIN' \ --role='roles/apphub.admin'
gcloud projects add-iam-policy-binding SERVICE_PROJECT_3 \ --member='user:HOST_PROJECT_ADMIN' \ --role='roles/apphub.admin'
Replace the following:
SERVICE_PROJECT_1
: the first of three service projects in this example.SERVICE_PROJECT_2
: the second of three service projects in this example.SERVICE_PROJECT_3
: the third of three service projects in this example.
Add your service projects to the App Hub host project.
gcloud apphub service-projects add SERVICE_PROJECT_1 \ --project=HOST_PROJECT_ID
gcloud apphub service-projects add SERVICE_PROJECT_2 \ --project=HOST_PROJECT_ID
gcloud apphub service-projects add SERVICE_PROJECT_3 \ --project=HOST_PROJECT_ID
Create an application
If you don't already have one, create an application to be the container for your services and workloads.
Console
- Make sure that you're in the host project.
In the Google Cloud console, go to the App Hub Applications page.
Click Create application.
On the Create application page, in the Choose application region and name pane, select a Region.
Enter the Application name and click Continue.
Optionally, add more details for the application in the fields that follow. For more information, in this document, see Update an existing App Hub application.
Click Create.
gcloud
Create a new application called
APPLICATION_NAME
and give it a display name,APPLICATION_DISPLAY_NAME
. The flag--scope-type
defines which services and workloads can be registered to an application. OnlyREGIONAL
is supported, which means that only services and workloads from the same region as the application can be registered.gcloud apphub applications create APPLICATION_NAME \ --scope-type=REGIONAL \ --project=HOST_PROJECT_ID \ --location=REGION
Replace the following:
APPLICATION_NAME
: the name of your application. The name must include only lowercase alphanumeric characters without spaces.REGION
: the region of the application. Give this the valueus-east1
.
List the applications in your host project.
gcloud apphub applications list \ --project=HOST_PROJECT_ID \ --location=REGION
The output is similar to the following:
ID: APPLICATION_NAME DISPLAY_NAME: APPLICATION_DISPLAY_NAME CREATE_TIME: 2023-10-31T18:33:48
Get details for the application that you created.
gcloud apphub applications describe APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
The command returns information in YAML format, similar to the following.
createTime: '2023-10-31T18:33:48.199394108Z' displayName: APPLICATION_DISPLAY_NAME name: projects/HOST_PROJECT_ID/locations/REGION/applications/APPLICATION_NAME scope: type: REGIONAL state: ACTIVE uid: [APPLICATION_UID] updateTime: '2023-10-31T18:33:48.343303819Z'
Update an existing App Hub application
You can also update your application's attributes after the application is created.
Console
In the Google Cloud console, go to the App Hub Applications page.
From the list of applications, click
Edit for the application that you'd like to update.Edit fields as required and click Save.
Optional: In the Criticality list, to indicate the importance of the application, select one of the following:
- Mission critical
- High
- Medium
- Low
Optional: In the Environment list, to indicate the stage of the software lifecycle, select one of the following:
- Production
- Staging
- Development
- Test
Optional: Add the following details as required for Developer Owners, Operator Owners, and Business Owners. Note that you must enter the owner's email address if you add a display name.
- Enter an owner's display name.
- Enter the owner's email address. This value must have
the format
username@yourdomain
, for example,222larabrown@gmail.com
.
Repeat these steps for each developer, operator, and business owner.
Click Save.
gcloud
Update your application with the
criticality-type
,environment-type
, and owner type attributes:gcloud apphub applications update APPLICATION_NAME \ --display-name='APPLICATION_DISPLAY_NAME' \ --criticality-type='CRITICALITY_LEVEL' \ --environment-type='ENVIRONMENT' \ --developer-owners=display-name=DISPLAY-NAME-DEVELOPER,email=EMAIL-DEVELOPER \ --operator-owners=display-name=DISPLAY-NAME-OPERATOR,email=EMAIL-OPERATOR \ --business-owners=display-name=DISPLAY-NAME-BUSINESS,email=EMAIL-BUSINESS \ --project=HOST_PROJECT_ID \ --location=REGION
Replace the following:
APPLICATION_DISPLAY_NAME
: the display name of your application.CRITICALITY_LEVEL
: indicates how critical an application, service, or workload is to your business operations. Provide one of the following values:MISSION_CRITICAL
HIGH
MEDIUM
LOW
ENVIRONMENT
: indicates the stages of the software lifecycle. Provide one of the following values:PRODUCTION
STAGING
DEVELOPMENT
TEST
DISPLAY-NAME-DEVELOPER
,DISPLAY-NAME-OPERATOR
, andDISPLAY-NAME-BUSINESS
: display names of the developer, operator, and business owners, respectively.EMAIL-NAME-DEVELOPER
,EMAIL-NAME-OPERATOR
, andEMAIL-NAME-BUSINESS
: email addresses of the developer, operator, and business owners, respectively. These values must have the formatusername@yourdomain
, for example,222larabrown@gmail.com
.
List the applications where the attribute
environment-type
has the valuePRODUCTION
.gcloud apphub applications list \ --filter='attributes.environment.type=PRODUCTION' \ --project=HOST_PROJECT_ID \ --location=REGION
The output is similar to the following:
ID: APPLICATION_NAME DISPLAY_NAME: APPLICATION_DISPLAY_NAME CREATE_TIME: 2023-10-31T18:33:48
Register services and workloads
When you register infrastructure services and workloads to an application, the services and workloads get registered as App Hub resources. If you are using the placeholders to create the application with gcloud CLI, the services and workloads in the three service projects are as follows:
- Service Project 1 has two infrastructure resources, Service 1 and Service 2.
- Service Project 2 has three infrastructure resources, Service 3, Workload 1, and Workload 2.
Service Project 3 has three infrastructure resources, Service 4, Workload 3, and Workload 4.
Console
In the Google Cloud console, go to the App Hub Applications page.
Click the name of your application. The Services and workloads tab is displayed with a list of registered services and workloads that are in your service projects.
For each service or workload you want to register, do the following:
- On the Services and workloads tab, click Register service/workload.
- On the Register service or workload page, in the Select resource pane, click Browse to select the service or workload as a Resource.
- In the Select resource pane, choose a service or workload and click Select.
- In the Select resource pane, enter a Name for the service or workload and click Continue.
- Optionally, in the Add attributes pane, add more details for the service or workload in the fields that follow. For more information, in this document, see Update an existing App Hub application. Note that you can select values for Criticality and Environment fields that are different from the values you set when you create the application.
- Click Continue.
- Optionally, in the Add owners section, add more details about the owners of the service or workload in the fields that follow. For more information, in this document, see Update an existing App Hub application.
- Click Register.
The Services and workloads tab displays the registered service or workload. For more information on the registration statuses, see the properties and attributes of App Hub.
gcloud
Add an individual with App Hub Editor permissions.
gcloud projects add-iam-policy-binding HOST_PROJECT_ID \ --member='user:APP_HUB_EDITOR' \ --role='roles/apphub.editor'
Replace
APP_HUB_EDITOR
with the user who has the App Hub Editor role in the host project. This value has the formatusername@yourdomain
, for example,robert.smith@example.com
.List discovered workloads from service project 2, which is attached to the host project. This command returns workloads that are available to be registered to an application.
gcloud apphub discovered-workloads list \ --filter='workload_properties.gcp_project=projects/SERVICE_PROJECT_2' \ --project=HOST_PROJECT_ID \ --location=REGION
The output is similar to the following, which includes unregistered MIGs:
ID: [DISCOVERED_WORKLOAD_ID_1] WORKLOAD_REFERENCE: {'uri': '//compute.googleapis.com/projects/[SERVICE_PROJECT_2_NUMBER]/regions/REGION/instanceGroups/testing-mig-1'} WORKLOAD_PROPERTIES: {'gcpProject': 'projects/SERVICE_PROJECT_2', 'location': 'REGION'} ID: [DISCOVERED_WORKLOAD_ID_2] WORKLOAD_REFERENCE: {'uri': '//compute.googleapis.com/projects/[SERVICE_PROJECT_2_NUMBER]/regions/REGION/instanceGroups/testing-mig-2'} WORKLOAD_PROPERTIES: {'gcpProject': 'projects/SERVICE_PROJECT_2', 'location': 'REGION'}
Copy the workload ID from the output to use in the next step.
Register a workload from the previous step to your application.
gcloud apphub applications workloads create WORKLOAD_NAME \ --discovered-workload='projects/HOST_PROJECT_ID/locations/REGION/discoveredWorkloads/DISCOVERED_WORKLOAD_ID_2' \ --display-name='mywebserver-deployment1' \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
Replace the following:
WORKLOAD_NAME
: a name to register the workload as.DISCOVERED_WORKLOAD_ID_2
: the workload ID from the output of the previous step.
Repeat the previous two steps to filter and register the workloads you want from Service Project 3.
Optional: You can update the workloads with
criticality-type
,environment-type
, and owner attributes.gcloud apphub applications workloads update WORKLOAD_NAME \ --application=APPLICATION_NAME \ --criticality-type='CRITICALITY_LEVEL' \ --environment-type='ENVIRONMENT' \ --developer-owners=display-name=DISPLAY-NAME-DEVELOPER,email=EMAIL-DEVELOPER \ --operator-owners=display-name=DISPLAY-NAME-OPERATOR,email=EMAIL-OPERATOR \ --business-owners=display-name=DISPLAY-NAME-BUSINESS,email=EMAIL-BUSINESS \ --project=HOST_PROJECT_ID \ --location=REGION
Note that you must provide one of the specified values for
criticality-type
andenvironment-type
but the value can be different from the values you set when you create the application.List registered workloads in the application.
gcloud apphub applications workloads list \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
The output is similar to the following:
ID: WORKLOAD_NAME DISPLAY_NAME: mywebserver-deployment1 WORKLOAD_REFERENCE: {'uri': '//compute.googleapis.com/projects/[SERVICE_PROJECT_2_NUMBER]/regions/REGION/instanceGroups/testing-mig-2'} CREATE_TIME: 2023-10-31T18:34:23
Registered, but detached workloads are denoted by an empty value in the
WORKLOAD_REFERENCE
field. For more information on the registration statuses, see the properties and attributes of App Hub.List discovered services with forwarding rules in the Service Project 1 that is attached to host project. This command returns services that are available to be registered to an application.
gcloud apphub discovered-services list \ --filter='service_properties.gcp_project=projects/SERVICE_PROJECT_1 AND service_reference.uri~"forwardingRules"' \ --project=HOST_PROJECT_ID \ --location=REGION
The output is similar to the following:
ID: [DISCOVERED_SERVICE_ID_1] SERVICE_REFERENCE: {'uri': '//compute.googleapis.com/projects/[SERVICE_PROJECT_1_NUMBER]/regions/REGION/forwardingRules/testing-forwarding-rule-1'} SERVICE_PROPERTIES: {'gcpProject': 'projects/SERVICE_PROJECT_1', 'location': 'REGION'} ID: [DISCOVERED_SERVICE_ID_2] SERVICE_REFERENCE: {'uri': '//compute.googleapis.com/projects/[SERVICE_PROJECT_1_NUMBER]/regions/REGION/forwardingRules/testing-forwarding-rule-2'} SERVICE_PROPERTIES: {'gcpProject': 'projects/SERVICE_PROJECT_1', 'location': 'REGION'}
Copy the service ID,
DISCOVERED_SERVICE_ID_2
from the output to use in the next step.Register the forwarding rule,
testing-forwarding-rule-2
in service project 1 as a service.gcloud apphub applications services create SERVICE_NAME \ --discovered-service='projects/HOST_PROJECT_ID/locations/REGION/discoveredServices/DISCOVERED_SERVICE_ID_2' \ --display-name='mywebserver-service1' \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
Replace the following:
SERVICE_NAME
: a name to register the service as.DISCOVERED_SERVICE_ID_2
: the service ID from the output of the previous step.
Repeat the previous steps that list services, filter those services, and register the services in service projects 1, 2, and 3.
Update a service with the
criticality-type
attribute and theenvironment-type
attribute.gcloud apphub applications services update SERVICE_NAME \ --criticality-type='CRITICALITY_LEVEL' \ --environment-type='ENVIRONMENT' \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
List registered services in the
APPLICATION_NAME
application andHOST_PROJECT_ID
host project.gcloud apphub applications services list \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
The output is similar to the following for each service:
ID: SERVICE_NAME DISPLAY_NAME: mywebserver-service1 SERVICE_REFERENCE: {'uri': '//compute.googleapis.com/projects/[SERVICE_PROJECT_1_NUMBER]/regions/REGION/forwardingRules/testing-forwarding-rule-2'} CREATE_TIME: 2023-11-01T21:38:08
Registered, but detached services are denoted by a empty value in the
SERVICE_REFERENCE
field.Filter the services in the
APPLICATION_NAME
application andHOST_PROJECT_ID
host project to those where theenvironment-type
attribute is set toPRODUCTION
.gcloud apphub applications services list \ --filter='attributes.environment.type=PRODUCTION' \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
The App Hub setup process is complete.
Add or remove service projects
You can modify service project attachments to make different infrastructure resources available to group into an application.
Console
To add a service project to a host project:
In the Google Cloud console, go to the App Hub Settings page.
On the Settings page, click Attach projects.
On the pane that opens, search for projects from the displayed list and select the checkboxes for the projects you want to add as service projects.
Click Select. The Attached Service Project(s) table displays the selected projects as the service projects for the host project.
Click Close.
To remove a service project from a host project:
In the Google Cloud console, go to the App Hub Settings page.
On the Settings page, select the checkboxes for any projects you want to remove as service projects.
Click Detach projects. The Attached Service Project(s) table refreshes to display only the projects that remain attached to the host project.
gcloud
To add a service project to a host project:
gcloud apphub service-projects add SERVICE_PROJECT_ID \ --project=HOST_PROJECT_ID
SERVICE_PROJECT_ID
with the name of the
service project you want to add to the host project.
To remove a service project from the host project:
gcloud apphub service-projects remove SERVICE_PROJECT_ID \ --project=HOST_PROJECT_ID
View existing applications, services, and workloads
You can view applications in a project, and list services and workloads in an application.
Console
To view applications in a project, in the Google Cloud console, go to the App Hub Applications page.
To list services and workloads:
Applications
In the Google Cloud console, go to the App Hub Applications page.
Click the name of an application. A page with a list of services and workloads registered to your application appears.
Optional: To filter the services or workloads:
- In the Filter field, select a filter such as Criticality.
- Select High as the value.
A list of services and workloads of high criticality that is registered to the application, appears.
Services and Workloads
In the Google Cloud console, go to the App Hub Services and Workloads page.
In the Region list, select the regions from where you'd like to view the services and workloads. For example, select us-east1.
The Services and Workloads page displays all the services and workloads from the attached service projects associated with us-east1.Optional: To filter the services or workloads:
- In the Filter field, select a filter such as Environment.
- Select Production as the value.
A list of services and workloads in the production environment that is registered to an application, appears.
gcloud
To view applications in a project:
gcloud apphub applications list \ --project=HOST_PROJECT_ID \ --location=REGION
To list registered services in an application:
gcloud apphub applications services list \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
To list registered workloads in an application:
gcloud apphub applications workloads list \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
Clean up
Clean up an existing application and remove a service project attachment from the host project to remove resources associated with the project. This stops the automatic discovery of resources in the service project.
To do so, you must first delete workloads and services registered to the application.
Console
In the Google Cloud console, go to the App Hub Applications page.
Click the name of an application. A list of services and workloads registered to the application appears.
Unregister a service or a workload.
- On the Services and workloads tab, from the Registered services and workloads section, click the name of the service or workload you'd like to unregister.
- On the Details tab, click Unregister to update the service or
workload as a Discovered resource.
On the Services and workloads tab, an alert notifies that the workload is unregistered. - Repeat these instructions for each service and workload.
Go to the App Hub Applications page.
Click the name of an application.
On the page with the application details, click Delete.
In this document, use the instructions in Add or remove service projects to remove the service projects from your host project.
gcloud
List the registered workloads in the application:
gcloud apphub applications workloads list \ --application=APPLICATION_NAME --project=HOST_PROJECT_ID \ --location=REGION
Unregister the workload from the application:
gcloud apphub applications workloads delete WORKLOAD_NAME \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
The workload is now a discovered workload that can be registered to the application.
Repeat the previous command to delete the remaining registered workloads from the application.
List the registered services in the application:
gcloud apphub applications services list \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
Unregister the service from the application:
gcloud apphub applications services delete SERVICE_NAME \ --application=APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
The service is now a discovered service that can be registered to the application.
Repeat the previous command to unregister the remaining registered services from the application.
Delete the application:
gcloud apphub applications delete APPLICATION_NAME \ --project=HOST_PROJECT_ID \ --location=REGION
Remove a service project from the host project:
gcloud apphub service-projects remove SERVICE_PROJECT_ID \ --project=HOST_PROJECT_ID
Repeat the previous command to remove all service projects from the host project.