1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. amqp
  5. VirtualHost
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.amqp.VirtualHost

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a RabbitMQ (AMQP) Virtual Host resource.

    For information about RabbitMQ (AMQP) Virtual Host and how to use it, see What is Virtual Host.

    NOTE: Available since v1.126.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.amqp.Instance("default", {
        instanceType: "professional",
        maxTps: "1000",
        queueCapacity: "50",
        supportEip: true,
        maxEipTps: "128",
        paymentType: "Subscription",
        period: 1,
    });
    const defaultVirtualHost = new alicloud.amqp.VirtualHost("default", {
        instanceId: _default.id,
        virtualHostName: "tf-example",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.amqp.Instance("default",
        instance_type="professional",
        max_tps="1000",
        queue_capacity="50",
        support_eip=True,
        max_eip_tps="128",
        payment_type="Subscription",
        period=1)
    default_virtual_host = alicloud.amqp.VirtualHost("default",
        instance_id=default.id,
        virtual_host_name="tf-example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/amqp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := amqp.NewInstance(ctx, "default", &amqp.InstanceArgs{
    			InstanceType:  pulumi.String("professional"),
    			MaxTps:        pulumi.String("1000"),
    			QueueCapacity: pulumi.String("50"),
    			SupportEip:    pulumi.Bool(true),
    			MaxEipTps:     pulumi.String("128"),
    			PaymentType:   pulumi.String("Subscription"),
    			Period:        pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = amqp.NewVirtualHost(ctx, "default", &amqp.VirtualHostArgs{
    			InstanceId:      _default.ID(),
    			VirtualHostName: pulumi.String("tf-example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Amqp.Instance("default", new()
        {
            InstanceType = "professional",
            MaxTps = "1000",
            QueueCapacity = "50",
            SupportEip = true,
            MaxEipTps = "128",
            PaymentType = "Subscription",
            Period = 1,
        });
    
        var defaultVirtualHost = new AliCloud.Amqp.VirtualHost("default", new()
        {
            InstanceId = @default.Id,
            VirtualHostName = "tf-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.amqp.Instance;
    import com.pulumi.alicloud.amqp.InstanceArgs;
    import com.pulumi.alicloud.amqp.VirtualHost;
    import com.pulumi.alicloud.amqp.VirtualHostArgs;
    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 default_ = new Instance("default", InstanceArgs.builder()
                .instanceType("professional")
                .maxTps(1000)
                .queueCapacity(50)
                .supportEip(true)
                .maxEipTps(128)
                .paymentType("Subscription")
                .period(1)
                .build());
    
            var defaultVirtualHost = new VirtualHost("defaultVirtualHost", VirtualHostArgs.builder()
                .instanceId(default_.id())
                .virtualHostName("tf-example")
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:amqp:Instance
        properties:
          instanceType: professional
          maxTps: 1000
          queueCapacity: 50
          supportEip: true
          maxEipTps: 128
          paymentType: Subscription
          period: 1
      defaultVirtualHost:
        type: alicloud:amqp:VirtualHost
        name: default
        properties:
          instanceId: ${default.id}
          virtualHostName: tf-example
    

    Create VirtualHost Resource

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

    Constructor syntax

    new VirtualHost(name: string, args: VirtualHostArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualHost(resource_name: str,
                    args: VirtualHostArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def VirtualHost(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    instance_id: Optional[str] = None,
                    virtual_host_name: Optional[str] = None)
    func NewVirtualHost(ctx *Context, name string, args VirtualHostArgs, opts ...ResourceOption) (*VirtualHost, error)
    public VirtualHost(string name, VirtualHostArgs args, CustomResourceOptions? opts = null)
    public VirtualHost(String name, VirtualHostArgs args)
    public VirtualHost(String name, VirtualHostArgs args, CustomResourceOptions options)
    
    type: alicloud:amqp:VirtualHost
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VirtualHostArgs
    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 VirtualHostArgs
    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 VirtualHostArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VirtualHostArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VirtualHostArgs
    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 virtualHostResource = new AliCloud.Amqp.VirtualHost("virtualHostResource", new()
    {
        InstanceId = "string",
        VirtualHostName = "string",
    });
    
    example, err := amqp.NewVirtualHost(ctx, "virtualHostResource", &amqp.VirtualHostArgs{
    	InstanceId:      pulumi.String("string"),
    	VirtualHostName: pulumi.String("string"),
    })
    
    var virtualHostResource = new VirtualHost("virtualHostResource", VirtualHostArgs.builder()
        .instanceId("string")
        .virtualHostName("string")
        .build());
    
    virtual_host_resource = alicloud.amqp.VirtualHost("virtualHostResource",
        instance_id="string",
        virtual_host_name="string")
    
    const virtualHostResource = new alicloud.amqp.VirtualHost("virtualHostResource", {
        instanceId: "string",
        virtualHostName: "string",
    });
    
    type: alicloud:amqp:VirtualHost
    properties:
        instanceId: string
        virtualHostName: string
    

    VirtualHost 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 VirtualHost resource accepts the following input properties:

    InstanceId string
    InstanceId.
    VirtualHostName string
    VirtualHostName.
    InstanceId string
    InstanceId.
    VirtualHostName string
    VirtualHostName.
    instanceId String
    InstanceId.
    virtualHostName String
    VirtualHostName.
    instanceId string
    InstanceId.
    virtualHostName string
    VirtualHostName.
    instance_id str
    InstanceId.
    virtual_host_name str
    VirtualHostName.
    instanceId String
    InstanceId.
    virtualHostName String
    VirtualHostName.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VirtualHost 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 VirtualHost Resource

    Get an existing VirtualHost 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?: VirtualHostState, opts?: CustomResourceOptions): VirtualHost
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            virtual_host_name: Optional[str] = None) -> VirtualHost
    func GetVirtualHost(ctx *Context, name string, id IDInput, state *VirtualHostState, opts ...ResourceOption) (*VirtualHost, error)
    public static VirtualHost Get(string name, Input<string> id, VirtualHostState? state, CustomResourceOptions? opts = null)
    public static VirtualHost get(String name, Output<String> id, VirtualHostState 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:
    InstanceId string
    InstanceId.
    VirtualHostName string
    VirtualHostName.
    InstanceId string
    InstanceId.
    VirtualHostName string
    VirtualHostName.
    instanceId String
    InstanceId.
    virtualHostName String
    VirtualHostName.
    instanceId string
    InstanceId.
    virtualHostName string
    VirtualHostName.
    instance_id str
    InstanceId.
    virtual_host_name str
    VirtualHostName.
    instanceId String
    InstanceId.
    virtualHostName String
    VirtualHostName.

    Import

    RabbitMQ (AMQP) Virtual Host can be imported using the id, e.g.

    $ pulumi import alicloud:amqp/virtualHost:VirtualHost example <instance_id>:<virtual_host_name>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi