1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. Queue
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.Queue

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleQueue = new cloudflare.Queue("example_queue", {
    accountId: "023e105f4ecef8ad9ca31a8372d0c353",
    queueName: "example-queue",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_queue = cloudflare.Queue("example_queue",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    queue_name="example-queue")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewQueue(ctx, "example_queue", &cloudflare.QueueArgs{
			AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
			QueueName: pulumi.String("example-queue"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleQueue = new Cloudflare.Queue("example_queue", new()
    {
        AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
        QueueName = "example-queue",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Queue;
import com.pulumi.cloudflare.QueueArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleQueue = new Queue("exampleQueue", QueueArgs.builder()
            .accountId("023e105f4ecef8ad9ca31a8372d0c353")
            .queueName("example-queue")
            .build());

    }
}
Copy
resources:
  exampleQueue:
    type: cloudflare:Queue
    name: example_queue
    properties:
      accountId: 023e105f4ecef8ad9ca31a8372d0c353
      queueName: example-queue
Copy

Create Queue Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Queue(name: string, args: QueueArgs, opts?: CustomResourceOptions);
@overload
def Queue(resource_name: str,
          args: QueueArgs,
          opts: Optional[ResourceOptions] = None)

@overload
def Queue(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          account_id: Optional[str] = None,
          queue_name: Optional[str] = None,
          settings: Optional[QueueSettingsArgs] = None)
func NewQueue(ctx *Context, name string, args QueueArgs, opts ...ResourceOption) (*Queue, error)
public Queue(string name, QueueArgs args, CustomResourceOptions? opts = null)
public Queue(String name, QueueArgs args)
public Queue(String name, QueueArgs args, CustomResourceOptions options)
type: cloudflare:Queue
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. QueueArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. QueueArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. QueueArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. QueueArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. QueueArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var queueResource = new Cloudflare.Queue("queueResource", new()
{
    AccountId = "string",
    QueueName = "string",
    Settings = new Cloudflare.Inputs.QueueSettingsArgs
    {
        DeliveryDelay = 0,
        MessageRetentionPeriod = 0,
    },
});
Copy
example, err := cloudflare.NewQueue(ctx, "queueResource", &cloudflare.QueueArgs{
	AccountId: pulumi.String("string"),
	QueueName: pulumi.String("string"),
	Settings: &cloudflare.QueueSettingsArgs{
		DeliveryDelay:          pulumi.Float64(0),
		MessageRetentionPeriod: pulumi.Float64(0),
	},
})
Copy
var queueResource = new Queue("queueResource", QueueArgs.builder()
    .accountId("string")
    .queueName("string")
    .settings(QueueSettingsArgs.builder()
        .deliveryDelay(0)
        .messageRetentionPeriod(0)
        .build())
    .build());
Copy
queue_resource = cloudflare.Queue("queueResource",
    account_id="string",
    queue_name="string",
    settings={
        "delivery_delay": 0,
        "message_retention_period": 0,
    })
Copy
const queueResource = new cloudflare.Queue("queueResource", {
    accountId: "string",
    queueName: "string",
    settings: {
        deliveryDelay: 0,
        messageRetentionPeriod: 0,
    },
});
Copy
type: cloudflare:Queue
properties:
    accountId: string
    queueName: string
    settings:
        deliveryDelay: 0
        messageRetentionPeriod: 0
Copy

Queue Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Queue resource accepts the following input properties:

AccountId This property is required. string
A Resource identifier.
QueueName This property is required. string
Settings QueueSettings
AccountId This property is required. string
A Resource identifier.
QueueName This property is required. string
Settings QueueSettingsArgs
accountId This property is required. String
A Resource identifier.
queueName This property is required. String
settings QueueSettings
accountId This property is required. string
A Resource identifier.
queueName This property is required. string
settings QueueSettings
account_id This property is required. str
A Resource identifier.
queue_name This property is required. str
settings QueueSettingsArgs
accountId This property is required. String
A Resource identifier.
queueName This property is required. String
settings Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the Queue resource produces the following output properties:

Consumers List<QueueConsumer>
ConsumersTotalCount double
CreatedOn string
Id string
The provider-assigned unique ID for this managed resource.
ModifiedOn string
Producers List<QueueProducer>
ProducersTotalCount double
QueueId string
Consumers []QueueConsumerType
ConsumersTotalCount float64
CreatedOn string
Id string
The provider-assigned unique ID for this managed resource.
ModifiedOn string
Producers []QueueProducer
ProducersTotalCount float64
QueueId string
consumers List<QueueConsumer>
consumersTotalCount Double
createdOn String
id String
The provider-assigned unique ID for this managed resource.
modifiedOn String
producers List<QueueProducer>
producersTotalCount Double
queueId String
consumers QueueConsumer[]
consumersTotalCount number
createdOn string
id string
The provider-assigned unique ID for this managed resource.
modifiedOn string
producers QueueProducer[]
producersTotalCount number
queueId string
consumers List<Property Map>
consumersTotalCount Number
createdOn String
id String
The provider-assigned unique ID for this managed resource.
modifiedOn String
producers List<Property Map>
producersTotalCount Number
queueId String

Look up Existing Queue Resource

Get an existing Queue resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: QueueState, opts?: CustomResourceOptions): Queue
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        consumers: Optional[Sequence[QueueConsumerArgs]] = None,
        consumers_total_count: Optional[float] = None,
        created_on: Optional[str] = None,
        modified_on: Optional[str] = None,
        producers: Optional[Sequence[QueueProducerArgs]] = None,
        producers_total_count: Optional[float] = None,
        queue_id: Optional[str] = None,
        queue_name: Optional[str] = None,
        settings: Optional[QueueSettingsArgs] = None) -> Queue
func GetQueue(ctx *Context, name string, id IDInput, state *QueueState, opts ...ResourceOption) (*Queue, error)
public static Queue Get(string name, Input<string> id, QueueState? state, CustomResourceOptions? opts = null)
public static Queue get(String name, Output<String> id, QueueState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:Queue    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

Supporting Types

QueueConsumer
, QueueConsumerArgs

ConsumerId string
A Resource identifier.
CreatedOn string
QueueId string
A Resource identifier.
Script string
Name of a Worker
ScriptName string
Name of a Worker
Settings QueueConsumerSettings
Type string
Available values: "worker".
ConsumerId string
A Resource identifier.
CreatedOn string
QueueId string
A Resource identifier.
Script string
Name of a Worker
ScriptName string
Name of a Worker
Settings QueueConsumerSettings
Type string
Available values: "worker".
consumerId String
A Resource identifier.
createdOn String
queueId String
A Resource identifier.
script String
Name of a Worker
scriptName String
Name of a Worker
settings QueueConsumerSettings
type String
Available values: "worker".
consumerId string
A Resource identifier.
createdOn string
queueId string
A Resource identifier.
script string
Name of a Worker
scriptName string
Name of a Worker
settings QueueConsumerSettings
type string
Available values: "worker".
consumer_id str
A Resource identifier.
created_on str
queue_id str
A Resource identifier.
script str
Name of a Worker
script_name str
Name of a Worker
settings QueueConsumerSettings
type str
Available values: "worker".
consumerId String
A Resource identifier.
createdOn String
queueId String
A Resource identifier.
script String
Name of a Worker
scriptName String
Name of a Worker
settings Property Map
type String
Available values: "worker".

QueueConsumerSettings
, QueueConsumerSettingsArgs

BatchSize double
The maximum number of messages to include in a batch.
MaxConcurrency double
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).
MaxRetries double
The maximum number of retries
MaxWaitTimeMs double
The number of milliseconds to wait for a batch to fill up before attempting to deliver it
RetryDelay double
The number of seconds to delay before making the message available for another attempt.
VisibilityTimeoutMs double
The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.
BatchSize float64
The maximum number of messages to include in a batch.
MaxConcurrency float64
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).
MaxRetries float64
The maximum number of retries
MaxWaitTimeMs float64
The number of milliseconds to wait for a batch to fill up before attempting to deliver it
RetryDelay float64
The number of seconds to delay before making the message available for another attempt.
VisibilityTimeoutMs float64
The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.
batchSize Double
The maximum number of messages to include in a batch.
maxConcurrency Double
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).
maxRetries Double
The maximum number of retries
maxWaitTimeMs Double
The number of milliseconds to wait for a batch to fill up before attempting to deliver it
retryDelay Double
The number of seconds to delay before making the message available for another attempt.
visibilityTimeoutMs Double
The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.
batchSize number
The maximum number of messages to include in a batch.
maxConcurrency number
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).
maxRetries number
The maximum number of retries
maxWaitTimeMs number
The number of milliseconds to wait for a batch to fill up before attempting to deliver it
retryDelay number
The number of seconds to delay before making the message available for another attempt.
visibilityTimeoutMs number
The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.
batch_size float
The maximum number of messages to include in a batch.
max_concurrency float
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).
max_retries float
The maximum number of retries
max_wait_time_ms float
The number of milliseconds to wait for a batch to fill up before attempting to deliver it
retry_delay float
The number of seconds to delay before making the message available for another attempt.
visibility_timeout_ms float
The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.
batchSize Number
The maximum number of messages to include in a batch.
maxConcurrency Number
Maximum number of concurrent consumers that may consume from this Queue. Set to null to automatically opt in to the platform's maximum (recommended).
maxRetries Number
The maximum number of retries
maxWaitTimeMs Number
The number of milliseconds to wait for a batch to fill up before attempting to deliver it
retryDelay Number
The number of seconds to delay before making the message available for another attempt.
visibilityTimeoutMs Number
The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.

QueueProducer
, QueueProducerArgs

BucketName string
Script string
Type string
Available values: "worker".
BucketName string
Script string
Type string
Available values: "worker".
bucketName String
script String
type String
Available values: "worker".
bucketName string
script string
type string
Available values: "worker".
bucket_name str
script str
type str
Available values: "worker".
bucketName String
script String
type String
Available values: "worker".

QueueSettings
, QueueSettingsArgs

DeliveryDelay double
Number of seconds to delay delivery of all messages to consumers.
MessageRetentionPeriod double
Number of seconds after which an unconsumed message will be delayed.
DeliveryDelay float64
Number of seconds to delay delivery of all messages to consumers.
MessageRetentionPeriod float64
Number of seconds after which an unconsumed message will be delayed.
deliveryDelay Double
Number of seconds to delay delivery of all messages to consumers.
messageRetentionPeriod Double
Number of seconds after which an unconsumed message will be delayed.
deliveryDelay number
Number of seconds to delay delivery of all messages to consumers.
messageRetentionPeriod number
Number of seconds after which an unconsumed message will be delayed.
delivery_delay float
Number of seconds to delay delivery of all messages to consumers.
message_retention_period float
Number of seconds after which an unconsumed message will be delayed.
deliveryDelay Number
Number of seconds to delay delivery of all messages to consumers.
messageRetentionPeriod Number
Number of seconds after which an unconsumed message will be delayed.

Import

$ pulumi import cloudflare:index/queue:Queue example '<account_id>/<queue_id>'
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.