1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. getVpcSubnetV1
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.getVpcSubnetV1

Explore with Pulumi AI

flexibleengine logo
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

    Provides details about a specific VPC subnet.

    This data source can prove useful when a module accepts a subnet id as an input variable and needs to, for example, determine the id of the VPC that the subnet belongs to.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const subnetV1 = flexibleengine.getVpcSubnetV1({
        id: _var.subnet_id,
    });
    export const subnetVpcId = subnetV1.then(subnetV1 => subnetV1.vpcId);
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    subnet_v1 = flexibleengine.get_vpc_subnet_v1(id=var["subnet_id"])
    pulumi.export("subnetVpcId", subnet_v1.vpc_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		subnetV1, err := flexibleengine.LookupVpcSubnetV1(ctx, &flexibleengine.LookupVpcSubnetV1Args{
    			Id: pulumi.StringRef(_var.Subnet_id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("subnetVpcId", subnetV1.VpcId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var subnetV1 = Flexibleengine.GetVpcSubnetV1.Invoke(new()
        {
            Id = @var.Subnet_id,
        });
    
        return new Dictionary<string, object?>
        {
            ["subnetVpcId"] = subnetV1.Apply(getVpcSubnetV1Result => getVpcSubnetV1Result.VpcId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.FlexibleengineFunctions;
    import com.pulumi.flexibleengine.inputs.GetVpcSubnetV1Args;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var subnetV1 = FlexibleengineFunctions.getVpcSubnetV1(GetVpcSubnetV1Args.builder()
                .id(var_.subnet_id())
                .build());
    
            ctx.export("subnetVpcId", subnetV1.applyValue(getVpcSubnetV1Result -> getVpcSubnetV1Result.vpcId()));
        }
    }
    
    variables:
      subnetV1:
        fn::invoke:
          function: flexibleengine:getVpcSubnetV1
          arguments:
            id: ${var.subnet_id}
    outputs:
      subnetVpcId: ${subnetV1.vpcId}
    

    Attributes Reference

    All of the argument attributes are also exported as result attributes. This data source will complete the data by populating any fields that are not included in the configuration with the data for the selected subnet.

    • dns_list - The IP address list of DNS servers on the subnet.

    • dhcp_enable - DHCP function for the subnet.

    • ipv4_subnet_id - The ID of the IPv4 subnet (Native OpenStack API).

    • ipv6_enable - Whether the IPv6 is enabled.

    • ipv6_subnet_id - The ID of the IPv6 subnet (Native OpenStack API).

    • ipv6_cidr - The IPv6 subnet CIDR block.

    • ipv6_gateway - The IPv6 subnet gateway.

    Using getVpcSubnetV1

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVpcSubnetV1(args: GetVpcSubnetV1Args, opts?: InvokeOptions): Promise<GetVpcSubnetV1Result>
    function getVpcSubnetV1Output(args: GetVpcSubnetV1OutputArgs, opts?: InvokeOptions): Output<GetVpcSubnetV1Result>
    def get_vpc_subnet_v1(availability_zone: Optional[str] = None,
                          cidr: Optional[str] = None,
                          gateway_ip: Optional[str] = None,
                          id: Optional[str] = None,
                          name: Optional[str] = None,
                          primary_dns: Optional[str] = None,
                          region: Optional[str] = None,
                          secondary_dns: Optional[str] = None,
                          status: Optional[str] = None,
                          vpc_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetVpcSubnetV1Result
    def get_vpc_subnet_v1_output(availability_zone: Optional[pulumi.Input[str]] = None,
                          cidr: Optional[pulumi.Input[str]] = None,
                          gateway_ip: Optional[pulumi.Input[str]] = None,
                          id: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          primary_dns: Optional[pulumi.Input[str]] = None,
                          region: Optional[pulumi.Input[str]] = None,
                          secondary_dns: Optional[pulumi.Input[str]] = None,
                          status: Optional[pulumi.Input[str]] = None,
                          vpc_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetVpcSubnetV1Result]
    func LookupVpcSubnetV1(ctx *Context, args *LookupVpcSubnetV1Args, opts ...InvokeOption) (*LookupVpcSubnetV1Result, error)
    func LookupVpcSubnetV1Output(ctx *Context, args *LookupVpcSubnetV1OutputArgs, opts ...InvokeOption) LookupVpcSubnetV1ResultOutput

    > Note: This function is named LookupVpcSubnetV1 in the Go SDK.

    public static class GetVpcSubnetV1 
    {
        public static Task<GetVpcSubnetV1Result> InvokeAsync(GetVpcSubnetV1Args args, InvokeOptions? opts = null)
        public static Output<GetVpcSubnetV1Result> Invoke(GetVpcSubnetV1InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcSubnetV1Result> getVpcSubnetV1(GetVpcSubnetV1Args args, InvokeOptions options)
    public static Output<GetVpcSubnetV1Result> getVpcSubnetV1(GetVpcSubnetV1Args args, InvokeOptions options)
    
    fn::invoke:
      function: flexibleengine:index/getVpcSubnetV1:getVpcSubnetV1
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AvailabilityZone string
    The availability zone (AZ) to which the subnet should belong.
    Cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    GatewayIp string
    The subnet gateway address of specific subnet.
    Id string
    Specifies the ID in UUID format.
    Name string
    The name of the specific subnet to retrieve.
    PrimaryDns string
    The IP address of DNS server 1 on the specific subnet.
    Region string
    The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
    SecondaryDns string
    The IP address of DNS server 2 on the specific subnet.
    Status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    VpcId string
    The id of the VPC that the desired subnet belongs to.
    AvailabilityZone string
    The availability zone (AZ) to which the subnet should belong.
    Cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    GatewayIp string
    The subnet gateway address of specific subnet.
    Id string
    Specifies the ID in UUID format.
    Name string
    The name of the specific subnet to retrieve.
    PrimaryDns string
    The IP address of DNS server 1 on the specific subnet.
    Region string
    The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
    SecondaryDns string
    The IP address of DNS server 2 on the specific subnet.
    Status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    VpcId string
    The id of the VPC that the desired subnet belongs to.
    availabilityZone String
    The availability zone (AZ) to which the subnet should belong.
    cidr String
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    gatewayIp String
    The subnet gateway address of specific subnet.
    id String
    Specifies the ID in UUID format.
    name String
    The name of the specific subnet to retrieve.
    primaryDns String
    The IP address of DNS server 1 on the specific subnet.
    region String
    The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
    secondaryDns String
    The IP address of DNS server 2 on the specific subnet.
    status String
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpcId String
    The id of the VPC that the desired subnet belongs to.
    availabilityZone string
    The availability zone (AZ) to which the subnet should belong.
    cidr string
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    gatewayIp string
    The subnet gateway address of specific subnet.
    id string
    Specifies the ID in UUID format.
    name string
    The name of the specific subnet to retrieve.
    primaryDns string
    The IP address of DNS server 1 on the specific subnet.
    region string
    The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
    secondaryDns string
    The IP address of DNS server 2 on the specific subnet.
    status string
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpcId string
    The id of the VPC that the desired subnet belongs to.
    availability_zone str
    The availability zone (AZ) to which the subnet should belong.
    cidr str
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    gateway_ip str
    The subnet gateway address of specific subnet.
    id str
    Specifies the ID in UUID format.
    name str
    The name of the specific subnet to retrieve.
    primary_dns str
    The IP address of DNS server 1 on the specific subnet.
    region str
    The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
    secondary_dns str
    The IP address of DNS server 2 on the specific subnet.
    status str
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpc_id str
    The id of the VPC that the desired subnet belongs to.
    availabilityZone String
    The availability zone (AZ) to which the subnet should belong.
    cidr String
    The network segment of specific subnet to retrieve. The value must be in CIDR format.
    gatewayIp String
    The subnet gateway address of specific subnet.
    id String
    Specifies the ID in UUID format.
    name String
    The name of the specific subnet to retrieve.
    primaryDns String
    The IP address of DNS server 1 on the specific subnet.
    region String
    The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
    secondaryDns String
    The IP address of DNS server 2 on the specific subnet.
    status String
    The value can be ACTIVE, DOWN, UNKNOWN, or ERROR.
    vpcId String
    The id of the VPC that the desired subnet belongs to.

    getVpcSubnetV1 Result

    The following output properties are available:

    DhcpEnable bool
    DnsLists List<string>
    Id string
    Ipv4SubnetId string
    Ipv6Cidr string
    Ipv6Enable bool
    Ipv6Gateway string
    Ipv6SubnetId string
    Region string
    SubnetId string
    AvailabilityZone string
    Cidr string
    GatewayIp string
    Name string
    PrimaryDns string
    SecondaryDns string
    Status string
    VpcId string
    DhcpEnable bool
    DnsLists []string
    Id string
    Ipv4SubnetId string
    Ipv6Cidr string
    Ipv6Enable bool
    Ipv6Gateway string
    Ipv6SubnetId string
    Region string
    SubnetId string
    AvailabilityZone string
    Cidr string
    GatewayIp string
    Name string
    PrimaryDns string
    SecondaryDns string
    Status string
    VpcId string
    dhcpEnable Boolean
    dnsLists List<String>
    id String
    ipv4SubnetId String
    ipv6Cidr String
    ipv6Enable Boolean
    ipv6Gateway String
    ipv6SubnetId String
    region String
    subnetId String
    availabilityZone String
    cidr String
    gatewayIp String
    name String
    primaryDns String
    secondaryDns String
    status String
    vpcId String
    dhcpEnable boolean
    dnsLists string[]
    id string
    ipv4SubnetId string
    ipv6Cidr string
    ipv6Enable boolean
    ipv6Gateway string
    ipv6SubnetId string
    region string
    subnetId string
    availabilityZone string
    cidr string
    gatewayIp string
    name string
    primaryDns string
    secondaryDns string
    status string
    vpcId string
    dhcpEnable Boolean
    dnsLists List<String>
    id String
    ipv4SubnetId String
    ipv6Cidr String
    ipv6Enable Boolean
    ipv6Gateway String
    ipv6SubnetId String
    region String
    subnetId String
    availabilityZone String
    cidr String
    gatewayIp String
    name String
    primaryDns String
    secondaryDns String
    status String
    vpcId String

    Package Details

    Repository
    flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
    License
    Notes
    This Pulumi package is based on the flexibleengine Terraform Provider.
    flexibleengine logo
    flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud