1. Packages
  2. Linode Provider
  3. API Docs
  4. getVpcIps
Linode v4.30.1 published on Thursday, Nov 21, 2024 by Pulumi

linode.getVpcIps

Explore with Pulumi AI

linode logo
Linode v4.30.1 published on Thursday, Nov 21, 2024 by Pulumi

    Provides information about a list of Linode VPC IPs that match a set of filters. For more information, see the Linode APIv4 docs.

    Provides information about a list of Linode VPC IPs in a specific VPC that match a set of filters. For more information, see the Linode APIv4 docs.

    Example Usage

    The following example shows how one might use this data source to list VPC IPs.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const filtered-ips = linode.getVpcIps({
        filters: [{
            name: "address",
            values: ["10.0.0.0"],
        }],
    });
    export const vpcIps = filtered_ips.then(filtered_ips => filtered_ips.vpcIps);
    
    import pulumi
    import pulumi_linode as linode
    
    filtered_ips = linode.get_vpc_ips(filters=[{
        "name": "address",
        "values": ["10.0.0.0"],
    }])
    pulumi.export("vpcIps", filtered_ips.vpc_ips)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		filtered_ips, err := linode.GetVpcIps(ctx, &linode.GetVpcIpsArgs{
    			Filters: []linode.GetVpcIpsFilter{
    				{
    					Name: "address",
    					Values: []string{
    						"10.0.0.0",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcIps", filtered_ips.VpcIps)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered_ips = Linode.GetVpcIps.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetVpcIpsFilterInputArgs
                {
                    Name = "address",
                    Values = new[]
                    {
                        "10.0.0.0",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["vpcIps"] = filtered_ips.Apply(filtered_ips => filtered_ips.Apply(getVpcIpsResult => getVpcIpsResult.VpcIps)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetVpcIpsArgs;
    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 filtered-ips = LinodeFunctions.getVpcIps(GetVpcIpsArgs.builder()
                .filters(GetVpcIpsFilterArgs.builder()
                    .name("address")
                    .values("10.0.0.0")
                    .build())
                .build());
    
            ctx.export("vpcIps", filtered_ips.vpcIps());
        }
    }
    
    variables:
      filtered-ips:
        fn::invoke:
          Function: linode:getVpcIps
          Arguments:
            filters:
              - name: address
                values:
                  - 10.0.0.0
    outputs:
      vpcIps: ${["filtered-ips"].vpcIps}
    

    One might also use this data source to list all VPC IPs in a specific VPC. The following example shows how to do this.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const specific-vpc-ips = linode.getVpcIps({
        vpcId: 123,
    });
    export const vpcIps = specific_vpc_ips.then(specific_vpc_ips => specific_vpc_ips.vpcIps);
    
    import pulumi
    import pulumi_linode as linode
    
    specific_vpc_ips = linode.get_vpc_ips(vpc_id=123)
    pulumi.export("vpcIps", specific_vpc_ips.vpc_ips)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		specific_vpc_ips, err := linode.GetVpcIps(ctx, &linode.GetVpcIpsArgs{
    			VpcId: pulumi.IntRef(123),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcIps", specific_vpc_ips.VpcIps)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var specific_vpc_ips = Linode.GetVpcIps.Invoke(new()
        {
            VpcId = 123,
        });
    
        return new Dictionary<string, object?>
        {
            ["vpcIps"] = specific_vpc_ips.Apply(specific_vpc_ips => specific_vpc_ips.Apply(getVpcIpsResult => getVpcIpsResult.VpcIps)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetVpcIpsArgs;
    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 specific-vpc-ips = LinodeFunctions.getVpcIps(GetVpcIpsArgs.builder()
                .vpcId(123)
                .build());
    
            ctx.export("vpcIps", specific_vpc_ips.vpcIps());
        }
    }
    
    variables:
      specific-vpc-ips:
        fn::invoke:
          Function: linode:getVpcIps
          Arguments:
            vpcId: 123
    outputs:
      vpcIps: ${["specific-vpc-ips"].vpcIps}
    

    Filterable Fields

    • active

    • config_id

    • linode_id

    • region

    • vpc_id

    Using getVpcIps

    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 getVpcIps(args: GetVpcIpsArgs, opts?: InvokeOptions): Promise<GetVpcIpsResult>
    function getVpcIpsOutput(args: GetVpcIpsOutputArgs, opts?: InvokeOptions): Output<GetVpcIpsResult>
    def get_vpc_ips(filters: Optional[Sequence[GetVpcIpsFilter]] = None,
                    vpc_id: Optional[int] = None,
                    vpc_ips: Optional[Sequence[GetVpcIpsVpcIp]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetVpcIpsResult
    def get_vpc_ips_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcIpsFilterArgs]]]] = None,
                    vpc_id: Optional[pulumi.Input[int]] = None,
                    vpc_ips: Optional[pulumi.Input[Sequence[pulumi.Input[GetVpcIpsVpcIpArgs]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetVpcIpsResult]
    func GetVpcIps(ctx *Context, args *GetVpcIpsArgs, opts ...InvokeOption) (*GetVpcIpsResult, error)
    func GetVpcIpsOutput(ctx *Context, args *GetVpcIpsOutputArgs, opts ...InvokeOption) GetVpcIpsResultOutput

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

    public static class GetVpcIps 
    {
        public static Task<GetVpcIpsResult> InvokeAsync(GetVpcIpsArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcIpsResult> Invoke(GetVpcIpsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcIpsResult> getVpcIps(GetVpcIpsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getVpcIps:getVpcIps
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetVpcIpsFilter>
    VpcId int
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    VpcIps List<GetVpcIpsVpcIp>
    Filters []GetVpcIpsFilter
    VpcId int
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    VpcIps []GetVpcIpsVpcIp
    filters List<GetVpcIpsFilter>
    vpcId Integer
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    vpcIps List<GetVpcIpsVpcIp>
    filters GetVpcIpsFilter[]
    vpcId number
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    vpcIps GetVpcIpsVpcIp[]
    filters Sequence[GetVpcIpsFilter]
    vpc_id int
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    vpc_ips Sequence[GetVpcIpsVpcIp]
    filters List<Property Map>
    vpcId Number
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    vpcIps List<Property Map>

    getVpcIps Result

    The following output properties are available:

    Id string
    Filters List<GetVpcIpsFilter>
    VpcId int
    The unique globally general API entity identifier for the VPC.
    VpcIps List<GetVpcIpsVpcIp>
    Id string
    Filters []GetVpcIpsFilter
    VpcId int
    The unique globally general API entity identifier for the VPC.
    VpcIps []GetVpcIpsVpcIp
    id String
    filters List<GetVpcIpsFilter>
    vpcId Integer
    The unique globally general API entity identifier for the VPC.
    vpcIps List<GetVpcIpsVpcIp>
    id string
    filters GetVpcIpsFilter[]
    vpcId number
    The unique globally general API entity identifier for the VPC.
    vpcIps GetVpcIpsVpcIp[]
    id str
    filters Sequence[GetVpcIpsFilter]
    vpc_id int
    The unique globally general API entity identifier for the VPC.
    vpc_ips Sequence[GetVpcIpsVpcIp]
    id String
    filters List<Property Map>
    vpcId Number
    The unique globally general API entity identifier for the VPC.
    vpcIps List<Property Map>

    Supporting Types

    GetVpcIpsFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetVpcIpsVpcIp

    Active bool
    True if the VPC interface is in use, meaning that the Linode was powered on using the config_id to which the interface belongs. Otherwise false.
    Address string
    An IPv4 address configured for this VPC interface. These follow the RFC 1918 private address format. Null if an address_range.
    AddressRange string
    A range of IPv4 addresses configured for this VPC interface. Null if a single address.
    ConfigId int
    The globally general entity identifier for the Linode configuration profile where the VPC is included.
    Gateway string
    The default gateway for the VPC subnet that the IP or IP range belongs to.
    InterfaceId int
    The globally general API entity identifier for the Linode interface.
    LinodeId int
    The identifier for the Linode the VPC interface currently belongs to.
    Nat11 string
    The public IP address used for NAT 1:1 with the VPC. This is empty if NAT 1:1 isn't used.
    Prefix int
    The number of bits set in the subnet mask.
    Region string
    The region of the VPC.
    SubnetId int
    The id of the VPC Subnet for this interface.
    SubnetMask string
    The mask that separates host bits from network bits for the address or address_range.
    VpcId int
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    Active bool
    True if the VPC interface is in use, meaning that the Linode was powered on using the config_id to which the interface belongs. Otherwise false.
    Address string
    An IPv4 address configured for this VPC interface. These follow the RFC 1918 private address format. Null if an address_range.
    AddressRange string
    A range of IPv4 addresses configured for this VPC interface. Null if a single address.
    ConfigId int
    The globally general entity identifier for the Linode configuration profile where the VPC is included.
    Gateway string
    The default gateway for the VPC subnet that the IP or IP range belongs to.
    InterfaceId int
    The globally general API entity identifier for the Linode interface.
    LinodeId int
    The identifier for the Linode the VPC interface currently belongs to.
    Nat11 string
    The public IP address used for NAT 1:1 with the VPC. This is empty if NAT 1:1 isn't used.
    Prefix int
    The number of bits set in the subnet mask.
    Region string
    The region of the VPC.
    SubnetId int
    The id of the VPC Subnet for this interface.
    SubnetMask string
    The mask that separates host bits from network bits for the address or address_range.
    VpcId int
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    active Boolean
    True if the VPC interface is in use, meaning that the Linode was powered on using the config_id to which the interface belongs. Otherwise false.
    address String
    An IPv4 address configured for this VPC interface. These follow the RFC 1918 private address format. Null if an address_range.
    addressRange String
    A range of IPv4 addresses configured for this VPC interface. Null if a single address.
    configId Integer
    The globally general entity identifier for the Linode configuration profile where the VPC is included.
    gateway String
    The default gateway for the VPC subnet that the IP or IP range belongs to.
    interfaceId Integer
    The globally general API entity identifier for the Linode interface.
    linodeId Integer
    The identifier for the Linode the VPC interface currently belongs to.
    nat11 String
    The public IP address used for NAT 1:1 with the VPC. This is empty if NAT 1:1 isn't used.
    prefix Integer
    The number of bits set in the subnet mask.
    region String
    The region of the VPC.
    subnetId Integer
    The id of the VPC Subnet for this interface.
    subnetMask String
    The mask that separates host bits from network bits for the address or address_range.
    vpcId Integer
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    active boolean
    True if the VPC interface is in use, meaning that the Linode was powered on using the config_id to which the interface belongs. Otherwise false.
    address string
    An IPv4 address configured for this VPC interface. These follow the RFC 1918 private address format. Null if an address_range.
    addressRange string
    A range of IPv4 addresses configured for this VPC interface. Null if a single address.
    configId number
    The globally general entity identifier for the Linode configuration profile where the VPC is included.
    gateway string
    The default gateway for the VPC subnet that the IP or IP range belongs to.
    interfaceId number
    The globally general API entity identifier for the Linode interface.
    linodeId number
    The identifier for the Linode the VPC interface currently belongs to.
    nat11 string
    The public IP address used for NAT 1:1 with the VPC. This is empty if NAT 1:1 isn't used.
    prefix number
    The number of bits set in the subnet mask.
    region string
    The region of the VPC.
    subnetId number
    The id of the VPC Subnet for this interface.
    subnetMask string
    The mask that separates host bits from network bits for the address or address_range.
    vpcId number
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    active bool
    True if the VPC interface is in use, meaning that the Linode was powered on using the config_id to which the interface belongs. Otherwise false.
    address str
    An IPv4 address configured for this VPC interface. These follow the RFC 1918 private address format. Null if an address_range.
    address_range str
    A range of IPv4 addresses configured for this VPC interface. Null if a single address.
    config_id int
    The globally general entity identifier for the Linode configuration profile where the VPC is included.
    gateway str
    The default gateway for the VPC subnet that the IP or IP range belongs to.
    interface_id int
    The globally general API entity identifier for the Linode interface.
    linode_id int
    The identifier for the Linode the VPC interface currently belongs to.
    nat11 str
    The public IP address used for NAT 1:1 with the VPC. This is empty if NAT 1:1 isn't used.
    prefix int
    The number of bits set in the subnet mask.
    region str
    The region of the VPC.
    subnet_id int
    The id of the VPC Subnet for this interface.
    subnet_mask str
    The mask that separates host bits from network bits for the address or address_range.
    vpc_id int
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.
    active Boolean
    True if the VPC interface is in use, meaning that the Linode was powered on using the config_id to which the interface belongs. Otherwise false.
    address String
    An IPv4 address configured for this VPC interface. These follow the RFC 1918 private address format. Null if an address_range.
    addressRange String
    A range of IPv4 addresses configured for this VPC interface. Null if a single address.
    configId Number
    The globally general entity identifier for the Linode configuration profile where the VPC is included.
    gateway String
    The default gateway for the VPC subnet that the IP or IP range belongs to.
    interfaceId Number
    The globally general API entity identifier for the Linode interface.
    linodeId Number
    The identifier for the Linode the VPC interface currently belongs to.
    nat11 String
    The public IP address used for NAT 1:1 with the VPC. This is empty if NAT 1:1 isn't used.
    prefix Number
    The number of bits set in the subnet mask.
    region String
    The region of the VPC.
    subnetId Number
    The id of the VPC Subnet for this interface.
    subnetMask String
    The mask that separates host bits from network bits for the address or address_range.
    vpcId Number
    The id of the parent VPC for the list of VPC IPs.

    • filter - (Optional) A set of filters used to select Linode VPC IPs that meet certain requirements.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.30.1 published on Thursday, Nov 21, 2024 by Pulumi