1. Packages
  2. Linode Provider
  3. API Docs
  4. VpcSubnet
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

linode.VpcSubnet

Explore with Pulumi AI

linode logo
Linode v4.30.0 published on Friday, Nov 8, 2024 by Pulumi

    Manages a Linode VPC subnet. For more information, see the Linode APIv4 docs.

    Example Usage

    Create a VPC subnet:

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const test = new linode.VpcSubnet("test", {
        vpcId: 123,
        label: "test-subnet",
        ipv4: "10.0.0.0/24",
    });
    
    import pulumi
    import pulumi_linode as linode
    
    test = linode.VpcSubnet("test",
        vpc_id=123,
        label="test-subnet",
        ipv4="10.0.0.0/24")
    
    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 {
    		_, err := linode.NewVpcSubnet(ctx, "test", &linode.VpcSubnetArgs{
    			VpcId: pulumi.Int(123),
    			Label: pulumi.String("test-subnet"),
    			Ipv4:  pulumi.String("10.0.0.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Linode.VpcSubnet("test", new()
        {
            VpcId = 123,
            Label = "test-subnet",
            Ipv4 = "10.0.0.0/24",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.VpcSubnet;
    import com.pulumi.linode.VpcSubnetArgs;
    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) {
            var test = new VpcSubnet("test", VpcSubnetArgs.builder()
                .vpcId(123)
                .label("test-subnet")
                .ipv4("10.0.0.0/24")
                .build());
    
        }
    }
    
    resources:
      test:
        type: linode:VpcSubnet
        properties:
          vpcId: 123
          label: test-subnet
          ipv4: 10.0.0.0/24
    

    Create VpcSubnet Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpcSubnet(name: string, args: VpcSubnetArgs, opts?: CustomResourceOptions);
    @overload
    def VpcSubnet(resource_name: str,
                  args: VpcSubnetArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcSubnet(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  ipv4: Optional[str] = None,
                  label: Optional[str] = None,
                  vpc_id: Optional[int] = None)
    func NewVpcSubnet(ctx *Context, name string, args VpcSubnetArgs, opts ...ResourceOption) (*VpcSubnet, error)
    public VpcSubnet(string name, VpcSubnetArgs args, CustomResourceOptions? opts = null)
    public VpcSubnet(String name, VpcSubnetArgs args)
    public VpcSubnet(String name, VpcSubnetArgs args, CustomResourceOptions options)
    
    type: linode:VpcSubnet
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpcSubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VpcSubnetArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VpcSubnetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcSubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcSubnetArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var vpcSubnetResource = new Linode.VpcSubnet("vpcSubnetResource", new()
    {
        Ipv4 = "string",
        Label = "string",
        VpcId = 0,
    });
    
    example, err := linode.NewVpcSubnet(ctx, "vpcSubnetResource", &linode.VpcSubnetArgs{
    	Ipv4:  pulumi.String("string"),
    	Label: pulumi.String("string"),
    	VpcId: pulumi.Int(0),
    })
    
    var vpcSubnetResource = new VpcSubnet("vpcSubnetResource", VpcSubnetArgs.builder()
        .ipv4("string")
        .label("string")
        .vpcId(0)
        .build());
    
    vpc_subnet_resource = linode.VpcSubnet("vpcSubnetResource",
        ipv4="string",
        label="string",
        vpc_id=0)
    
    const vpcSubnetResource = new linode.VpcSubnet("vpcSubnetResource", {
        ipv4: "string",
        label: "string",
        vpcId: 0,
    });
    
    type: linode:VpcSubnet
    properties:
        ipv4: string
        label: string
        vpcId: 0
    

    VpcSubnet Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VpcSubnet resource accepts the following input properties:

    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Label string
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    VpcId int
    The id of the parent VPC for this VPC Subnet.
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Label string
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    VpcId int
    The id of the parent VPC for this VPC Subnet.
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    label String
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    vpcId Integer
    The id of the parent VPC for this VPC Subnet.
    ipv4 string
    The IPv4 range of this subnet in CIDR format.
    label string
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    vpcId number
    The id of the parent VPC for this VPC Subnet.
    ipv4 str
    The IPv4 range of this subnet in CIDR format.
    label str
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    vpc_id int
    The id of the parent VPC for this VPC Subnet.
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    label String
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    vpcId Number
    The id of the parent VPC for this VPC Subnet.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcSubnet resource produces the following output properties:

    Created string
    The date and time when the VPC was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Linodes List<VpcSubnetLinode>
    A list of Linode IDs that added to this subnet.
    Updated string
    The date and time when the VPC was last updated.
    Created string
    The date and time when the VPC was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    Linodes []VpcSubnetLinode
    A list of Linode IDs that added to this subnet.
    Updated string
    The date and time when the VPC was last updated.
    created String
    The date and time when the VPC was created.
    id String
    The provider-assigned unique ID for this managed resource.
    linodes List<VpcSubnetLinode>
    A list of Linode IDs that added to this subnet.
    updated String
    The date and time when the VPC was last updated.
    created string
    The date and time when the VPC was created.
    id string
    The provider-assigned unique ID for this managed resource.
    linodes VpcSubnetLinode[]
    A list of Linode IDs that added to this subnet.
    updated string
    The date and time when the VPC was last updated.
    created str
    The date and time when the VPC was created.
    id str
    The provider-assigned unique ID for this managed resource.
    linodes Sequence[VpcSubnetLinode]
    A list of Linode IDs that added to this subnet.
    updated str
    The date and time when the VPC was last updated.
    created String
    The date and time when the VPC was created.
    id String
    The provider-assigned unique ID for this managed resource.
    linodes List<Property Map>
    A list of Linode IDs that added to this subnet.
    updated String
    The date and time when the VPC was last updated.

    Look up Existing VpcSubnet Resource

    Get an existing VpcSubnet resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VpcSubnetState, opts?: CustomResourceOptions): VpcSubnet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created: Optional[str] = None,
            ipv4: Optional[str] = None,
            label: Optional[str] = None,
            linodes: Optional[Sequence[VpcSubnetLinodeArgs]] = None,
            updated: Optional[str] = None,
            vpc_id: Optional[int] = None) -> VpcSubnet
    func GetVpcSubnet(ctx *Context, name string, id IDInput, state *VpcSubnetState, opts ...ResourceOption) (*VpcSubnet, error)
    public static VpcSubnet Get(string name, Input<string> id, VpcSubnetState? state, CustomResourceOptions? opts = null)
    public static VpcSubnet get(String name, Output<String> id, VpcSubnetState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Created string
    The date and time when the VPC was created.
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Label string
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    Linodes List<VpcSubnetLinode>
    A list of Linode IDs that added to this subnet.
    Updated string
    The date and time when the VPC was last updated.
    VpcId int
    The id of the parent VPC for this VPC Subnet.
    Created string
    The date and time when the VPC was created.
    Ipv4 string
    The IPv4 range of this subnet in CIDR format.
    Label string
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    Linodes []VpcSubnetLinodeArgs
    A list of Linode IDs that added to this subnet.
    Updated string
    The date and time when the VPC was last updated.
    VpcId int
    The id of the parent VPC for this VPC Subnet.
    created String
    The date and time when the VPC was created.
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    label String
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    linodes List<VpcSubnetLinode>
    A list of Linode IDs that added to this subnet.
    updated String
    The date and time when the VPC was last updated.
    vpcId Integer
    The id of the parent VPC for this VPC Subnet.
    created string
    The date and time when the VPC was created.
    ipv4 string
    The IPv4 range of this subnet in CIDR format.
    label string
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    linodes VpcSubnetLinode[]
    A list of Linode IDs that added to this subnet.
    updated string
    The date and time when the VPC was last updated.
    vpcId number
    The id of the parent VPC for this VPC Subnet.
    created str
    The date and time when the VPC was created.
    ipv4 str
    The IPv4 range of this subnet in CIDR format.
    label str
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    linodes Sequence[VpcSubnetLinodeArgs]
    A list of Linode IDs that added to this subnet.
    updated str
    The date and time when the VPC was last updated.
    vpc_id int
    The id of the parent VPC for this VPC Subnet.
    created String
    The date and time when the VPC was created.
    ipv4 String
    The IPv4 range of this subnet in CIDR format.
    label String
    The label of the VPC. Only contains ASCII letters, digits and dashes.
    linodes List<Property Map>
    A list of Linode IDs that added to this subnet.
    updated String
    The date and time when the VPC was last updated.
    vpcId Number
    The id of the parent VPC for this VPC Subnet.

    Supporting Types

    VpcSubnetLinode, VpcSubnetLinodeArgs

    Id int
    The ID of the VPC Subnet.
    Interfaces List<VpcSubnetLinodeInterface>
    Id int
    The ID of the VPC Subnet.
    Interfaces []VpcSubnetLinodeInterface
    id Integer
    The ID of the VPC Subnet.
    interfaces List<VpcSubnetLinodeInterface>
    id number
    The ID of the VPC Subnet.
    interfaces VpcSubnetLinodeInterface[]
    id Number
    The ID of the VPC Subnet.
    interfaces List<Property Map>

    VpcSubnetLinodeInterface, VpcSubnetLinodeInterfaceArgs

    Active bool
    Id int
    The ID of the VPC Subnet.
    Active bool
    Id int
    The ID of the VPC Subnet.
    active Boolean
    id Integer
    The ID of the VPC Subnet.
    active boolean
    id number
    The ID of the VPC Subnet.
    active bool
    id int
    The ID of the VPC Subnet.
    active Boolean
    id Number
    The ID of the VPC Subnet.

    Import

    Linode Virtual Private Cloud (VPC) Subnet can be imported using the vpc_id followed by the subnet id separated by a comma, e.g.

    $ pulumi import linode:index/vpcSubnet:VpcSubnet my_subnet_duplicated 1234567,7654321
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.0 published on Friday, Nov 8, 2024 by Pulumi