// *** 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.Vpc
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var region = config.Get("region") ?? "cn-hangzhou";
    ///     var name = config.Get("name") ?? "alicloudRouterInterfaceConnectionBasic";
    ///     var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
    ///     {
    ///         VpcName = name,
    ///         CidrBlock = "172.16.0.0/12",
    ///     });
    /// 
    ///     var barNetwork = new AliCloud.Vpc.Network("barNetwork", new()
    ///     {
    ///         VpcName = name,
    ///         CidrBlock = "192.168.0.0/16",
    ///     }, new CustomResourceOptions
    ///     {
    ///         Provider = alicloud,
    ///     });
    /// 
    ///     var initiate = new AliCloud.Vpc.RouterInterface("initiate", new()
    ///     {
    ///         OppositeRegion = region,
    ///         RouterType = "VRouter",
    ///         RouterId = fooNetwork.RouterId,
    ///         Role = "InitiatingSide",
    ///         Specification = "Large.2",
    ///         Description = name,
    ///         InstanceChargeType = "PostPaid",
    ///     });
    /// 
    ///     var opposite = new AliCloud.Vpc.RouterInterface("opposite", new()
    ///     {
    ///         OppositeRegion = region,
    ///         RouterType = "VRouter",
    ///         RouterId = barNetwork.RouterId,
    ///         Role = "AcceptingSide",
    ///         Specification = "Large.1",
    ///         Description = $"{name}-opposite",
    ///     }, new CustomResourceOptions
    ///     {
    ///         Provider = alicloud,
    ///     });
    /// 
    ///     var barRouterInterfaceConnection = new AliCloud.Vpc.RouterInterfaceConnection("barRouterInterfaceConnection", new()
    ///     {
    ///         InterfaceId = opposite.Id,
    ///         OppositeInterfaceId = initiate.Id,
    ///     }, new CustomResourceOptions
    ///     {
    ///         Provider = alicloud,
    ///     });
    /// 
    ///     // A integrated router interface connection tunnel requires both InitiatingSide and AcceptingSide configuring opposite router interface.
    ///     var fooRouterInterfaceConnection = new AliCloud.Vpc.RouterInterfaceConnection("fooRouterInterfaceConnection", new()
    ///     {
    ///         InterfaceId = initiate.Id,
    ///         OppositeInterfaceId = opposite.Id,
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             barRouterInterfaceConnection,
    ///         },
    ///     });
    /// 
    ///     // The connection must start from the accepting side.
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// The router interface connection can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:vpc/routerInterfaceConnection:RouterInterfaceConnection foo ri-abc123456
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:vpc/routerInterfaceConnection:RouterInterfaceConnection")]
    public partial class RouterInterfaceConnection : global::Pulumi.CustomResource
    {
        /// <summary>
        /// One side router interface ID.
        /// </summary>
        [Output("interfaceId")]
        public Output<string> InterfaceId { get; private set; } = null!;

        /// <summary>
        /// Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.
        /// </summary>
        [Output("oppositeInterfaceId")]
        public Output<string> OppositeInterfaceId { get; private set; } = null!;

        [Output("oppositeInterfaceOwnerId")]
        public Output<string> OppositeInterfaceOwnerId { get; private set; } = null!;

        /// <summary>
        /// Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.
        /// </summary>
        [Output("oppositeRouterId")]
        public Output<string> OppositeRouterId { get; private set; } = null!;

        /// <summary>
        /// Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.
        /// </summary>
        [Output("oppositeRouterType")]
        public Output<string?> OppositeRouterType { get; private set; } = null!;


        /// <summary>
        /// Create a RouterInterfaceConnection 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 RouterInterfaceConnection(string name, RouterInterfaceConnectionArgs args, CustomResourceOptions? options = null)
            : base("alicloud:vpc/routerInterfaceConnection:RouterInterfaceConnection", name, args ?? new RouterInterfaceConnectionArgs(), MakeResourceOptions(options, ""))
        {
        }

        private RouterInterfaceConnection(string name, Input<string> id, RouterInterfaceConnectionState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:vpc/routerInterfaceConnection:RouterInterfaceConnection", 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 RouterInterfaceConnection 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 RouterInterfaceConnection Get(string name, Input<string> id, RouterInterfaceConnectionState? state = null, CustomResourceOptions? options = null)
        {
            return new RouterInterfaceConnection(name, id, state, options);
        }
    }

    public sealed class RouterInterfaceConnectionArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// One side router interface ID.
        /// </summary>
        [Input("interfaceId", required: true)]
        public Input<string> InterfaceId { get; set; } = null!;

        /// <summary>
        /// Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.
        /// </summary>
        [Input("oppositeInterfaceId", required: true)]
        public Input<string> OppositeInterfaceId { get; set; } = null!;

        [Input("oppositeInterfaceOwnerId")]
        public Input<string>? OppositeInterfaceOwnerId { get; set; }

        /// <summary>
        /// Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.
        /// </summary>
        [Input("oppositeRouterId")]
        public Input<string>? OppositeRouterId { get; set; }

        /// <summary>
        /// Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.
        /// </summary>
        [Input("oppositeRouterType")]
        public Input<string>? OppositeRouterType { get; set; }

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

    public sealed class RouterInterfaceConnectionState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// One side router interface ID.
        /// </summary>
        [Input("interfaceId")]
        public Input<string>? InterfaceId { get; set; }

        /// <summary>
        /// Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.
        /// </summary>
        [Input("oppositeInterfaceId")]
        public Input<string>? OppositeInterfaceId { get; set; }

        [Input("oppositeInterfaceOwnerId")]
        public Input<string>? OppositeInterfaceOwnerId { get; set; }

        /// <summary>
        /// Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.
        /// </summary>
        [Input("oppositeRouterId")]
        public Input<string>? OppositeRouterId { get; set; }

        /// <summary>
        /// Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.
        /// </summary>
        [Input("oppositeRouterType")]
        public Input<string>? OppositeRouterType { get; set; }

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