<filename>sdk/dotnet/Tencentcloud/Vpc/GetRouteTables.cs// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Vpc
{
    public static class GetRouteTables
    {
        /// <summary>
        /// Use this data source to query vpc route tables information.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var config = new Config();
        ///         var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
        ///         var foo = new Tencentcloud.Vpc.Instance("foo", new Tencentcloud.Vpc.InstanceArgs
        ///         {
        ///             CidrBlock = "10.0.0.0/16",
        ///         });
        ///         var routeTable = new Tencentcloud.Route.Table("routeTable", new Tencentcloud.Route.TableArgs
        ///         {
        ///             VpcId = foo.Id,
        ///             Tags = 
        ///             {
        ///                 { "test", "test" },
        ///             },
        ///         });
        ///         var idInstances = Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             RouteTableId = routeTable.Id,
        ///         });
        ///         var nameInstances = Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             Name = routeTable.Name,
        ///         });
        ///         var vpcDefaultInstance = Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             VpcId = foo.Id,
        ///             AssociationMain = true,
        ///         });
        ///         var tagsInstances = routeTable.Tags.Apply(tags =&gt; Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             Tags = tags,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetRouteTablesResult> InvokeAsync(GetRouteTablesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetRouteTablesResult>("tencentcloud:Vpc/getRouteTables:getRouteTables", args ?? new GetRouteTablesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query vpc route tables information.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var config = new Config();
        ///         var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
        ///         var foo = new Tencentcloud.Vpc.Instance("foo", new Tencentcloud.Vpc.InstanceArgs
        ///         {
        ///             CidrBlock = "10.0.0.0/16",
        ///         });
        ///         var routeTable = new Tencentcloud.Route.Table("routeTable", new Tencentcloud.Route.TableArgs
        ///         {
        ///             VpcId = foo.Id,
        ///             Tags = 
        ///             {
        ///                 { "test", "test" },
        ///             },
        ///         });
        ///         var idInstances = Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             RouteTableId = routeTable.Id,
        ///         });
        ///         var nameInstances = Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             Name = routeTable.Name,
        ///         });
        ///         var vpcDefaultInstance = Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             VpcId = foo.Id,
        ///             AssociationMain = true,
        ///         });
        ///         var tagsInstances = routeTable.Tags.Apply(tags =&gt; Tencentcloud.Vpc.GetRouteTables.Invoke(new Tencentcloud.Vpc.GetRouteTablesInvokeArgs
        ///         {
        ///             Tags = tags,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetRouteTablesResult> Invoke(GetRouteTablesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetRouteTablesResult>("tencentcloud:Vpc/getRouteTables:getRouteTables", args ?? new GetRouteTablesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetRouteTablesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Filter the main routing table.
        /// </summary>
        [Input("associationMain")]
        public bool? AssociationMain { get; set; }

        /// <summary>
        /// Name of the routing table to be queried.
        /// </summary>
        [Input("name")]
        public string? Name { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        /// <summary>
        /// ID of the routing table to be queried.
        /// </summary>
        [Input("routeTableId")]
        public string? RouteTableId { get; set; }

        /// <summary>
        /// Filter if routing table has this tag.
        /// </summary>
        [Input("tagKey")]
        public string? TagKey { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// Tags of the routing table to be queried.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

        /// <summary>
        /// ID of the VPC to be queried.
        /// </summary>
        [Input("vpcId")]
        public string? VpcId { get; set; }

        public GetRouteTablesArgs()
        {
        }
    }

    public sealed class GetRouteTablesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Filter the main routing table.
        /// </summary>
        [Input("associationMain")]
        public Input<bool>? AssociationMain { get; set; }

        /// <summary>
        /// Name of the routing table to be queried.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        /// <summary>
        /// ID of the routing table to be queried.
        /// </summary>
        [Input("routeTableId")]
        public Input<string>? RouteTableId { get; set; }

        /// <summary>
        /// Filter if routing table has this tag.
        /// </summary>
        [Input("tagKey")]
        public Input<string>? TagKey { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Tags of the routing table to be queried.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// ID of the VPC to be queried.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public GetRouteTablesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetRouteTablesResult
    {
        public readonly bool? AssociationMain;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// The information list of the VPC route table.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetRouteTablesInstanceListResult> InstanceLists;
        /// <summary>
        /// Name of the routing table.
        /// </summary>
        public readonly string? Name;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// ID of the routing table.
        /// </summary>
        public readonly string? RouteTableId;
        public readonly string? TagKey;
        /// <summary>
        /// Tags of the routing table.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;
        /// <summary>
        /// ID of the VPC.
        /// </summary>
        public readonly string? VpcId;

        [OutputConstructor]
        private GetRouteTablesResult(
            bool? associationMain,

            string id,

            ImmutableArray<Outputs.GetRouteTablesInstanceListResult> instanceLists,

            string? name,

            string? resultOutputFile,

            string? routeTableId,

            string? tagKey,

            ImmutableDictionary<string, object>? tags,

            string? vpcId)
        {
            AssociationMain = associationMain;
            Id = id;
            InstanceLists = instanceLists;
            Name = name;
            ResultOutputFile = resultOutputFile;
            RouteTableId = routeTableId;
            TagKey = tagKey;
            Tags = tags;
            VpcId = vpcId;
        }
    }
}
