// *** 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
{
    public static class GetRouteEntries
    {
        /// <summary>
        /// This data source provides a list of Route Entries owned by an Alibaba Cloud account.
        /// 
        /// &gt; **NOTE:** Available in 1.37.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultZones = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableResourceCreation = "VSwitch",
        ///     });
        /// 
        ///     var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         CpuCoreCount = 1,
        ///         MemorySize = 2,
        ///     });
        /// 
        ///     var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
        ///     {
        ///         MostRecent = true,
        ///         NameRegex = "^ubuntu_18.*64",
        ///         Owners = "system",
        ///     });
        /// 
        ///     var config = new Config();
        ///     var name = config.Get("name") ?? "tf-testAccRouteEntryConfig";
        ///     var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
        ///     {
        ///         CidrBlock = "10.1.0.0/21",
        ///     });
        /// 
        ///     var fooSwitch = new AliCloud.Vpc.Switch("fooSwitch", new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         CidrBlock = "10.1.1.0/24",
        ///         VpcId = fooNetwork.Id,
        ///         VswitchName = name,
        ///     });
        /// 
        ///     var tfTestFoo = new AliCloud.Ecs.SecurityGroup("tfTestFoo", new()
        ///     {
        ///         Description = "foo",
        ///         VpcId = fooNetwork.Id,
        ///     });
        /// 
        ///     var fooInstance = new AliCloud.Ecs.Instance("fooInstance", new()
        ///     {
        ///         AllocatePublicIp = true,
        ///         ImageId = defaultImages.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
        ///         InstanceChargeType = "PostPaid",
        ///         InstanceName = name,
        ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.InstanceTypes[0]?.Id),
        ///         InternetChargeType = "PayByTraffic",
        ///         InternetMaxBandwidthOut = 5,
        ///         SecurityGroups = new[]
        ///         {
        ///             tfTestFoo.Id,
        ///         },
        ///         SystemDiskCategory = "cloud_efficiency",
        ///         VswitchId = fooSwitch.Id,
        ///     });
        /// 
        ///     var fooRouteEntry = new AliCloud.Vpc.RouteEntry("fooRouteEntry", new()
        ///     {
        ///         DestinationCidrblock = "172.11.1.1/32",
        ///         NexthopId = fooInstance.Id,
        ///         NexthopType = "Instance",
        ///         RouteTableId = fooNetwork.RouteTableId,
        ///     });
        /// 
        ///     var ingress = new AliCloud.Ecs.SecurityGroupRule("ingress", new()
        ///     {
        ///         CidrIp = "0.0.0.0/0",
        ///         IpProtocol = "tcp",
        ///         NicType = "intranet",
        ///         Policy = "accept",
        ///         PortRange = "22/22",
        ///         Priority = 1,
        ///         SecurityGroupId = tfTestFoo.Id,
        ///         Type = "ingress",
        ///     });
        /// 
        ///     var fooRouteEntries = AliCloud.Vpc.GetRouteEntries.Invoke(new()
        ///     {
        ///         RouteTableId = fooRouteEntry.RouteTableId,
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetRouteEntriesResult> InvokeAsync(GetRouteEntriesArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetRouteEntriesResult>("alicloud:vpc/getRouteEntries:getRouteEntries", args ?? new GetRouteEntriesArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides a list of Route Entries owned by an Alibaba Cloud account.
        /// 
        /// &gt; **NOTE:** Available in 1.37.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultZones = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableResourceCreation = "VSwitch",
        ///     });
        /// 
        ///     var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         CpuCoreCount = 1,
        ///         MemorySize = 2,
        ///     });
        /// 
        ///     var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
        ///     {
        ///         MostRecent = true,
        ///         NameRegex = "^ubuntu_18.*64",
        ///         Owners = "system",
        ///     });
        /// 
        ///     var config = new Config();
        ///     var name = config.Get("name") ?? "tf-testAccRouteEntryConfig";
        ///     var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
        ///     {
        ///         CidrBlock = "10.1.0.0/21",
        ///     });
        /// 
        ///     var fooSwitch = new AliCloud.Vpc.Switch("fooSwitch", new()
        ///     {
        ///         AvailabilityZone = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         CidrBlock = "10.1.1.0/24",
        ///         VpcId = fooNetwork.Id,
        ///         VswitchName = name,
        ///     });
        /// 
        ///     var tfTestFoo = new AliCloud.Ecs.SecurityGroup("tfTestFoo", new()
        ///     {
        ///         Description = "foo",
        ///         VpcId = fooNetwork.Id,
        ///     });
        /// 
        ///     var fooInstance = new AliCloud.Ecs.Instance("fooInstance", new()
        ///     {
        ///         AllocatePublicIp = true,
        ///         ImageId = defaultImages.Apply(getImagesResult =&gt; getImagesResult.Images[0]?.Id),
        ///         InstanceChargeType = "PostPaid",
        ///         InstanceName = name,
        ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.InstanceTypes[0]?.Id),
        ///         InternetChargeType = "PayByTraffic",
        ///         InternetMaxBandwidthOut = 5,
        ///         SecurityGroups = new[]
        ///         {
        ///             tfTestFoo.Id,
        ///         },
        ///         SystemDiskCategory = "cloud_efficiency",
        ///         VswitchId = fooSwitch.Id,
        ///     });
        /// 
        ///     var fooRouteEntry = new AliCloud.Vpc.RouteEntry("fooRouteEntry", new()
        ///     {
        ///         DestinationCidrblock = "172.11.1.1/32",
        ///         NexthopId = fooInstance.Id,
        ///         NexthopType = "Instance",
        ///         RouteTableId = fooNetwork.RouteTableId,
        ///     });
        /// 
        ///     var ingress = new AliCloud.Ecs.SecurityGroupRule("ingress", new()
        ///     {
        ///         CidrIp = "0.0.0.0/0",
        ///         IpProtocol = "tcp",
        ///         NicType = "intranet",
        ///         Policy = "accept",
        ///         PortRange = "22/22",
        ///         Priority = 1,
        ///         SecurityGroupId = tfTestFoo.Id,
        ///         Type = "ingress",
        ///     });
        /// 
        ///     var fooRouteEntries = AliCloud.Vpc.GetRouteEntries.Invoke(new()
        ///     {
        ///         RouteTableId = fooRouteEntry.RouteTableId,
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetRouteEntriesResult> Invoke(GetRouteEntriesInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetRouteEntriesResult>("alicloud:vpc/getRouteEntries:getRouteEntries", args ?? new GetRouteEntriesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetRouteEntriesArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The destination CIDR block of the route entry.
        /// </summary>
        [Input("cidrBlock")]
        public string? CidrBlock { get; set; }

        /// <summary>
        /// The instance ID of the next hop.
        /// </summary>
        [Input("instanceId")]
        public string? InstanceId { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// The ID of the router table to which the route entry belongs.
        /// </summary>
        [Input("routeTableId", required: true)]
        public string RouteTableId { get; set; } = null!;

        /// <summary>
        /// The type of the route entry.
        /// </summary>
        [Input("type")]
        public string? Type { get; set; }

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

    public sealed class GetRouteEntriesInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The destination CIDR block of the route entry.
        /// </summary>
        [Input("cidrBlock")]
        public Input<string>? CidrBlock { get; set; }

        /// <summary>
        /// The instance ID of the next hop.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

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

        /// <summary>
        /// The ID of the router table to which the route entry belongs.
        /// </summary>
        [Input("routeTableId", required: true)]
        public Input<string> RouteTableId { get; set; } = null!;

        /// <summary>
        /// The type of the route entry.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

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


    [OutputType]
    public sealed class GetRouteEntriesResult
    {
        /// <summary>
        /// The destination CIDR block of the route entry.
        /// </summary>
        public readonly string? CidrBlock;
        /// <summary>
        /// A list of Route Entries. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetRouteEntriesEntryResult> Entries;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// The instance ID of the next hop.
        /// </summary>
        public readonly string? InstanceId;
        public readonly string? OutputFile;
        /// <summary>
        /// The ID of the router table to which the route entry belongs.
        /// </summary>
        public readonly string RouteTableId;
        /// <summary>
        /// The type of the route entry.
        /// </summary>
        public readonly string? Type;

        [OutputConstructor]
        private GetRouteEntriesResult(
            string? cidrBlock,

            ImmutableArray<Outputs.GetRouteEntriesEntryResult> entries,

            string id,

            string? instanceId,

            string? outputFile,

            string routeTableId,

            string? type)
        {
            CidrBlock = cidrBlock;
            Entries = entries;
            Id = id;
            InstanceId = instanceId;
            OutputFile = outputFile;
            RouteTableId = routeTableId;
            Type = type;
        }
    }
}
