Stay organized with collections Save and categorize content based on your preferences.
Last reviewed 2023-08-29 UTC
This guide describes how to delete the AI/ML image processing on Cloud Functions Jump Start Solution. You can use this guide to delete an existing deployment of the solution. AI/ML image processing on Cloud Functions can no longer be deployed from the Google Cloud console, and is not supported.
CostFor an estimate of the cost of the Google Cloud resources that the AI/ML image processing on Cloud Functions solution uses, see the precalculated estimate in the Google Cloud Pricing Calculator.
Use the estimate as a starting point to calculate the cost of your deployment. You can modify the estimate to reflect any configuration changes that you made to the resources that are used in the solution.
The precalculated estimate is based on assumptions for certain factors, including the following:
You can also review usage costs for resources that you have deployed. For more details, see View your billing reports and cost trends.
Get the required IAM permissionsTo delete an existing deployment, you need the Identity and Access Management (IAM) permissions that are listed in the following table. If you have the roles/owner
basic role for the project in which solution is deployed, then you already have all the necessary permissions. If you don't have the roles/owner
role, then ask your administrator to grant these permissions (or the roles that include these permissions) to you.
When you initiate the deletion process through the console, a service account is created to deploy the solution on your behalf (and to delete the deployment later if you choose). This service account is assigned certain IAM permissions temporarily; that is, the permissions are revoked automatically after the solution deployment and deletion operations are completed. Google recommends that after you delete the deployment, you delete the service account, as described later in this guide.
View the roles assigned to the service account
These roles are listed here in case an administrator of your Google Cloud project or organization needs this information.
roles/serviceusage.serviceUsageAdmin
roles/iam.serviceAccountAdmin
roles/resourcemanager.projectIamAdmin
roles/cloudfunctions.admin
roles/run.admin
roles/storage.admin
roles/pubsublite.admin
roles/iam.securityAdmin
roles/logging.admin
roles/artifactregistry.reader
roles/cloudbuild.builds.editor
roles/compute.admin
roles/iam.serviceAccountUser
When you no longer need the solution deployment, to avoid continued billing for the resources that you created, delete the deployment.
Delete through the consoleUse this procedure if you deployed the solution through the console.
In the Google Cloud console, go to the Solution deployments page.
Select the project that contains the deployment that you want to delete.
Locate the deployment that you want to delete.
In the row for the deployment, click more_vert Actions and then select Delete.
You might need to scroll to see Actions in the row.
Enter the name of the deployment and then click Confirm.
The Status field shows Deleting.
If the deletion fails, see the troubleshooting guidance in Error when deleting a deployment.
When you no longer need the Google Cloud project that you used for the solution, you can delete the project. For more information, see Optional: Delete the project.
Delete using the Terraform CLIUse this procedure if you deployed the solution by using the Terraform CLI.
In Cloud Shell, make sure that the current working directory is $HOME/cloudshell_open/terraform-ml-image-annotation-gcf/infra
. If it isn't, go to that directory.
Remove the resources that were provisioned by Terraform:
terraform destroy
Terraform displays a list of the resources that will be destroyed.
When you're prompted to perform the actions, enter yes
.
Terraform displays messages showing the progress. After all the resources are deleted, Terraform displays the following message:
Destroy complete!
If the deletion fails, see the troubleshooting guidance in Error when deleting a deployment.
When you no longer need the Google Cloud project that you used for the solution, you can delete the project. For more information, see Optional: Delete the project.
Optional: Delete the projectIf you deployed the solution in a new Google Cloud project, and if you no longer need the project, then delete it by completing the following steps:
Caution: If you delete a project, all the resources in the project are permanently deleted.If you decide to retain the project, then delete the service account that was created for this solution, as described in the next section.
Optional: Delete the service accountIf you deleted the project that you used for the solution, then skip this section.
As mentioned earlier in this guide, when you deployed the solution, a service account was created on your behalf. The service account was assigned certain IAM permissions temporarily; that is, the permissions were revoked automatically after the solution deployment and deletion operations were completed, but the service account isn't deleted. Google recommends that you delete this service account.
If you deployed the solution through the Google Cloud console, go to the Solution deployments page. (If you're already on that page, refresh the browser.) A process is triggered in the background to delete the service account. No further action is necessary.
If you deployed the solution by using the Terraform CLI, complete the following steps:
In the Google Cloud console, go to the Service accounts page.
Select the project that you used for the solution.
Select the service account that you want to delete.
The email ID of the service account that was created for the solution is in the following format:
goog-sc-DEPLOYMENT_NAME-NNN@PROJECT_ID.iam.gserviceaccount.com
The email ID contains the following values:
Click Delete.
The actions that you can take to diagnose and resolve errors depend on the deployment method and the complexity of the error.
Error when deleting a deploymentIn certain cases, attempts to delete a deployment might fail:
terraform destroy
command show the cause of the error.Review the error logs and messages, identify and delete the resources that caused the error, and then try deleting the deployment again.
If a console-based deployment doesn't get deleted and if you can't diagnose the error by using the Cloud Build log, then you can delete the deployment by using the Terraform CLI, as described in the next section.
Delete a console-based deployment by using the Terraform CLIThis section describes how to delete a console-based deployment if errors occur when you try to delete it through the console. In this approach, you download the Terraform configuration for the deployment that you want to delete and then use the Terraform CLI to delete the deployment.
Identify the region where the deployment's Terraform code, logs, and other data are stored. This region might be different from the region that you selected while deploying the solution.
In the Google Cloud console, go to the Solution deployments page.
Select the project that contains the deployment that you want to delete.
In the list of deployments, identify the row for the deployment that you want to delete.
Click expand_more View all row content.
In the Location column, note the second location, as highlighted in the following example:
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.
Create environment variables for the project ID, region, and name of the deployment that you want to delete:
export REGION="REGION"
export PROJECT_ID="PROJECT_ID"
export DEPLOYMENT_NAME="DEPLOYMENT_NAME"
In these commands, replace the following:
Get the ID of the latest revision of the deployment that you want to delete:
export REVISION_ID=$(curl \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://config.googleapis.com/v1alpha2/projects/${PROJECT_ID}/locations/${REGION}/deployments/${DEPLOYMENT_NAME}" \
| jq .latestRevision -r)
echo $REVISION_ID
The output is similar to the following:
projects/PROJECT_ID/locations/REGION/deployments/DEPLOYMENT_NAME/revisions/r-0
Get the Cloud Storage location of the Terraform configuration for the deployment:
export CONTENT_PATH=$(curl \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://config.googleapis.com/v1alpha2/${REVISION_ID}" \
| jq .applyResults.content -r)
echo $CONTENT_PATH
The following is an example of the output of this command:
gs://PROJECT_ID-REGION-blueprint-config/DEPLOYMENT_NAME/r-0/apply_results/content
Download the Terraform configuration from Cloud Storage to Cloud Shell:
gcloud storage cp $CONTENT_PATH $HOME --recursive
cd $HOME/content/infra
Wait until the Operation completed
message is displayed, as shown in the following example:
Operation completed over 45 objects/268.5 KiB
Initialize Terraform:
terraform init
Wait until you see the following message:
Terraform has been successfully initialized!
Remove the deployed resources:
terraform destroy
Terraform displays a list of the resources that will be destroyed.
If any warnings about undeclared variables are displayed, ignore the warnings.
When you're prompted to perform the actions, enter yes
.
Terraform displays messages showing the progress. After all the resources are deleted, Terraform displays the following message:
Destroy complete!
Delete the deployment artifact:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://config.googleapis.com/v1alpha2/projects/${PROJECT_ID}/locations/${REGION}/deployments/${DEPLOYMENT_NAME}?force=true&delete_policy=abandon"
Wait a few seconds and then verify that the deployment artifact was deleted:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://config.googleapis.com/v1alpha2/projects/${PROJECT_ID}/locations/${REGION}/deployments/${DEPLOYMENT_NAME}" \
| jq .error.message
If the output shows null
, wait a few seconds and then run the command again.
After the deployment artifact is deleted, a message as shown in the following example is displayed:
Resource 'projects/PROJECT_ID/locations/REGION/deployments/DEPLOYMENT_NAME' was not found
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-08-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-08-29 UTC."],[[["This solution utilizes pre-trained machine learning models via the Cloud Vision API to analyze user-provided images and generate annotations, all within a serverless architecture."],["The image processing service, deployed using Cloud Run functions, can be invoked through REST API calls or triggered by image uploads to Cloud Storage buckets."],["The deployment process is facilitated through two methods: a simplified, default configuration through the Google Cloud console, or a customizable approach using the Terraform CLI for those who need to tailor the solution."],["The solution is designed for developers familiar with backend service development, AI/ML capabilities, and cloud computing, and although it is helpful, Terraform experience is not mandatory to use the solution."],["The solution can help handle harmful user-generated content, digitize text, and detect/classify image objects, however, it is not intended for production environments and should be used to explore the capabilities of Google Cloud."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4