» google_cloud_tasks_queue

A named resource to which messages are sent by publishers.

» Example Usage - Queue Basic

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

» Argument Reference

The following arguments are supported:

  • location - (Required) The location of the queue

  • name - (Optional) The queue name.

  • app_engine_routing_override - (Optional) Overrides for task-level appEngineRouting. These settings apply only to App Engine tasks in this queue Structure is documented below.

  • rate_limits - (Optional) Rate limits for task dispatches. The queue's actual dispatch rate is the result of:

    • Number of tasks in the queue
    • User-specified throttling: rateLimits, retryConfig, and the queue's state.
    • System throttling due to 429 (Too Many Requests) or 503 (Service Unavailable) responses from the worker, high error rates, or to smooth sudden large traffic spikes. Structure is documented below.
  • retry_config - (Optional) Settings that determine the retry behavior. Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The app_engine_routing_override block supports:

  • service - (Optional) App service. By default, the task is sent to the service which is the default service when the task is attempted.

  • version - (Optional) App version. By default, the task is sent to the version which is the default version when the task is attempted.

  • instance - (Optional) App instance. By default, the task is sent to an instance which is available when the task is attempted.

  • host - The host that the task is sent to.

The rate_limits block supports:

  • max_dispatches_per_second - (Optional) The maximum rate at which tasks are dispatched from this queue. If unspecified when the queue is created, Cloud Tasks will pick the default.

  • max_concurrent_dispatches - (Optional) The maximum number of concurrent tasks that Cloud Tasks allows to be dispatched for this queue. After this threshold has been reached, Cloud Tasks stops dispatching tasks until the number of concurrent requests decreases.

  • max_burst_size - The max burst size. Max burst size limits how fast tasks in queue are processed when many tasks are in the queue and the rate is high. This field allows the queue to have a high rate so processing starts shortly after a task is enqueued, but still limits resource usage when many tasks are enqueued in a short period of time.

The retry_config block supports:

  • max_attempts - (Optional) Number of attempts per task. Cloud Tasks will attempt the task maxAttempts times (that is, if the first attempt fails, then there will be maxAttempts - 1 retries). Must be >= -1. If unspecified when the queue is created, Cloud Tasks will pick the default. -1 indicates unlimited attempts.

  • max_retry_duration - (Optional) If positive, maxRetryDuration specifies the time limit for retrying a failed task, measured from when the task was first attempted. Once maxRetryDuration time has passed and the task has been attempted maxAttempts times, no further attempts will be made and the task will be deleted. If zero, then the task age is unlimited.

  • min_backoff - (Optional) A task will be scheduled for retry between minBackoff and maxBackoff duration after it fails, if the queue's RetryConfig specifies that the task should be retried.

  • max_backoff - (Optional) A task will be scheduled for retry between minBackoff and maxBackoff duration after it fails, if the queue's RetryConfig specifies that the task should be retried.

  • max_doublings - (Optional) The time between retries will double maxDoublings times. A task's retry interval starts at minBackoff, then doubles maxDoublings times, then increases linearly, and finally retries retries at intervals of maxBackoff up to maxAttempts times.

» Attributes Reference

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

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/queues/{{name}}

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • update - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

Queue can be imported using any of these accepted formats:

$ 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.