Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi
linode.getVpcSubnet
Explore with Pulumi AI
Provides information about a Linode VPC subnet. For more information, see the Linode APIv4 docs.
Example Usage
The following example shows how one might use this data source to access information about a Linode VPC subnet.
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const foo = linode.getVpcSubnet({
    vpcId: 123,
    id: "12345",
});
export const vpcSubnet = foo;
import pulumi
import pulumi_linode as linode
foo = linode.get_vpc_subnet(vpc_id=123,
    id="12345")
pulumi.export("vpcSubnet", foo)
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 {
		foo, err := linode.LookupVpcSubnet(ctx, &linode.LookupVpcSubnetArgs{
			VpcId: 123,
			Id:    "12345",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("vpcSubnet", foo)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;
return await Deployment.RunAsync(() => 
{
    var foo = Linode.GetVpcSubnet.Invoke(new()
    {
        VpcId = 123,
        Id = "12345",
    });
    return new Dictionary<string, object?>
    {
        ["vpcSubnet"] = foo,
    };
});
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.GetVpcSubnetArgs;
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 foo = LinodeFunctions.getVpcSubnet(GetVpcSubnetArgs.builder()
            .vpcId(123)
            .id(12345)
            .build());
        ctx.export("vpcSubnet", foo.applyValue(getVpcSubnetResult -> getVpcSubnetResult));
    }
}
variables:
  foo:
    fn::invoke:
      Function: linode:getVpcSubnet
      Arguments:
        vpcId: 123
        id: 12345
outputs:
  vpcSubnet: ${foo}
Using getVpcSubnet
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 getVpcSubnet(args: GetVpcSubnetArgs, opts?: InvokeOptions): Promise<GetVpcSubnetResult>
function getVpcSubnetOutput(args: GetVpcSubnetOutputArgs, opts?: InvokeOptions): Output<GetVpcSubnetResult>def get_vpc_subnet(id: Optional[str] = None,
                   vpc_id: Optional[int] = None,
                   opts: Optional[InvokeOptions] = None) -> GetVpcSubnetResult
def get_vpc_subnet_output(id: Optional[pulumi.Input[str]] = None,
                   vpc_id: Optional[pulumi.Input[int]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetVpcSubnetResult]func LookupVpcSubnet(ctx *Context, args *LookupVpcSubnetArgs, opts ...InvokeOption) (*LookupVpcSubnetResult, error)
func LookupVpcSubnetOutput(ctx *Context, args *LookupVpcSubnetOutputArgs, opts ...InvokeOption) LookupVpcSubnetResultOutput> Note: This function is named LookupVpcSubnet in the Go SDK.
public static class GetVpcSubnet 
{
    public static Task<GetVpcSubnetResult> InvokeAsync(GetVpcSubnetArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcSubnetResult> Invoke(GetVpcSubnetInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcSubnetResult> getVpcSubnet(GetVpcSubnetArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: linode:index/getVpcSubnet:getVpcSubnet
  arguments:
    # arguments dictionaryThe following arguments are supported:
getVpcSubnet Result
The following output properties are available:
- Created string
 - The date and time when the VPC Subnet was created.
 - Id string
 - Ipv4 string
 - The IPv4 range of this subnet in CIDR format.
 - Label string
 - The label of the VPC subnet.
 - Linodes
List<Get
Vpc Subnet Linode>  - A list of Linode IDs that added to this subnet.
 - Updated string
 - The date and time when the VPC Subnet was last updated.
 - Vpc
Id int 
- Created string
 - The date and time when the VPC Subnet was created.
 - Id string
 - Ipv4 string
 - The IPv4 range of this subnet in CIDR format.
 - Label string
 - The label of the VPC subnet.
 - Linodes
[]Get
Vpc Subnet Linode  - A list of Linode IDs that added to this subnet.
 - Updated string
 - The date and time when the VPC Subnet was last updated.
 - Vpc
Id int 
- created String
 - The date and time when the VPC Subnet was created.
 - id String
 - ipv4 String
 - The IPv4 range of this subnet in CIDR format.
 - label String
 - The label of the VPC subnet.
 - linodes
List<Get
Vpc Subnet Linode>  - A list of Linode IDs that added to this subnet.
 - updated String
 - The date and time when the VPC Subnet was last updated.
 - vpc
Id Integer 
- created string
 - The date and time when the VPC Subnet was created.
 - id string
 - ipv4 string
 - The IPv4 range of this subnet in CIDR format.
 - label string
 - The label of the VPC subnet.
 - linodes
Get
Vpc Subnet Linode[]  - A list of Linode IDs that added to this subnet.
 - updated string
 - The date and time when the VPC Subnet was last updated.
 - vpc
Id number 
- created str
 - The date and time when the VPC Subnet was created.
 - id str
 - ipv4 str
 - The IPv4 range of this subnet in CIDR format.
 - label str
 - The label of the VPC subnet.
 - linodes
Sequence[Get
Vpc Subnet Linode]  - A list of Linode IDs that added to this subnet.
 - updated str
 - The date and time when the VPC Subnet was last updated.
 - vpc_
id int 
- created String
 - The date and time when the VPC Subnet was created.
 - id String
 - ipv4 String
 - The IPv4 range of this subnet in CIDR format.
 - label String
 - The label of the VPC subnet.
 - linodes List<Property Map>
 - A list of Linode IDs that added to this subnet.
 - updated String
 - The date and time when the VPC Subnet was last updated.
 - vpc
Id Number 
Supporting Types
GetVpcSubnetLinode   
- Id int
 - The unique id of this VPC subnet.
 - Interfaces
List<Get
Vpc Subnet Linode Interface>  
- Id int
 - The unique id of this VPC subnet.
 - Interfaces
[]Get
Vpc Subnet Linode Interface  
- id Integer
 - The unique id of this VPC subnet.
 - interfaces
List<Get
Vpc Subnet Linode Interface>  
- id number
 - The unique id of this VPC subnet.
 - interfaces
Get
Vpc Subnet Linode Interface[]  
- id int
 - The unique id of this VPC subnet.
 - interfaces
Sequence[Get
Vpc Subnet Linode Interface]  
- id Number
 - The unique id of this VPC subnet.
 - interfaces List<Property Map>
 
GetVpcSubnetLinodeInterface    
Package Details
- Repository
 - Linode pulumi/pulumi-linode
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
linodeTerraform Provider.