Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Shovel

The rabbitmq.Shovel resource creates and manages a shovel.

Example Usage

using Pulumi;
using RabbitMQ = Pulumi.RabbitMQ;

class MyStack : Stack
{
    public MyStack()
    {
        var testVHost = new RabbitMQ.VHost("testVHost", new RabbitMQ.VHostArgs
        {
        });
        var testExchange = new RabbitMQ.Exchange("testExchange", new RabbitMQ.ExchangeArgs
        {
            Settings = new RabbitMQ.Inputs.ExchangeSettingsArgs
            {
                AutoDelete = true,
                Durable = false,
                Type = "fanout",
            },
            Vhost = testVHost.Name,
        });
        var testQueue = new RabbitMQ.Queue("testQueue", new RabbitMQ.QueueArgs
        {
            Settings = new RabbitMQ.Inputs.QueueSettingsArgs
            {
                AutoDelete = true,
                Durable = false,
            },
            Vhost = testVHost.Name,
        });
        var shovelTest = new RabbitMQ.Shovel("shovelTest", new RabbitMQ.ShovelArgs
        {
            Info = new RabbitMQ.Inputs.ShovelInfoArgs
            {
                DestinationQueue = testQueue.Name,
                DestinationUri = "amqp:///test",
                SourceExchange = testExchange.Name,
                SourceExchangeKey = "test",
                SourceUri = "amqp:///test",
            },
            Vhost = testVHost.Name,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-rabbitmq/sdk/v2/go/rabbitmq"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        testVHost, err := rabbitmq.NewVHost(ctx, "testVHost", nil)
        if err != nil {
            return err
        }
        testExchange, err := rabbitmq.NewExchange(ctx, "testExchange", &rabbitmq.ExchangeArgs{
            Settings: &rabbitmq.ExchangeSettingsArgs{
                AutoDelete: pulumi.Bool(true),
                Durable:    pulumi.Bool(false),
                Type:       pulumi.String("fanout"),
            },
            Vhost: testVHost.Name,
        })
        if err != nil {
            return err
        }
        testQueue, err := rabbitmq.NewQueue(ctx, "testQueue", &rabbitmq.QueueArgs{
            Settings: &rabbitmq.QueueSettingsArgs{
                AutoDelete: pulumi.Bool(true),
                Durable:    pulumi.Bool(false),
            },
            Vhost: testVHost.Name,
        })
        if err != nil {
            return err
        }
        _, err = rabbitmq.NewShovel(ctx, "shovelTest", &rabbitmq.ShovelArgs{
            Info: &rabbitmq.ShovelInfoArgs{
                DestinationQueue:  testQueue.Name,
                DestinationUri:    pulumi.String("amqp:///test"),
                SourceExchange:    testExchange.Name,
                SourceExchangeKey: pulumi.String("test"),
                SourceUri:         pulumi.String("amqp:///test"),
            },
            Vhost: testVHost.Name,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_rabbitmq as rabbitmq

test_v_host = rabbitmq.VHost("testVHost")
test_exchange = rabbitmq.Exchange("testExchange",
    settings=rabbitmq.ExchangeSettingsArgs(
        auto_delete=True,
        durable=False,
        type="fanout",
    ),
    vhost=test_v_host.name)
test_queue = rabbitmq.Queue("testQueue",
    settings=rabbitmq.QueueSettingsArgs(
        auto_delete=True,
        durable=False,
    ),
    vhost=test_v_host.name)
shovel_test = rabbitmq.Shovel("shovelTest",
    info=rabbitmq.ShovelInfoArgs(
        destination_queue=test_queue.name,
        destination_uri="amqp:///test",
        source_exchange=test_exchange.name,
        source_exchange_key="test",
        source_uri="amqp:///test",
    ),
    vhost=test_v_host.name)
import * as pulumi from "@pulumi/pulumi";
import * as rabbitmq from "@pulumi/rabbitmq";

const testVHost = new rabbitmq.VHost("test", {});
const testExchange = new rabbitmq.Exchange("test", {
    settings: {
        autoDelete: true,
        durable: false,
        type: "fanout",
    },
    vhost: testVHost.name,
});
const testQueue = new rabbitmq.Queue("test", {
    settings: {
        autoDelete: true,
        durable: false,
    },
    vhost: testVHost.name,
});
const shovelTest = new rabbitmq.Shovel("shovelTest", {
    info: {
        destinationQueue: testQueue.name,
        destinationUri: "amqp:///test",
        sourceExchange: testExchange.name,
        sourceExchangeKey: "test",
        sourceUri: "amqp:///test",
    },
    vhost: testVHost.name,
});

Create a Shovel Resource

new Shovel(name: string, args: ShovelArgs, opts?: CustomResourceOptions);
def Shovel(resource_name: str, opts: Optional[ResourceOptions] = None, info: Optional[ShovelInfoArgs] = None, name: Optional[str] = None, vhost: Optional[str] = None)
func NewShovel(ctx *Context, name string, args ShovelArgs, opts ...ResourceOption) (*Shovel, error)
public Shovel(string name, ShovelArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ShovelArgs
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 ShovelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ShovelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Shovel Resource Properties

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

Inputs

The Shovel resource accepts the following input properties:

Info Pulumi.RabbitMQ.Inputs.ShovelInfoArgs

The settings of the shovel. The structure is described below.

Vhost string

The vhost to create the resource in.

Name string

The shovel name.

Info ShovelInfo

The settings of the shovel. The structure is described below.

Vhost string

The vhost to create the resource in.

Name string

The shovel name.

info ShovelInfo

The settings of the shovel. The structure is described below.

vhost string

The vhost to create the resource in.

name string

The shovel name.

info ShovelInfoArgs

The settings of the shovel. The structure is described below.

vhost str

The vhost to create the resource in.

name str

The shovel name.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Shovel Resource

Get an existing Shovel 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?: ShovelState, opts?: CustomResourceOptions): Shovel
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, info: Optional[ShovelInfoArgs] = None, name: Optional[str] = None, vhost: Optional[str] = None) -> Shovel
func GetShovel(ctx *Context, name string, id IDInput, state *ShovelState, opts ...ResourceOption) (*Shovel, error)
public static Shovel Get(string name, Input<string> id, ShovelState? 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:

Info Pulumi.RabbitMQ.Inputs.ShovelInfoArgs

The settings of the shovel. The structure is described below.

Name string

The shovel name.

Vhost string

The vhost to create the resource in.

Info ShovelInfo

The settings of the shovel. The structure is described below.

Name string

The shovel name.

Vhost string

The vhost to create the resource in.

info ShovelInfo

The settings of the shovel. The structure is described below.

name string

The shovel name.

vhost string

The vhost to create the resource in.

info ShovelInfoArgs

The settings of the shovel. The structure is described below.

name str

The shovel name.

vhost str

The vhost to create the resource in.

Supporting Types

ShovelInfo

DestinationUri string

The amqp uri for the destination .

SourceUri string

The amqp uri for the source.

AckMode string

Determines how the shovel should acknowledge messages. Defaults to on-confirm.

AddForwardHeaders bool

Whether to amqp shovel headers. Defaults to false.

DeleteAfter string

Determines when (if ever) the shovel should delete itself . Defaults to never.

DestinationExchange string

The exchange to which messages should be published. Either this or destination_queue must be specified but not both.

DestinationExchangeKey string

The routing key when using destination_exchange.

DestinationQueue string

The queue to which messages should be published. Either this or destination_exchange must be specified but not both.

PrefetchCount int

The maximum number of unacknowledged messages copied over a shovel at any one time. Defaults to 1000.

ReconnectDelay int

The duration in seconds to reconnect to a broker after disconnected. Defaults to 1.

SourceExchange string

The exchange from which to consume. Either this or source_queue must be specified but not both.

SourceExchangeKey string

The routing key when using source_exchange.

SourceQueue string

The queue from which to consume. Either this or source_exchange must be specified but not both.

DestinationUri string

The amqp uri for the destination .

SourceUri string

The amqp uri for the source.

AckMode string

Determines how the shovel should acknowledge messages. Defaults to on-confirm.

AddForwardHeaders bool

Whether to amqp shovel headers. Defaults to false.

DeleteAfter string

Determines when (if ever) the shovel should delete itself . Defaults to never.

DestinationExchange string

The exchange to which messages should be published. Either this or destination_queue must be specified but not both.

DestinationExchangeKey string

The routing key when using destination_exchange.

DestinationQueue string

The queue to which messages should be published. Either this or destination_exchange must be specified but not both.

PrefetchCount int

The maximum number of unacknowledged messages copied over a shovel at any one time. Defaults to 1000.

ReconnectDelay int

The duration in seconds to reconnect to a broker after disconnected. Defaults to 1.

SourceExchange string

The exchange from which to consume. Either this or source_queue must be specified but not both.

SourceExchangeKey string

The routing key when using source_exchange.

SourceQueue string

The queue from which to consume. Either this or source_exchange must be specified but not both.

destinationUri string

The amqp uri for the destination .

sourceUri string

The amqp uri for the source.

ackMode string

Determines how the shovel should acknowledge messages. Defaults to on-confirm.

addForwardHeaders boolean

Whether to amqp shovel headers. Defaults to false.

deleteAfter string

Determines when (if ever) the shovel should delete itself . Defaults to never.

destinationExchange string

The exchange to which messages should be published. Either this or destination_queue must be specified but not both.

destinationExchangeKey string

The routing key when using destination_exchange.

destinationQueue string

The queue to which messages should be published. Either this or destination_exchange must be specified but not both.

prefetchCount number

The maximum number of unacknowledged messages copied over a shovel at any one time. Defaults to 1000.

reconnectDelay number

The duration in seconds to reconnect to a broker after disconnected. Defaults to 1.

sourceExchange string

The exchange from which to consume. Either this or source_queue must be specified but not both.

sourceExchangeKey string

The routing key when using source_exchange.

sourceQueue string

The queue from which to consume. Either this or source_exchange must be specified but not both.

destination_uri str

The amqp uri for the destination .

source_uri str

The amqp uri for the source.

ack_mode str

Determines how the shovel should acknowledge messages. Defaults to on-confirm.

add_forward_headers bool

Whether to amqp shovel headers. Defaults to false.

delete_after str

Determines when (if ever) the shovel should delete itself . Defaults to never.

destination_exchange str

The exchange to which messages should be published. Either this or destination_queue must be specified but not both.

destination_exchange_key str

The routing key when using destination_exchange.

destination_queue str

The queue to which messages should be published. Either this or destination_exchange must be specified but not both.

prefetch_count int

The maximum number of unacknowledged messages copied over a shovel at any one time. Defaults to 1000.

reconnect_delay int

The duration in seconds to reconnect to a broker after disconnected. Defaults to 1.

source_exchange str

The exchange from which to consume. Either this or source_queue must be specified but not both.

source_exchange_key str

The routing key when using source_exchange.

source_queue str

The queue from which to consume. Either this or source_exchange must be specified but not both.

Import

Shovels can be imported using the name and vhost E.g.

 $ pulumi import rabbitmq:index/shovel:Shovel test shovelTest@test

Package Details

Repository
https://github.com/pulumi/pulumi-rabbitmq
License
Apache-2.0
Notes
This Pulumi package is based on the rabbitmq Terraform Provider.