// *** 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
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "route-table-attachment-example-name";
    ///     var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
    ///     {
    ///         CidrBlock = "172.16.0.0/12",
    ///     });
    /// 
    ///     var @default = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = "VSwitch",
    ///     });
    /// 
    ///     var fooSwitch = new AliCloud.Vpc.Switch("fooSwitch", new()
    ///     {
    ///         VpcId = fooNetwork.Id,
    ///         CidrBlock = "172.16.0.0/21",
    ///         ZoneId = @default.Apply(getZonesResult =&gt; getZonesResult).Apply(@default =&gt; @default.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id)),
    ///     });
    /// 
    ///     var fooRouteTable = new AliCloud.Vpc.RouteTable("fooRouteTable", new()
    ///     {
    ///         VpcId = fooNetwork.Id,
    ///         RouteTableName = name,
    ///         Description = "route_table_attachment",
    ///     });
    /// 
    ///     var fooRouteTableAttachment = new AliCloud.Vpc.RouteTableAttachment("fooRouteTableAttachment", new()
    ///     {
    ///         VswitchId = fooSwitch.Id,
    ///         RouteTableId = fooRouteTable.Id,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// The route table attachment can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:vpc/routeTableAttachment:RouteTableAttachment foo vtb-abc123456:vsw-abc123456
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:vpc/routeTableAttachment:RouteTableAttachment")]
    public partial class RouteTableAttachment : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The route_table_id of the route table attachment, the field can't be changed.
        /// </summary>
        [Output("routeTableId")]
        public Output<string> RouteTableId { get; private set; } = null!;

        /// <summary>
        /// The vswitch_id of the route table attachment, the field can't be changed.
        /// </summary>
        [Output("vswitchId")]
        public Output<string> VswitchId { get; private set; } = null!;


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

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

    public sealed class RouteTableAttachmentArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The route_table_id of the route table attachment, the field can't be changed.
        /// </summary>
        [Input("routeTableId", required: true)]
        public Input<string> RouteTableId { get; set; } = null!;

        /// <summary>
        /// The vswitch_id of the route table attachment, the field can't be changed.
        /// </summary>
        [Input("vswitchId", required: true)]
        public Input<string> VswitchId { get; set; } = null!;

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

    public sealed class RouteTableAttachmentState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The route_table_id of the route table attachment, the field can't be changed.
        /// </summary>
        [Input("routeTableId")]
        public Input<string>? RouteTableId { get; set; }

        /// <summary>
        /// The vswitch_id of the route table attachment, the field can't be changed.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

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