google_cloud_tasks_queue

A named resource to which messages are sent by publishers.

Open in Cloud Shell

Example Usage - Queue Basic

resource "google_cloud_tasks_queue" "default" {
  name = "cloud-tasks-queue-test"
  location = "us-central1"
}
Open in Cloud Shell

Example Usage - Cloud Tasks Queue Advanced

resource "google_cloud_tasks_queue" "advanced_configuration" {
  name = "instance-name"
  location = "us-central1"

  app_engine_routing_override {
    service = "worker"
    version = "1.0"
    instance = "test"
  }

  rate_limits {
    max_concurrent_dispatches = 3
    max_dispatches_per_second = 2
  }

  retry_config {
    max_attempts = 5
    max_retry_duration = "4s"
    max_backoff = "3s"
    min_backoff = "2s"
    max_doublings = 1
  }

  stackdriver_logging_config {
    sampling_ratio = 0.9
  }
}

Argument Reference

The following arguments are supported:


The app_engine_routing_override block supports:

The rate_limits block supports:

The retry_config block supports:

The stackdriver_logging_config block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Queue can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Queue using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/queues/{{name}}"
  to = google_cloud_tasks_queue.default
}

When using the terraform import command, Queue can be imported using one of the formats above. For example:

$ terraform import google_cloud_tasks_queue.default projects/{{project}}/locations/{{location}}/queues/{{name}}
$ terraform import google_cloud_tasks_queue.default {{project}}/{{location}}/{{name}}
$ terraform import google_cloud_tasks_queue.default {{location}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.