RabbitMQ

Pulumi Official
Package maintained by Pulumi
v3.2.0 published on Thursday, Nov 11, 2021 by Pulumi

FederationUpstream

The rabbitmq.FederationUpstream resource creates and manages a federation upstream parameter.

Example Usage

using Pulumi;
using RabbitMQ = Pulumi.RabbitMQ;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new RabbitMQ.VHost("test", new RabbitMQ.VHostArgs
        {
        });
        var guest = new RabbitMQ.Permissions("guest", new RabbitMQ.PermissionsArgs
        {
            User = "guest",
            Vhost = test.Name,
            Permissions = new RabbitMQ.Inputs.PermissionsPermissionsArgs
            {
                Configure = ".*",
                Write = ".*",
                Read = ".*",
            },
        });
        // downstream exchange
        var fooExchange = new RabbitMQ.Exchange("fooExchange", new RabbitMQ.ExchangeArgs
        {
            Vhost = guest.Vhost,
            Settings = new RabbitMQ.Inputs.ExchangeSettingsArgs
            {
                Type = "topic",
                Durable = true,
            },
        });
        // upstream broker
        var fooFederationUpstream = new RabbitMQ.FederationUpstream("fooFederationUpstream", new RabbitMQ.FederationUpstreamArgs
        {
            Vhost = guest.Vhost,
            Definition = new RabbitMQ.Inputs.FederationUpstreamDefinitionArgs
            {
                Uri = "amqp://guest:guest@upstream-server-name:5672/%2f",
                PrefetchCount = 1000,
                ReconnectDelay = 5,
                AckMode = "on-confirm",
                TrustUserId = false,
                MaxHops = 1,
            },
        });
        var fooPolicy = new RabbitMQ.Policy("fooPolicy", new RabbitMQ.PolicyArgs
        {
            Vhost = guest.Vhost,
            Policy = new RabbitMQ.Inputs.PolicyPolicyArgs
            {
                Pattern = fooExchange.Name.Apply(name => $"(^{name}$)"),
                Priority = 1,
                ApplyTo = "exchanges",
                Definition = 
                {
                    { "federation-upstream", fooFederationUpstream.Name },
                },
            },
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-rabbitmq/sdk/v3/go/rabbitmq"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := rabbitmq.NewVHost(ctx, "test", nil)
		if err != nil {
			return err
		}
		guest, err := rabbitmq.NewPermissions(ctx, "guest", &rabbitmq.PermissionsArgs{
			User:  pulumi.String("guest"),
			Vhost: test.Name,
			Permissions: &PermissionsPermissionsArgs{
				Configure: pulumi.String(".*"),
				Write:     pulumi.String(".*"),
				Read:      pulumi.String(".*"),
			},
		})
		if err != nil {
			return err
		}
		fooExchange, err := rabbitmq.NewExchange(ctx, "fooExchange", &rabbitmq.ExchangeArgs{
			Vhost: guest.Vhost,
			Settings: &ExchangeSettingsArgs{
				Type:    pulumi.String("topic"),
				Durable: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		fooFederationUpstream, err := rabbitmq.NewFederationUpstream(ctx, "fooFederationUpstream", &rabbitmq.FederationUpstreamArgs{
			Vhost: guest.Vhost,
			Definition: &FederationUpstreamDefinitionArgs{
				Uri:            pulumi.String(fmt.Sprintf("%v%v%v", "amqp://guest:guest@upstream-server-name:5672/", "%", "2f")),
				PrefetchCount:  pulumi.Int(1000),
				ReconnectDelay: pulumi.Int(5),
				AckMode:        pulumi.String("on-confirm"),
				TrustUserId:    pulumi.Bool(false),
				MaxHops:        pulumi.Int(1),
			},
		})
		if err != nil {
			return err
		}
		_, err = rabbitmq.NewPolicy(ctx, "fooPolicy", &rabbitmq.PolicyArgs{
			Vhost: guest.Vhost,
			Policy: &PolicyPolicyArgs{
				Pattern: fooExchange.Name.ApplyT(func(name string) (string, error) {
					return fmt.Sprintf("%v%v%v%v", "(^", name, "$", ")"), nil
				}).(pulumi.StringOutput),
				Priority: pulumi.Int(1),
				ApplyTo:  pulumi.String("exchanges"),
				Definition: pulumi.AnyMap{
					"federation-upstream": fooFederationUpstream.Name,
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_rabbitmq as rabbitmq

test = rabbitmq.VHost("test")
guest = rabbitmq.Permissions("guest",
    user="guest",
    vhost=test.name,
    permissions=rabbitmq.PermissionsPermissionsArgs(
        configure=".*",
        write=".*",
        read=".*",
    ))
# downstream exchange
foo_exchange = rabbitmq.Exchange("fooExchange",
    vhost=guest.vhost,
    settings=rabbitmq.ExchangeSettingsArgs(
        type="topic",
        durable=True,
    ))
# upstream broker
foo_federation_upstream = rabbitmq.FederationUpstream("fooFederationUpstream",
    vhost=guest.vhost,
    definition=rabbitmq.FederationUpstreamDefinitionArgs(
        uri="amqp://guest:guest@upstream-server-name:5672/%2f",
        prefetch_count=1000,
        reconnect_delay=5,
        ack_mode="on-confirm",
        trust_user_id=False,
        max_hops=1,
    ))
foo_policy = rabbitmq.Policy("fooPolicy",
    vhost=guest.vhost,
    policy=rabbitmq.PolicyPolicyArgs(
        pattern=foo_exchange.name.apply(lambda name: f"(^{name}$)"),
        priority=1,
        apply_to="exchanges",
        definition={
            "federation-upstream": foo_federation_upstream.name,
        },
    ))
import * as pulumi from "@pulumi/pulumi";
import * as rabbitmq from "@pulumi/rabbitmq";

const test = new rabbitmq.VHost("test", {});
const guest = new rabbitmq.Permissions("guest", {
    user: "guest",
    vhost: test.name,
    permissions: {
        configure: ".*",
        write: ".*",
        read: ".*",
    },
});
// downstream exchange
const fooExchange = new rabbitmq.Exchange("fooExchange", {
    vhost: guest.vhost,
    settings: {
        type: "topic",
        durable: "true",
    },
});
// upstream broker
const fooFederationUpstream = new rabbitmq.FederationUpstream("fooFederationUpstream", {
    vhost: guest.vhost,
    definition: {
        uri: `amqp://guest:guest@upstream-server-name:5672/%2f`,
        prefetchCount: 1000,
        reconnectDelay: 5,
        ackMode: "on-confirm",
        trustUserId: false,
        maxHops: 1,
    },
});
const fooPolicy = new rabbitmq.Policy("fooPolicy", {
    vhost: guest.vhost,
    policy: {
        pattern: pulumi.interpolate`(^${fooExchange.name}$)`,
        priority: 1,
        applyTo: "exchanges",
        definition: {
            "federation-upstream": fooFederationUpstream.name,
        },
    },
});

Coming soon!

Create a FederationUpstream Resource

new FederationUpstream(name: string, args: FederationUpstreamArgs, opts?: CustomResourceOptions);
@overload
def FederationUpstream(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       definition: Optional[FederationUpstreamDefinitionArgs] = None,
                       name: Optional[str] = None,
                       vhost: Optional[str] = None)
@overload
def FederationUpstream(resource_name: str,
                       args: FederationUpstreamArgs,
                       opts: Optional[ResourceOptions] = None)
func NewFederationUpstream(ctx *Context, name string, args FederationUpstreamArgs, opts ...ResourceOption) (*FederationUpstream, error)
public FederationUpstream(string name, FederationUpstreamArgs args, CustomResourceOptions? opts = null)
public FederationUpstream(String name, FederationUpstreamArgs args)
public FederationUpstream(String name, FederationUpstreamArgs args, CustomResourceOptions options)
type: rabbitmq:FederationUpstream
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

FederationUpstream Resource Properties

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

Inputs

The FederationUpstream resource accepts the following input properties:

Definition Pulumi.RabbitMQ.Inputs.FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

Vhost string

The vhost to create the resource in.

Name string

The name of the federation upstream.

Definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

Vhost string

The vhost to create the resource in.

Name string

The name of the federation upstream.

definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

vhost String

The vhost to create the resource in.

name String

The name of the federation upstream.

definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

vhost string

The vhost to create the resource in.

name string

The name of the federation upstream.

definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

vhost str

The vhost to create the resource in.

name str

The name of the federation upstream.

definition Property Map

The configuration of the federation upstream. The structure is described below.

vhost String

The vhost to create the resource in.

name String

The name of the federation upstream.

Outputs

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

Component string

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

Id string

The provider-assigned unique ID for this managed resource.

Component string

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

Id string

The provider-assigned unique ID for this managed resource.

component String

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

id String

The provider-assigned unique ID for this managed resource.

component string

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

id string

The provider-assigned unique ID for this managed resource.

component str

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

id str

The provider-assigned unique ID for this managed resource.

component String

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing FederationUpstream Resource

Get an existing FederationUpstream 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?: FederationUpstreamState, opts?: CustomResourceOptions): FederationUpstream
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        component: Optional[str] = None,
        definition: Optional[FederationUpstreamDefinitionArgs] = None,
        name: Optional[str] = None,
        vhost: Optional[str] = None) -> FederationUpstream
func GetFederationUpstream(ctx *Context, name string, id IDInput, state *FederationUpstreamState, opts ...ResourceOption) (*FederationUpstream, error)
public static FederationUpstream Get(string name, Input<string> id, FederationUpstreamState? state, CustomResourceOptions? opts = null)
public static FederationUpstream get(String name, Output<String> id, FederationUpstreamState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
Component string

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

Definition Pulumi.RabbitMQ.Inputs.FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

Name string

The name of the federation upstream.

Vhost string

The vhost to create the resource in.

Component string

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

Definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

Name string

The name of the federation upstream.

Vhost string

The vhost to create the resource in.

component String

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

name String

The name of the federation upstream.

vhost String

The vhost to create the resource in.

component string

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

name string

The name of the federation upstream.

vhost string

The vhost to create the resource in.

component str

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

definition FederationUpstreamDefinitionArgs

The configuration of the federation upstream. The structure is described below.

name str

The name of the federation upstream.

vhost str

The vhost to create the resource in.

component String

Set to federation-upstream by the underlying RabbitMQ provider. You do not set this attribute but will see it in state and plan output.

definition Property Map

The configuration of the federation upstream. The structure is described below.

name String

The name of the federation upstream.

vhost String

The vhost to create the resource in.

Supporting Types

FederationUpstreamDefinition

Uri string

The AMQP URI(s) for the upstream. Note that the URI may contain sensitive information, such as a password.

AckMode string

Determines how the link should acknowledge messages. Valid values are on-confirm, on-publish, and no-ack. Default is on-confirm.

Exchange string

The name of the upstream exchange.

Expires int

The expiry time (in milliseconds) after which an upstream queue for a federated exchange may be deleted if a connection to the upstream is lost.

MaxHops int

Maximum number of federation links that messages can traverse before being dropped. Default is 1.

MessageTtl int

The expiry time (in milliseconds) for messages in the upstream queue for a federated exchange (see expires).

PrefetchCount int

Maximum number of unacknowledged messages that may be in flight over a federation link at one time. Default is 1000.

Queue string

The name of the upstream queue.

ReconnectDelay int

Time in seconds to wait after a network link goes down before attempting reconnection. Default is 5.

TrustUserId bool

Determines how federation should interact with the validated user-id feature. Default is false.

Uri string

The AMQP URI(s) for the upstream. Note that the URI may contain sensitive information, such as a password.

AckMode string

Determines how the link should acknowledge messages. Valid values are on-confirm, on-publish, and no-ack. Default is on-confirm.

Exchange string

The name of the upstream exchange.

Expires int

The expiry time (in milliseconds) after which an upstream queue for a federated exchange may be deleted if a connection to the upstream is lost.

MaxHops int

Maximum number of federation links that messages can traverse before being dropped. Default is 1.

MessageTtl int

The expiry time (in milliseconds) for messages in the upstream queue for a federated exchange (see expires).

PrefetchCount int

Maximum number of unacknowledged messages that may be in flight over a federation link at one time. Default is 1000.

Queue string

The name of the upstream queue.

ReconnectDelay int

Time in seconds to wait after a network link goes down before attempting reconnection. Default is 5.

TrustUserId bool

Determines how federation should interact with the validated user-id feature. Default is false.

uri String

The AMQP URI(s) for the upstream. Note that the URI may contain sensitive information, such as a password.

ackMode String

Determines how the link should acknowledge messages. Valid values are on-confirm, on-publish, and no-ack. Default is on-confirm.

exchange String

The name of the upstream exchange.

expires Integer

The expiry time (in milliseconds) after which an upstream queue for a federated exchange may be deleted if a connection to the upstream is lost.

maxHops Integer

Maximum number of federation links that messages can traverse before being dropped. Default is 1.

messageTtl Integer

The expiry time (in milliseconds) for messages in the upstream queue for a federated exchange (see expires).

prefetchCount Integer

Maximum number of unacknowledged messages that may be in flight over a federation link at one time. Default is 1000.

queue String

The name of the upstream queue.

reconnectDelay Integer

Time in seconds to wait after a network link goes down before attempting reconnection. Default is 5.

trustUserId Boolean

Determines how federation should interact with the validated user-id feature. Default is false.

uri string

The AMQP URI(s) for the upstream. Note that the URI may contain sensitive information, such as a password.

ackMode string

Determines how the link should acknowledge messages. Valid values are on-confirm, on-publish, and no-ack. Default is on-confirm.

exchange string

The name of the upstream exchange.

expires number

The expiry time (in milliseconds) after which an upstream queue for a federated exchange may be deleted if a connection to the upstream is lost.

maxHops number

Maximum number of federation links that messages can traverse before being dropped. Default is 1.

messageTtl number

The expiry time (in milliseconds) for messages in the upstream queue for a federated exchange (see expires).

prefetchCount number

Maximum number of unacknowledged messages that may be in flight over a federation link at one time. Default is 1000.

queue string

The name of the upstream queue.

reconnectDelay number

Time in seconds to wait after a network link goes down before attempting reconnection. Default is 5.

trustUserId boolean

Determines how federation should interact with the validated user-id feature. Default is false.

uri str

The AMQP URI(s) for the upstream. Note that the URI may contain sensitive information, such as a password.

ack_mode str

Determines how the link should acknowledge messages. Valid values are on-confirm, on-publish, and no-ack. Default is on-confirm.

exchange str

The name of the upstream exchange.

expires int

The expiry time (in milliseconds) after which an upstream queue for a federated exchange may be deleted if a connection to the upstream is lost.

max_hops int

Maximum number of federation links that messages can traverse before being dropped. Default is 1.

message_ttl int

The expiry time (in milliseconds) for messages in the upstream queue for a federated exchange (see expires).

prefetch_count int

Maximum number of unacknowledged messages that may be in flight over a federation link at one time. Default is 1000.

queue str

The name of the upstream queue.

reconnect_delay int

Time in seconds to wait after a network link goes down before attempting reconnection. Default is 5.

trust_user_id bool

Determines how federation should interact with the validated user-id feature. Default is false.

uri String

The AMQP URI(s) for the upstream. Note that the URI may contain sensitive information, such as a password.

ackMode String

Determines how the link should acknowledge messages. Valid values are on-confirm, on-publish, and no-ack. Default is on-confirm.

exchange String

The name of the upstream exchange.

expires Number

The expiry time (in milliseconds) after which an upstream queue for a federated exchange may be deleted if a connection to the upstream is lost.

maxHops Number

Maximum number of federation links that messages can traverse before being dropped. Default is 1.

messageTtl Number

The expiry time (in milliseconds) for messages in the upstream queue for a federated exchange (see expires).

prefetchCount Number

Maximum number of unacknowledged messages that may be in flight over a federation link at one time. Default is 1000.

queue String

The name of the upstream queue.

reconnectDelay Number

Time in seconds to wait after a network link goes down before attempting reconnection. Default is 5.

trustUserId Boolean

Determines how federation should interact with the validated user-id feature. Default is false.

Import

A Federation upstream can be imported using the resource id which is composed of name@vhost, e.g.

 $ pulumi import rabbitmq:index/federationUpstream:FederationUpstream foo foo@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.