Queue
The rabbitmq..Queue resource creates and manages a queue.
Example Usage
Basic Example
using Pulumi;
using RabbitMQ = Pulumi.RabbitMQ;
class MyStack : Stack
{
public MyStack()
{
var testVHost = new RabbitMQ.VHost("testVHost", new RabbitMQ.VHostArgs
{
});
var guest = new RabbitMQ.Permissions("guest", new RabbitMQ.PermissionsArgs
{
Permissions = new RabbitMQ.Inputs.PermissionsPermissionsArgs
{
Configure = ".*",
Read = ".*",
Write = ".*",
},
User = "guest",
Vhost = testVHost.Name,
});
var testQueue = new RabbitMQ.Queue("testQueue", new RabbitMQ.QueueArgs
{
Settings = new RabbitMQ.Inputs.QueueSettingsArgs
{
AutoDelete = true,
Durable = false,
},
Vhost = guest.Vhost,
});
}
}
Coming soon!
import pulumi
import pulumi_rabbitmq as rabbitmq
test_v_host = rabbitmq.VHost("testVHost")
guest = rabbitmq.Permissions("guest",
permissions={
"configure": ".*",
"read": ".*",
"write": ".*",
},
user="guest",
vhost=test_v_host.name)
test_queue = rabbitmq.Queue("testQueue",
settings={
"autoDelete": True,
"durable": False,
},
vhost=guest.vhost)import * as pulumi from "@pulumi/pulumi";
import * as rabbitmq from "@pulumi/rabbitmq";
const testVHost = new rabbitmq.VHost("test", {});
const guest = new rabbitmq.Permissions("guest", {
permissions: {
configure: ".*",
read: ".*",
write: ".*",
},
user: "guest",
vhost: testVHost.name,
});
const testQueue = new rabbitmq.Queue("test", {
settings: {
autoDelete: true,
durable: false,
},
vhost: guest.vhost,
});Example With JSON Arguments
using Pulumi;
using RabbitMQ = Pulumi.RabbitMQ;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var arguments = config.Get("arguments") ?? @"{
""x-message-ttl"": 5000
}
";
var testVHost = new RabbitMQ.VHost("testVHost", new RabbitMQ.VHostArgs
{
});
var guest = new RabbitMQ.Permissions("guest", new RabbitMQ.PermissionsArgs
{
Permissions = new RabbitMQ.Inputs.PermissionsPermissionsArgs
{
Configure = ".*",
Read = ".*",
Write = ".*",
},
User = "guest",
Vhost = testVHost.Name,
});
var testQueue = new RabbitMQ.Queue("testQueue", new RabbitMQ.QueueArgs
{
Settings = new RabbitMQ.Inputs.QueueSettingsArgs
{
ArgumentsJson = arguments,
AutoDelete = true,
Durable = false,
},
Vhost = guest.Vhost,
});
}
}
Coming soon!
import pulumi
import pulumi_rabbitmq as rabbitmq
config = pulumi.Config()
arguments = config.get("arguments")
if arguments is None:
arguments = """{
"x-message-ttl": 5000
}
"""
test_v_host = rabbitmq.VHost("testVHost")
guest = rabbitmq.Permissions("guest",
permissions={
"configure": ".*",
"read": ".*",
"write": ".*",
},
user="guest",
vhost=test_v_host.name)
test_queue = rabbitmq.Queue("testQueue",
settings={
"argumentsJson": arguments,
"autoDelete": True,
"durable": False,
},
vhost=guest.vhost)import * as pulumi from "@pulumi/pulumi";
import * as rabbitmq from "@pulumi/rabbitmq";
const config = new pulumi.Config();
const arguments = config.get("arguments") || `{
"x-message-ttl": 5000
}
`;
const testVHost = new rabbitmq.VHost("test", {});
const guest = new rabbitmq.Permissions("guest", {
permissions: {
configure: ".*",
read: ".*",
write: ".*",
},
user: "guest",
vhost: testVHost.name,
});
const testQueue = new rabbitmq.Queue("test", {
settings: {
argumentsJson: arguments,
autoDelete: true,
durable: false,
},
vhost: guest.vhost,
});Create a Queue Resource
new Queue(name: string, args: QueueArgs, opts?: CustomResourceOptions);def Queue(resource_name, opts=None, name=None, settings=None, vhost=None, __props__=None);public Queue(string name, QueueArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Queue Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Queue resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the Queue resource produces the following output properties:
Look up an 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): Queuestatic get(resource_name, id, opts=None, name=None, settings=None, vhost=None, __props__=None);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)- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
The following state arguments are supported:
Supporting Types
QueueSettings
- Arguments Dictionary<string, object>
Additional key/value settings for the queue. All values will be sent to RabbitMQ as a string. If you require non-string values, use
arguments_json.- Arguments
Json string A nested JSON string which contains additional settings for the queue. This is useful for when the arguments contain non-string values.
- Auto
Delete bool Whether the queue will self-delete when all consumers have unsubscribed.
- Durable bool
Whether the queue survives server restarts. Defaults to
false.
- Arguments map[string]interface{}
Additional key/value settings for the queue. All values will be sent to RabbitMQ as a string. If you require non-string values, use
arguments_json.- Arguments
Json string A nested JSON string which contains additional settings for the queue. This is useful for when the arguments contain non-string values.
- Auto
Delete bool Whether the queue will self-delete when all consumers have unsubscribed.
- Durable bool
Whether the queue survives server restarts. Defaults to
false.
- arguments {[key: string]: any}
Additional key/value settings for the queue. All values will be sent to RabbitMQ as a string. If you require non-string values, use
arguments_json.- arguments
Json string A nested JSON string which contains additional settings for the queue. This is useful for when the arguments contain non-string values.
- auto
Delete boolean Whether the queue will self-delete when all consumers have unsubscribed.
- durable boolean
Whether the queue survives server restarts. Defaults to
false.
- arguments Dict[str, Any]
Additional key/value settings for the queue. All values will be sent to RabbitMQ as a string. If you require non-string values, use
arguments_json.- arguments
Json str A nested JSON string which contains additional settings for the queue. This is useful for when the arguments contain non-string values.
- auto
Delete bool Whether the queue will self-delete when all consumers have unsubscribed.
- durable bool
Whether the queue survives server restarts. Defaults to
false.
Package Details
- Repository
- https://github.com/pulumi/pulumi-rabbitmq
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
rabbitmqTerraform Provider.