This set of two templates creates a Cloud Task and a Cloud Task Queue.
-
Install gcloud
-
Install gcloud beta components:
gcloud components update gcloud components install beta
-
Enable the Cloud Tasks API from the Google Cloud console
-
Grant the appengine.applications.get IAM permission to the Deployment Manager service account
-
NOTE: Cloud Tasks requires an App Engine application. To run the integration tests please ensure that an App Engine application exists. An App Engine app can be created using the App Engine Template or by running the App Engine Template integration tests
- projects.locations.queues
- projects.locations.queues.tasks
- Task Queues
- CloudTasks v2beta3 Descriptor URL
See the properties
section in the schema file(s):
-
Clone the Deployment Manager samples repository
git clone https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit
-
Go to the dm directory
cd dm
-
Create a custom type-provider named
cloudtasks
cp templates/cloud_tasks/examples/create_typeprovider.sh . chmod u+x create_typeprovider.sh ./create_typeprovider.sh
-
Copy the example DM config to be used as a model for the deployment. In this case, examples/cloud_tasks_queue.yaml
cp templates/cloud_tasks/examples/cloud_tasks_queue.yaml my_cloud_tasks_queue.yaml
-
Change the values in the config file to match your specific GCP setup. Refer to the properties in the schema files described above.
vim my_cloud_tasks_queue.yaml
-
Create your deployment as described below, replacing
<YOUR_DEPLOYMENT_NAME>
with your with your own deployment namegcloud beta deployment-manager deployments create <YOUR_DEPLOYMENT_NAME> \ --config my_cloud_tasks_queue.yaml
-
In case you need to delete your deployment
gcloud deployment-manager deployments delete <YOUR_DEPLOYMENT_NAME>
-
To delete the custom
cloudtasks
type-providercp templates/cloud_tasks/examples/delete_typeprovider.sh . chmod u+x delete_typeprovider.sh ./delete_typeprovider.sh