rabbitmq.Exchange
Explore with Pulumi AI
The rabbitmq.Exchange
resource creates and manages an exchange.
Example Usage
using System.Collections.Generic;
using Pulumi;
using RabbitMQ = Pulumi.RabbitMQ;
return await Deployment.RunAsync(() =>
{
var testVHost = new RabbitMQ.VHost("testVHost");
var guest = new RabbitMQ.Permissions("guest", new()
{
PermissionDetails = new RabbitMQ.Inputs.PermissionsPermissionsArgs
{
Configure = ".*",
Read = ".*",
Write = ".*",
},
User = "guest",
Vhost = testVHost.Name,
});
var testExchange = new RabbitMQ.Exchange("testExchange", new()
{
Settings = new RabbitMQ.Inputs.ExchangeSettingsArgs
{
AutoDelete = true,
Durable = false,
Type = "fanout",
},
Vhost = guest.Vhost,
});
});
package main
import (
"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 {
testVHost, err := rabbitmq.NewVHost(ctx, "testVHost", nil)
if err != nil {
return err
}
guest, err := rabbitmq.NewPermissions(ctx, "guest", &rabbitmq.PermissionsArgs{
Permissions: &rabbitmq.PermissionsPermissionsArgs{
Configure: pulumi.String(".*"),
Read: pulumi.String(".*"),
Write: pulumi.String(".*"),
},
User: pulumi.String("guest"),
Vhost: testVHost.Name,
})
if err != nil {
return err
}
_, err = rabbitmq.NewExchange(ctx, "testExchange", &rabbitmq.ExchangeArgs{
Settings: &rabbitmq.ExchangeSettingsArgs{
AutoDelete: pulumi.Bool(true),
Durable: pulumi.Bool(false),
Type: pulumi.String("fanout"),
},
Vhost: guest.Vhost,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rabbitmq.VHost;
import com.pulumi.rabbitmq.Permissions;
import com.pulumi.rabbitmq.PermissionsArgs;
import com.pulumi.rabbitmq.inputs.PermissionsPermissionsArgs;
import com.pulumi.rabbitmq.Exchange;
import com.pulumi.rabbitmq.ExchangeArgs;
import com.pulumi.rabbitmq.inputs.ExchangeSettingsArgs;
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 testVHost = new VHost("testVHost");
var guest = new Permissions("guest", PermissionsArgs.builder()
.permissions(PermissionsPermissionsArgs.builder()
.configure(".*")
.read(".*")
.write(".*")
.build())
.user("guest")
.vhost(testVHost.name())
.build());
var testExchange = new Exchange("testExchange", ExchangeArgs.builder()
.settings(ExchangeSettingsArgs.builder()
.autoDelete(true)
.durable(false)
.type("fanout")
.build())
.vhost(guest.vhost())
.build());
}
}
import pulumi
import pulumi_rabbitmq as rabbitmq
test_v_host = rabbitmq.VHost("testVHost")
guest = rabbitmq.Permissions("guest",
permissions=rabbitmq.PermissionsPermissionsArgs(
configure=".*",
read=".*",
write=".*",
),
user="guest",
vhost=test_v_host.name)
test_exchange = rabbitmq.Exchange("testExchange",
settings=rabbitmq.ExchangeSettingsArgs(
auto_delete=True,
durable=False,
type="fanout",
),
vhost=guest.vhost)
import * as pulumi from "@pulumi/pulumi";
import * as rabbitmq from "@pulumi/rabbitmq";
const testVHost = new rabbitmq.VHost("testVHost", {});
const guest = new rabbitmq.Permissions("guest", {
permissions: {
configure: ".*",
read: ".*",
write: ".*",
},
user: "guest",
vhost: testVHost.name,
});
const testExchange = new rabbitmq.Exchange("testExchange", {
settings: {
autoDelete: true,
durable: false,
type: "fanout",
},
vhost: guest.vhost,
});
resources:
testVHost:
type: rabbitmq:VHost
guest:
type: rabbitmq:Permissions
properties:
permissions:
configure: .*
read: .*
write: .*
user: guest
vhost: ${testVHost.name}
testExchange:
type: rabbitmq:Exchange
properties:
settings:
autoDelete: true
durable: false
type: fanout
vhost: ${guest.vhost}
Create Exchange Resource
new Exchange(name: string, args: ExchangeArgs, opts?: CustomResourceOptions);
@overload
def Exchange(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
settings: Optional[ExchangeSettingsArgs] = None,
vhost: Optional[str] = None)
@overload
def Exchange(resource_name: str,
args: ExchangeArgs,
opts: Optional[ResourceOptions] = None)
func NewExchange(ctx *Context, name string, args ExchangeArgs, opts ...ResourceOption) (*Exchange, error)
public Exchange(string name, ExchangeArgs args, CustomResourceOptions? opts = null)
public Exchange(String name, ExchangeArgs args)
public Exchange(String name, ExchangeArgs args, CustomResourceOptions options)
type: rabbitmq:Exchange
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExchangeArgs
- 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 ExchangeArgs
- 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 ExchangeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExchangeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExchangeArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Exchange 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 Exchange resource accepts the following input properties:
- Settings
Pulumi.
Rabbit MQ. Inputs. Exchange Settings The settings of the exchange. The structure is described below.
- Name string
The name of the exchange.
- Vhost string
The vhost to create the resource in.
- Settings
Exchange
Settings Args The settings of the exchange. The structure is described below.
- Name string
The name of the exchange.
- Vhost string
The vhost to create the resource in.
- settings
Exchange
Settings The settings of the exchange. The structure is described below.
- name String
The name of the exchange.
- vhost String
The vhost to create the resource in.
- settings
Exchange
Settings The settings of the exchange. The structure is described below.
- name string
The name of the exchange.
- vhost string
The vhost to create the resource in.
- settings
Exchange
Settings Args The settings of the exchange. The structure is described below.
- name str
The name of the exchange.
- vhost str
The vhost to create the resource in.
- settings Property Map
The settings of the exchange. The structure is described below.
- name String
The name of the exchange.
- vhost String
The vhost to create the resource in.
Outputs
All input properties are implicitly available as output properties. Additionally, the Exchange 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 string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing Exchange Resource
Get an existing Exchange 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?: ExchangeState, opts?: CustomResourceOptions): Exchange
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
settings: Optional[ExchangeSettingsArgs] = None,
vhost: Optional[str] = None) -> Exchange
func GetExchange(ctx *Context, name string, id IDInput, state *ExchangeState, opts ...ResourceOption) (*Exchange, error)
public static Exchange Get(string name, Input<string> id, ExchangeState? state, CustomResourceOptions? opts = null)
public static Exchange get(String name, Output<String> id, ExchangeState 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.
- Name string
The name of the exchange.
- Settings
Pulumi.
Rabbit MQ. Inputs. Exchange Settings The settings of the exchange. The structure is described below.
- Vhost string
The vhost to create the resource in.
- Name string
The name of the exchange.
- Settings
Exchange
Settings Args The settings of the exchange. The structure is described below.
- Vhost string
The vhost to create the resource in.
- name String
The name of the exchange.
- settings
Exchange
Settings The settings of the exchange. The structure is described below.
- vhost String
The vhost to create the resource in.
- name string
The name of the exchange.
- settings
Exchange
Settings The settings of the exchange. The structure is described below.
- vhost string
The vhost to create the resource in.
- name str
The name of the exchange.
- settings
Exchange
Settings Args The settings of the exchange. The structure is described below.
- vhost str
The vhost to create the resource in.
- name String
The name of the exchange.
- settings Property Map
The settings of the exchange. The structure is described below.
- vhost String
The vhost to create the resource in.
Supporting Types
ExchangeSettings, ExchangeSettingsArgs
- Type string
The type of exchange.
- Arguments Dictionary<string, object>
Additional key/value settings for the exchange.
- Auto
Delete bool Whether the exchange will self-delete when all queues have finished using it.
- Durable bool
Whether the exchange survives server restarts. Defaults to
false
.
- Type string
The type of exchange.
- Arguments map[string]interface{}
Additional key/value settings for the exchange.
- Auto
Delete bool Whether the exchange will self-delete when all queues have finished using it.
- Durable bool
Whether the exchange survives server restarts. Defaults to
false
.
- type String
The type of exchange.
- arguments Map<String,Object>
Additional key/value settings for the exchange.
- auto
Delete Boolean Whether the exchange will self-delete when all queues have finished using it.
- durable Boolean
Whether the exchange survives server restarts. Defaults to
false
.
- type string
The type of exchange.
- arguments {[key: string]: any}
Additional key/value settings for the exchange.
- auto
Delete boolean Whether the exchange will self-delete when all queues have finished using it.
- durable boolean
Whether the exchange survives server restarts. Defaults to
false
.
- type str
The type of exchange.
- arguments Mapping[str, Any]
Additional key/value settings for the exchange.
- auto_
delete bool Whether the exchange will self-delete when all queues have finished using it.
- durable bool
Whether the exchange survives server restarts. Defaults to
false
.
- type String
The type of exchange.
- arguments Map<Any>
Additional key/value settings for the exchange.
- auto
Delete Boolean Whether the exchange will self-delete when all queues have finished using it.
- durable Boolean
Whether the exchange survives server restarts. Defaults to
false
.
Import
Exchanges can be imported using the id
which is composed of
name@vhost
. E.g.
$ pulumi import rabbitmq:index/exchange:Exchange test test@vhost
Package Details
- Repository
- RabbitMQ pulumi/pulumi-rabbitmq
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
rabbitmq
Terraform Provider.