<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Amqp
{
    /// <summary>
    /// Provides a RabbitMQ (AMQP) Binding resource to bind tha exchange with another exchange or queue.
    /// 
    /// &gt; **NOTE:** Available in v1.135.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var exampleVirtualHost = new AliCloud.Amqp.VirtualHost("exampleVirtualHost", new()
    ///     {
    ///         InstanceId = "amqp-abc12345",
    ///         VirtualHostName = "my-VirtualHost",
    ///     });
    /// 
    ///     var exampleExchange = new AliCloud.Amqp.Exchange("exampleExchange", new()
    ///     {
    ///         AutoDeleteState = false,
    ///         ExchangeName = "my-Exchange",
    ///         ExchangeType = "HEADERS",
    ///         InstanceId = exampleVirtualHost.InstanceId,
    ///         Internal = false,
    ///         VirtualHostName = exampleVirtualHost.VirtualHostName,
    ///     });
    /// 
    ///     var exampleQueue = new AliCloud.Amqp.Queue("exampleQueue", new()
    ///     {
    ///         InstanceId = exampleVirtualHost.InstanceId,
    ///         QueueName = "my-Queue",
    ///         VirtualHostName = exampleVirtualHost.VirtualHostName,
    ///     });
    /// 
    ///     var exampleBinding = new AliCloud.Amqp.Binding("exampleBinding", new()
    ///     {
    ///         Argument = "x-match:all",
    ///         BindingKey = exampleQueue.QueueName,
    ///         BindingType = "QUEUE",
    ///         DestinationName = "binding-queue",
    ///         InstanceId = exampleExchange.InstanceId,
    ///         SourceExchange = exampleExchange.ExchangeName,
    ///         VirtualHostName = exampleExchange.VirtualHostName,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// RabbitMQ (AMQP) Binding can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:amqp/binding:Binding example &lt;instance_id&gt;:&lt;virtual_host_name&gt;:&lt;source_exchange&gt;:&lt;destination_name&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:amqp/binding:Binding")]
    public partial class Binding : global::Pulumi.CustomResource
    {
        /// <summary>
        /// X-match Attributes. Valid Values: 
        /// * "x-match:all": Default Value, All the Message Header of Key-Value Pairs Stored in the Must Match.
        /// * "x-match:any": at Least One Pair of the Message Header of Key-Value Pairs Stored in the Must Match.
        /// </summary>
        [Output("argument")]
        public Output<string> Argument { get; private set; } = null!;

        /// <summary>
        /// The Binding Key.
        /// * For a non-topic source exchange: The binding key can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// The binding key must be 1 to 255 characters in length.
        /// * For a topic source exchange: The binding key can contain letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// If the binding key contains a number sign (#), the binding key must start with a number sign (#) followed by a period (.) or end with a number sign (#) that follows a period (.).
        /// The binding key must be 1 to 255 characters in length.
        /// </summary>
        [Output("bindingKey")]
        public Output<string> BindingKey { get; private set; } = null!;

        /// <summary>
        /// The Target Binding Types. Valid values: `EXCHANGE`, `QUEUE`.
        /// </summary>
        [Output("bindingType")]
        public Output<string> BindingType { get; private set; } = null!;

        /// <summary>
        /// The Target Queue Or Exchange of the Name.
        /// </summary>
        [Output("destinationName")]
        public Output<string> DestinationName { get; private set; } = null!;

        /// <summary>
        /// Instance Id.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The Source Exchange Name.
        /// </summary>
        [Output("sourceExchange")]
        public Output<string> SourceExchange { get; private set; } = null!;

        /// <summary>
        /// Virtualhost Name.
        /// </summary>
        [Output("virtualHostName")]
        public Output<string> VirtualHostName { get; private set; } = null!;


        /// <summary>
        /// Create a Binding resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Binding(string name, BindingArgs args, CustomResourceOptions? options = null)
            : base("alicloud:amqp/binding:Binding", name, args ?? new BindingArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Binding(string name, Input<string> id, BindingState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:amqp/binding:Binding", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Binding resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Binding Get(string name, Input<string> id, BindingState? state = null, CustomResourceOptions? options = null)
        {
            return new Binding(name, id, state, options);
        }
    }

    public sealed class BindingArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// X-match Attributes. Valid Values: 
        /// * "x-match:all": Default Value, All the Message Header of Key-Value Pairs Stored in the Must Match.
        /// * "x-match:any": at Least One Pair of the Message Header of Key-Value Pairs Stored in the Must Match.
        /// </summary>
        [Input("argument")]
        public Input<string>? Argument { get; set; }

        /// <summary>
        /// The Binding Key.
        /// * For a non-topic source exchange: The binding key can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// The binding key must be 1 to 255 characters in length.
        /// * For a topic source exchange: The binding key can contain letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// If the binding key contains a number sign (#), the binding key must start with a number sign (#) followed by a period (.) or end with a number sign (#) that follows a period (.).
        /// The binding key must be 1 to 255 characters in length.
        /// </summary>
        [Input("bindingKey", required: true)]
        public Input<string> BindingKey { get; set; } = null!;

        /// <summary>
        /// The Target Binding Types. Valid values: `EXCHANGE`, `QUEUE`.
        /// </summary>
        [Input("bindingType", required: true)]
        public Input<string> BindingType { get; set; } = null!;

        /// <summary>
        /// The Target Queue Or Exchange of the Name.
        /// </summary>
        [Input("destinationName", required: true)]
        public Input<string> DestinationName { get; set; } = null!;

        /// <summary>
        /// Instance Id.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The Source Exchange Name.
        /// </summary>
        [Input("sourceExchange", required: true)]
        public Input<string> SourceExchange { get; set; } = null!;

        /// <summary>
        /// Virtualhost Name.
        /// </summary>
        [Input("virtualHostName", required: true)]
        public Input<string> VirtualHostName { get; set; } = null!;

        public BindingArgs()
        {
        }
        public static new BindingArgs Empty => new BindingArgs();
    }

    public sealed class BindingState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// X-match Attributes. Valid Values: 
        /// * "x-match:all": Default Value, All the Message Header of Key-Value Pairs Stored in the Must Match.
        /// * "x-match:any": at Least One Pair of the Message Header of Key-Value Pairs Stored in the Must Match.
        /// </summary>
        [Input("argument")]
        public Input<string>? Argument { get; set; }

        /// <summary>
        /// The Binding Key.
        /// * For a non-topic source exchange: The binding key can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// The binding key must be 1 to 255 characters in length.
        /// * For a topic source exchange: The binding key can contain letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// If the binding key contains a number sign (#), the binding key must start with a number sign (#) followed by a period (.) or end with a number sign (#) that follows a period (.).
        /// The binding key must be 1 to 255 characters in length.
        /// </summary>
        [Input("bindingKey")]
        public Input<string>? BindingKey { get; set; }

        /// <summary>
        /// The Target Binding Types. Valid values: `EXCHANGE`, `QUEUE`.
        /// </summary>
        [Input("bindingType")]
        public Input<string>? BindingType { get; set; }

        /// <summary>
        /// The Target Queue Or Exchange of the Name.
        /// </summary>
        [Input("destinationName")]
        public Input<string>? DestinationName { get; set; }

        /// <summary>
        /// Instance Id.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The Source Exchange Name.
        /// </summary>
        [Input("sourceExchange")]
        public Input<string>? SourceExchange { get; set; }

        /// <summary>
        /// Virtualhost Name.
        /// </summary>
        [Input("virtualHostName")]
        public Input<string>? VirtualHostName { get; set; }

        public BindingState()
        {
        }
        public static new BindingState Empty => new BindingState();
    }
}
