# Deploy and Handle GCP CloudTasks with Goblet in minutes.

DevFeed: [Deploy and Handle GCP CloudTasks with Goblet in minutes.](<https://devfeed.tech/articles/deploy-and-handle-gcp-cloudtasks-with-goblet-in-minutes-23875.md>)

Original publisher: [Read original article](<https://engineering.premise.com/deploy-and-handle-gcp-cloudtasks-with-goblet-in-minutes-ee138e9dd2c5?source=rss----c5fada0a103d---4>)

Author: Mauricio Wittenberg

Published: 2023-04-18T13:55:58Z

Content type: tutorial

Language: en

Sources: [Engineering at Premise - Medium](<https://devfeed.tech/sources/engineering-at-premise-medium.md>)

Topics: [Google Cloud Platform (GCP)](<https://devfeed.tech/topics/google-cloud.md>), [Python](<https://devfeed.tech/topics/python.md>), [Microservices](<https://devfeed.tech/topics/microservices.md>), [Serverless](<https://devfeed.tech/topics/serverless.md>), [IAM](<https://devfeed.tech/topics/iam.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [Docker Image](<https://devfeed.tech/topics/docker-image.md>)

Tags: [cloud-computing](<https://devfeed.tech/tags/cloud-computing.md>), [cloud-tasks](<https://devfeed.tech/tags/cloud-tasks.md>), [cloudrun](<https://devfeed.tech/tags/cloudrun.md>), [container-registry](<https://devfeed.tech/tags/container-registry.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-image](<https://devfeed.tech/tags/docker-image.md>), [gcp](<https://devfeed.tech/tags/gcp.md>), [goblet](<https://devfeed.tech/tags/goblet.md>), [google-cloud](<https://devfeed.tech/tags/google-cloud.md>), [google-cloud-platform](<https://devfeed.tech/tags/google-cloud-platform.md>), [iam](<https://devfeed.tech/tags/iam.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [permissions](<https://devfeed.tech/tags/permissions.md>), [python](<https://devfeed.tech/tags/python.md>), [rate-limiting](<https://devfeed.tech/tags/rate-limiting.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

This tutorial explains how Goblet can deploy and manage Google Cloud Tasks for serverless microservices on Google Cloud Platform. It covers defining a queue, enqueuing and handling tasks in Python, configuring IAM permissions, and deploying related infrastructure, Docker images, and Cloud Run revisions.

## Source excerpt

by Mauricio Wittenberg. Goblet DeployIntroduction CloudTasks is a Google Cloud Platform (GCP) service that allows users to enqueue tasks in a queue. It is somewhat similar to PubSub, but with CloudTasks, the queue has features such as rateLimits and retryConfig. This can be very useful when having to enforce a rate limit over an external API or retrying tasks that have a known probability of failure. If you want to use CloudTasks you will have to manually deploy cloud infrastructure, understand the CloudTask object, deal with client libraries and figure out multiple IAM role bindings. Or you can use Goblet for all the heavy lifting and in just a few minutes be able push a task and later process the task in a Python function of our choosing. Goblet is a Python based cloud framework for building serverless microservices on Google Cloud Platform. It enables developers to quickly and reliably deploy cloud resources together with the code that will make use of those resources. In this blog post we will review how Goblet deploys CloudTaskQueues and provides the user with an simple code interface to enqueue and handle CloudTasks⁶. Using the short snipped of code below we can define a queue, create a client, push a task to the queue, and handle tasks from the queue! https://medium.com/media/d81fb2d8bd47a3f69479708d61dd5230/href See the rest of the tutorial for setting up your Goblet environment, setting permissions, and deploying you infrastructure and application in a few quick steps. Infrastructure For this tutorial we will use an example GCP project called goblet-cloudtask and deploy region specific resources to us-central1. If you would like to follow along the complete code can be found at gcp-tutorials. The account used to run this example must have enough IAM role binding to run all the gcloud commands described in the Set-Up section below. Now, let's take a look at the infrastructure Goblet will create. We won't have to take care of any of these steps ourselves. All