1. Packages
  2. Nutanix
  3. API Docs
  4. getVpcsV2
Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg

nutanix.getVpcsV2

Explore with Pulumi AI

nutanix logo
Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg

    Provides a datasource to retrieve the list of existing VPCs.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pulumi/nutanix";
    
    const list_vpcs = nutanix.getVpcsV2({});
    const list_vpcs_with_filter = nutanix.getVpcsV2({
        filter: "vpcType eq 'VLAN'",
    });
    const list_vpcs_with_order_by_limit_filter = nutanix.getVpcsV2({
        filter: "vpcType eq 'VLAN'",
        limit: 10,
        orderBy: "name desc",
    });
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    list_vpcs = nutanix.get_vpcs_v2()
    list_vpcs_with_filter = nutanix.get_vpcs_v2(filter="vpcType eq 'VLAN'")
    list_vpcs_with_order_by_limit_filter = nutanix.get_vpcs_v2(filter="vpcType eq 'VLAN'",
        limit=10,
        order_by="name desc")
    
    package main
    
    import (
    	"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nutanix.GetVpcsV2(ctx, &nutanix.GetVpcsV2Args{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nutanix.GetVpcsV2(ctx, &nutanix.GetVpcsV2Args{
    			Filter: pulumi.StringRef("vpcType eq 'VLAN'"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nutanix.GetVpcsV2(ctx, &nutanix.GetVpcsV2Args{
    			Filter:  pulumi.StringRef("vpcType eq 'VLAN'"),
    			Limit:   pulumi.IntRef(10),
    			OrderBy: pulumi.StringRef("name desc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nutanix = Pulumi.Nutanix;
    
    return await Deployment.RunAsync(() => 
    {
        var list_vpcs = Nutanix.GetVpcsV2.Invoke();
    
        var list_vpcs_with_filter = Nutanix.GetVpcsV2.Invoke(new()
        {
            Filter = "vpcType eq 'VLAN'",
        });
    
        var list_vpcs_with_order_by_limit_filter = Nutanix.GetVpcsV2.Invoke(new()
        {
            Filter = "vpcType eq 'VLAN'",
            Limit = 10,
            OrderBy = "name desc",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nutanix.NutanixFunctions;
    import com.pulumi.nutanix.inputs.GetVpcsV2Args;
    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 list-vpcs = NutanixFunctions.getVpcsV2(GetVpcsV2Args.builder()
                .build());
    
            final var list-vpcs-with-filter = NutanixFunctions.getVpcsV2(GetVpcsV2Args.builder()
                .filter("vpcType eq 'VLAN'")
                .build());
    
            final var list-vpcs-with-order-by-limit-filter = NutanixFunctions.getVpcsV2(GetVpcsV2Args.builder()
                .filter("vpcType eq 'VLAN'")
                .limit(10)
                .orderBy("name desc")
                .build());
    
        }
    }
    
    variables:
      list-vpcs:
        fn::invoke:
          function: nutanix:getVpcsV2
          arguments: {}
      list-vpcs-with-filter:
        fn::invoke:
          function: nutanix:getVpcsV2
          arguments:
            filter: vpcType eq 'VLAN'
      list-vpcs-with-order-by-limit-filter:
        fn::invoke:
          function: nutanix:getVpcsV2
          arguments:
            filter: vpcType eq 'VLAN'
            limit: 10
            orderBy: name desc
    

    vpcs

    The vpcs object contains the following attributes:

    • ext_id: ext_id of VPC.
    • name: Name of the VPC.
    • description: Description of the VPC.
    • common_dhcp_options: List of DHCP options to be configured.
    • vpc_type: Type of VPC.
    • snat_ips: List of IP Addresses used for SNAT.
    • external_subnets: List of external subnets that the VPC is attached to.
    • external_routing_domain_reference: External routing domain associated with this route table
    • externally_routable_prefixes: CIDR blocks from the VPC which can talk externally without performing NAT. This is applicable when connecting to external subnets which have disabled NAT.
    • tenant_id: A globally unique identifier that represents the tenant that owns this entity.
    • links: A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource.
    • metadata: Metadata associated with this resource.

    common_dhcp_options

    • domain_name_servers: List of Domain Name Server addresses
    • domain_name_servers.ipv4: Reference to address configuration
    • domain_name_servers.ipv6: Reference to address configuration

    external_subnets

    • subnet_reference: External subnet reference.
    • external_ips: List of IP Addresses used for SNAT, if NAT is enabled on the external subnet. If NAT is not enabled, this specifies the IP address of the VPC port connected to the external gateway.
    • gateway_nodes: List of gateway nodes that can be used for external connectivity.
    • active_gateway_node: Reference of gateway nodes
    • active_gateway_count: Maximum number of active gateway nodes for the VPC external subnet association.

    snat_ips, external_ips

    • ipv4: Reference to address configuration
    • ipv6: Reference to address configuration

    externally_routable_prefixes

    • ipv4: IP V4 Configuration

    • ipv4.ip: Reference to address configuration

    • ipv4.prefix_length: The prefix length of the network

    • ipv6: IP V6 Configuration

    • ipv6.ip: Reference to address configuration

    • ipv6.prefix_length: The prefix length of the network

    ipv4, ipv6 (Reference to address configuration)

    • value: value of address
    • prefix_length: The prefix length of the network to which this host IPv4/IPv6 address belongs.

    See detailed information in Nutanix List VPC v4.

    Using getVpcsV2

    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 getVpcsV2(args: GetVpcsV2Args, opts?: InvokeOptions): Promise<GetVpcsV2Result>
    function getVpcsV2Output(args: GetVpcsV2OutputArgs, opts?: InvokeOptions): Output<GetVpcsV2Result>
    def get_vpcs_v2(filter: Optional[str] = None,
                    limit: Optional[int] = None,
                    order_by: Optional[str] = None,
                    page: Optional[int] = None,
                    select: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetVpcsV2Result
    def get_vpcs_v2_output(filter: Optional[pulumi.Input[str]] = None,
                    limit: Optional[pulumi.Input[int]] = None,
                    order_by: Optional[pulumi.Input[str]] = None,
                    page: Optional[pulumi.Input[int]] = None,
                    select: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetVpcsV2Result]
    func GetVpcsV2(ctx *Context, args *GetVpcsV2Args, opts ...InvokeOption) (*GetVpcsV2Result, error)
    func GetVpcsV2Output(ctx *Context, args *GetVpcsV2OutputArgs, opts ...InvokeOption) GetVpcsV2ResultOutput

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

    public static class GetVpcsV2 
    {
        public static Task<GetVpcsV2Result> InvokeAsync(GetVpcsV2Args args, InvokeOptions? opts = null)
        public static Output<GetVpcsV2Result> Invoke(GetVpcsV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcsV2Result> getVpcsV2(GetVpcsV2Args args, InvokeOptions options)
    public static Output<GetVpcsV2Result> getVpcsV2(GetVpcsV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: nutanix:index/getVpcsV2:getVpcsV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filter string
    A URL query parameter that allows clients to filter a collection of resources. The filter can be applied to the following fields:

    • extId
    Limit int
    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
    OrderBy string
    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. The orderby can be applied to the following fields:
    Page int
    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
    Select string
    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. The select can be applied to the following fields:
    Filter string
    A URL query parameter that allows clients to filter a collection of resources. The filter can be applied to the following fields:

    • extId
    Limit int
    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
    OrderBy string
    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. The orderby can be applied to the following fields:
    Page int
    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
    Select string
    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. The select can be applied to the following fields:
    filter String
    A URL query parameter that allows clients to filter a collection of resources. The filter can be applied to the following fields:

    • extId
    limit Integer
    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
    orderBy String
    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. The orderby can be applied to the following fields:
    page Integer
    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
    select String
    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. The select can be applied to the following fields:
    filter string
    A URL query parameter that allows clients to filter a collection of resources. The filter can be applied to the following fields:

    • extId
    limit number
    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
    orderBy string
    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. The orderby can be applied to the following fields:
    page number
    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
    select string
    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. The select can be applied to the following fields:
    filter str
    A URL query parameter that allows clients to filter a collection of resources. The filter can be applied to the following fields:

    • extId
    limit int
    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
    order_by str
    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. The orderby can be applied to the following fields:
    page int
    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
    select str
    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. The select can be applied to the following fields:
    filter String
    A URL query parameter that allows clients to filter a collection of resources. The filter can be applied to the following fields:

    • extId
    limit Number
    A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
    orderBy String
    A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. The orderby can be applied to the following fields:
    page Number
    A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
    select String
    A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. The select can be applied to the following fields:

    getVpcsV2 Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Vpcs List<PiersKarsenbarg.Nutanix.Outputs.GetVpcsV2Vpc>
    List of all existing VPCs.
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    Id string
    The provider-assigned unique ID for this managed resource.
    Vpcs []GetVpcsV2Vpc
    List of all existing VPCs.
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    id String
    The provider-assigned unique ID for this managed resource.
    vpcs List<GetVpcsV2Vpc>
    List of all existing VPCs.
    filter String
    limit Integer
    orderBy String
    page Integer
    select String
    id string
    The provider-assigned unique ID for this managed resource.
    vpcs GetVpcsV2Vpc[]
    List of all existing VPCs.
    filter string
    limit number
    orderBy string
    page number
    select string
    id str
    The provider-assigned unique ID for this managed resource.
    vpcs Sequence[GetVpcsV2Vpc]
    List of all existing VPCs.
    filter str
    limit int
    order_by str
    page int
    select str
    id String
    The provider-assigned unique ID for this managed resource.
    vpcs List<Property Map>
    List of all existing VPCs.
    filter String
    limit Number
    orderBy String
    page Number
    select String

    Supporting Types

    GetVpcsV2Vpc

    GetVpcsV2VpcCommonDhcpOption

    GetVpcsV2VpcCommonDhcpOptionDomainNameServer

    GetVpcsV2VpcCommonDhcpOptionDomainNameServerIpv4

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcCommonDhcpOptionDomainNameServerIpv6

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcExternalSubnet

    GetVpcsV2VpcExternalSubnetActiveGatewayNode

    GetVpcsV2VpcExternalSubnetActiveGatewayNodeNodeIpAddress

    GetVpcsV2VpcExternalSubnetActiveGatewayNodeNodeIpAddressIpv4

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcExternalSubnetActiveGatewayNodeNodeIpAddressIpv6

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcExternalSubnetExternalIp

    GetVpcsV2VpcExternalSubnetExternalIpIpv4

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcExternalSubnetExternalIpIpv6

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcExternallyRoutablePrefix

    GetVpcsV2VpcExternallyRoutablePrefixIpv4

    GetVpcsV2VpcExternallyRoutablePrefixIpv4Ip

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcExternallyRoutablePrefixIpv6

    GetVpcsV2VpcExternallyRoutablePrefixIpv6Ip

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String
    Href string
    Rel string
    Href string
    Rel string
    href String
    rel String
    href string
    rel string
    href str
    rel str
    href String
    rel String

    GetVpcsV2VpcMetadata

    CategoryIds List<ImmutableArray<object>>
    OwnerReferenceId string
    OwnerUserName string
    ProjectName string
    ProjectReferenceId string
    categoryIds List<List<Object>>
    ownerReferenceId String
    ownerUserName String
    projectName String
    projectReferenceId String

    GetVpcsV2VpcSnatIp

    GetVpcsV2VpcSnatIpIpv4

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    GetVpcsV2VpcSnatIpIpv6

    prefixLength Integer
    value String
    prefixLength number
    value string
    prefixLength Number
    value String

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg