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

linode.InstanceIp

Explore with Pulumi AI

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

    Manages a Linode instance IP. For more information, see the Linode APIv4 docs.

    NOTICE: You may need to contact support to increase your instance IP limit before you can allocate additional IPs.

    NOTICE: This resource will reboot the specified instance following IP allocation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const foo = new linode.Instance("foo", {
        image: "linode/alpine3.19",
        label: "foobar-test",
        type: "g6-nanode-1",
        region: "us-east",
    });
    const fooInstanceIp = new linode.InstanceIp("foo", {
        linodeId: foo.id,
        "public": true,
    });
    
    import pulumi
    import pulumi_linode as linode
    
    foo = linode.Instance("foo",
        image="linode/alpine3.19",
        label="foobar-test",
        type="g6-nanode-1",
        region="us-east")
    foo_instance_ip = linode.InstanceIp("foo",
        linode_id=foo.id,
        public=True)
    
    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.NewInstance(ctx, "foo", &linode.InstanceArgs{
    			Image:  pulumi.String("linode/alpine3.19"),
    			Label:  pulumi.String("foobar-test"),
    			Type:   pulumi.String("g6-nanode-1"),
    			Region: pulumi.String("us-east"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = linode.NewInstanceIp(ctx, "foo", &linode.InstanceIpArgs{
    			LinodeId: foo.ID(),
    			Public:   pulumi.Bool(true),
    		})
    		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 foo = new Linode.Instance("foo", new()
        {
            Image = "linode/alpine3.19",
            Label = "foobar-test",
            Type = "g6-nanode-1",
            Region = "us-east",
        });
    
        var fooInstanceIp = new Linode.InstanceIp("foo", new()
        {
            LinodeId = foo.Id,
            Public = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.Instance;
    import com.pulumi.linode.InstanceArgs;
    import com.pulumi.linode.InstanceIp;
    import com.pulumi.linode.InstanceIpArgs;
    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 foo = new Instance("foo", InstanceArgs.builder()
                .image("linode/alpine3.19")
                .label("foobar-test")
                .type("g6-nanode-1")
                .region("us-east")
                .build());
    
            var fooInstanceIp = new InstanceIp("fooInstanceIp", InstanceIpArgs.builder()
                .linodeId(foo.id())
                .public_(true)
                .build());
    
        }
    }
    
    resources:
      foo:
        type: linode:Instance
        properties:
          image: linode/alpine3.19
          label: foobar-test
          type: g6-nanode-1
          region: us-east
      fooInstanceIp:
        type: linode:InstanceIp
        name: foo
        properties:
          linodeId: ${foo.id}
          public: true
    

    Create InstanceIp Resource

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

    Constructor syntax

    new InstanceIp(name: string, args: InstanceIpArgs, opts?: CustomResourceOptions);
    @overload
    def InstanceIp(resource_name: str,
                   args: InstanceIpArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def InstanceIp(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   linode_id: Optional[int] = None,
                   apply_immediately: Optional[bool] = None,
                   public: Optional[bool] = None,
                   rdns: Optional[str] = None)
    func NewInstanceIp(ctx *Context, name string, args InstanceIpArgs, opts ...ResourceOption) (*InstanceIp, error)
    public InstanceIp(string name, InstanceIpArgs args, CustomResourceOptions? opts = null)
    public InstanceIp(String name, InstanceIpArgs args)
    public InstanceIp(String name, InstanceIpArgs args, CustomResourceOptions options)
    
    type: linode:InstanceIp
    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 InstanceIpArgs
    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 InstanceIpArgs
    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 InstanceIpArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceIpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceIpArgs
    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 instanceIpResource = new Linode.InstanceIp("instanceIpResource", new()
    {
        LinodeId = 0,
        ApplyImmediately = false,
        Public = false,
        Rdns = "string",
    });
    
    example, err := linode.NewInstanceIp(ctx, "instanceIpResource", &linode.InstanceIpArgs{
    	LinodeId:         pulumi.Int(0),
    	ApplyImmediately: pulumi.Bool(false),
    	Public:           pulumi.Bool(false),
    	Rdns:             pulumi.String("string"),
    })
    
    var instanceIpResource = new InstanceIp("instanceIpResource", InstanceIpArgs.builder()
        .linodeId(0)
        .applyImmediately(false)
        .public_(false)
        .rdns("string")
        .build());
    
    instance_ip_resource = linode.InstanceIp("instanceIpResource",
        linode_id=0,
        apply_immediately=False,
        public=False,
        rdns="string")
    
    const instanceIpResource = new linode.InstanceIp("instanceIpResource", {
        linodeId: 0,
        applyImmediately: false,
        "public": false,
        rdns: "string",
    });
    
    type: linode:InstanceIp
    properties:
        applyImmediately: false
        linodeId: 0
        public: false
        rdns: string
    

    InstanceIp 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 InstanceIp resource accepts the following input properties:

    LinodeId int
    The ID of the Linode to allocate an IPv4 address for.
    ApplyImmediately bool
    If true, the instance will be rebooted to update network interfaces.
    Public bool
    Whether the IPv4 address is public or private. Defaults to true.
    Rdns string
    The reverse DNS assigned to this address.
    LinodeId int
    The ID of the Linode to allocate an IPv4 address for.
    ApplyImmediately bool
    If true, the instance will be rebooted to update network interfaces.
    Public bool
    Whether the IPv4 address is public or private. Defaults to true.
    Rdns string
    The reverse DNS assigned to this address.
    linodeId Integer
    The ID of the Linode to allocate an IPv4 address for.
    applyImmediately Boolean
    If true, the instance will be rebooted to update network interfaces.
    public_ Boolean
    Whether the IPv4 address is public or private. Defaults to true.
    rdns String
    The reverse DNS assigned to this address.
    linodeId number
    The ID of the Linode to allocate an IPv4 address for.
    applyImmediately boolean
    If true, the instance will be rebooted to update network interfaces.
    public boolean
    Whether the IPv4 address is public or private. Defaults to true.
    rdns string
    The reverse DNS assigned to this address.
    linode_id int
    The ID of the Linode to allocate an IPv4 address for.
    apply_immediately bool
    If true, the instance will be rebooted to update network interfaces.
    public bool
    Whether the IPv4 address is public or private. Defaults to true.
    rdns str
    The reverse DNS assigned to this address.
    linodeId Number
    The ID of the Linode to allocate an IPv4 address for.
    applyImmediately Boolean
    If true, the instance will be rebooted to update network interfaces.
    public Boolean
    Whether the IPv4 address is public or private. Defaults to true.
    rdns String
    The reverse DNS assigned to this address.

    Outputs

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

    Address string
    The resulting IPv4 address.
    Gateway string
    The default gateway for this address
    Id string
    The provider-assigned unique ID for this managed resource.
    Prefix int
    The number of bits set in the subnet mask.
    Region string
    The region this IP resides in.
    SubnetMask string
    The mask that separates host bits from network bits for this address.
    Type string
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    VpcNat11s List<InstanceIpVpcNat11>
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    Address string
    The resulting IPv4 address.
    Gateway string
    The default gateway for this address
    Id string
    The provider-assigned unique ID for this managed resource.
    Prefix int
    The number of bits set in the subnet mask.
    Region string
    The region this IP resides in.
    SubnetMask string
    The mask that separates host bits from network bits for this address.
    Type string
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    VpcNat11s []InstanceIpVpcNat11
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address String
    The resulting IPv4 address.
    gateway String
    The default gateway for this address
    id String
    The provider-assigned unique ID for this managed resource.
    prefix Integer
    The number of bits set in the subnet mask.
    region String
    The region this IP resides in.
    subnetMask String
    The mask that separates host bits from network bits for this address.
    type String
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpcNat11s List<InstanceIpVpcNat11>
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address string
    The resulting IPv4 address.
    gateway string
    The default gateway for this address
    id string
    The provider-assigned unique ID for this managed resource.
    prefix number
    The number of bits set in the subnet mask.
    region string
    The region this IP resides in.
    subnetMask string
    The mask that separates host bits from network bits for this address.
    type string
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpcNat11s InstanceIpVpcNat11[]
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address str
    The resulting IPv4 address.
    gateway str
    The default gateway for this address
    id str
    The provider-assigned unique ID for this managed resource.
    prefix int
    The number of bits set in the subnet mask.
    region str
    The region this IP resides in.
    subnet_mask str
    The mask that separates host bits from network bits for this address.
    type str
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpc_nat11s Sequence[InstanceIpVpcNat11]
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address String
    The resulting IPv4 address.
    gateway String
    The default gateway for this address
    id String
    The provider-assigned unique ID for this managed resource.
    prefix Number
    The number of bits set in the subnet mask.
    region String
    The region this IP resides in.
    subnetMask String
    The mask that separates host bits from network bits for this address.
    type String
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpcNat11s List<Property Map>
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.

    Look up Existing InstanceIp Resource

    Get an existing InstanceIp 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?: InstanceIpState, opts?: CustomResourceOptions): InstanceIp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            address: Optional[str] = None,
            apply_immediately: Optional[bool] = None,
            gateway: Optional[str] = None,
            linode_id: Optional[int] = None,
            prefix: Optional[int] = None,
            public: Optional[bool] = None,
            rdns: Optional[str] = None,
            region: Optional[str] = None,
            subnet_mask: Optional[str] = None,
            type: Optional[str] = None,
            vpc_nat11s: Optional[Sequence[InstanceIpVpcNat11Args]] = None) -> InstanceIp
    func GetInstanceIp(ctx *Context, name string, id IDInput, state *InstanceIpState, opts ...ResourceOption) (*InstanceIp, error)
    public static InstanceIp Get(string name, Input<string> id, InstanceIpState? state, CustomResourceOptions? opts = null)
    public static InstanceIp get(String name, Output<String> id, InstanceIpState 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:
    Address string
    The resulting IPv4 address.
    ApplyImmediately bool
    If true, the instance will be rebooted to update network interfaces.
    Gateway string
    The default gateway for this address
    LinodeId int
    The ID of the Linode to allocate an IPv4 address for.
    Prefix int
    The number of bits set in the subnet mask.
    Public bool
    Whether the IPv4 address is public or private. Defaults to true.
    Rdns string
    The reverse DNS assigned to this address.
    Region string
    The region this IP resides in.
    SubnetMask string
    The mask that separates host bits from network bits for this address.
    Type string
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    VpcNat11s List<InstanceIpVpcNat11>
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    Address string
    The resulting IPv4 address.
    ApplyImmediately bool
    If true, the instance will be rebooted to update network interfaces.
    Gateway string
    The default gateway for this address
    LinodeId int
    The ID of the Linode to allocate an IPv4 address for.
    Prefix int
    The number of bits set in the subnet mask.
    Public bool
    Whether the IPv4 address is public or private. Defaults to true.
    Rdns string
    The reverse DNS assigned to this address.
    Region string
    The region this IP resides in.
    SubnetMask string
    The mask that separates host bits from network bits for this address.
    Type string
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    VpcNat11s []InstanceIpVpcNat11Args
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address String
    The resulting IPv4 address.
    applyImmediately Boolean
    If true, the instance will be rebooted to update network interfaces.
    gateway String
    The default gateway for this address
    linodeId Integer
    The ID of the Linode to allocate an IPv4 address for.
    prefix Integer
    The number of bits set in the subnet mask.
    public_ Boolean
    Whether the IPv4 address is public or private. Defaults to true.
    rdns String
    The reverse DNS assigned to this address.
    region String
    The region this IP resides in.
    subnetMask String
    The mask that separates host bits from network bits for this address.
    type String
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpcNat11s List<InstanceIpVpcNat11>
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address string
    The resulting IPv4 address.
    applyImmediately boolean
    If true, the instance will be rebooted to update network interfaces.
    gateway string
    The default gateway for this address
    linodeId number
    The ID of the Linode to allocate an IPv4 address for.
    prefix number
    The number of bits set in the subnet mask.
    public boolean
    Whether the IPv4 address is public or private. Defaults to true.
    rdns string
    The reverse DNS assigned to this address.
    region string
    The region this IP resides in.
    subnetMask string
    The mask that separates host bits from network bits for this address.
    type string
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpcNat11s InstanceIpVpcNat11[]
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address str
    The resulting IPv4 address.
    apply_immediately bool
    If true, the instance will be rebooted to update network interfaces.
    gateway str
    The default gateway for this address
    linode_id int
    The ID of the Linode to allocate an IPv4 address for.
    prefix int
    The number of bits set in the subnet mask.
    public bool
    Whether the IPv4 address is public or private. Defaults to true.
    rdns str
    The reverse DNS assigned to this address.
    region str
    The region this IP resides in.
    subnet_mask str
    The mask that separates host bits from network bits for this address.
    type str
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpc_nat11s Sequence[InstanceIpVpcNat11Args]
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.
    address String
    The resulting IPv4 address.
    applyImmediately Boolean
    If true, the instance will be rebooted to update network interfaces.
    gateway String
    The default gateway for this address
    linodeId Number
    The ID of the Linode to allocate an IPv4 address for.
    prefix Number
    The number of bits set in the subnet mask.
    public Boolean
    Whether the IPv4 address is public or private. Defaults to true.
    rdns String
    The reverse DNS assigned to this address.
    region String
    The region this IP resides in.
    subnetMask String
    The mask that separates host bits from network bits for this address.
    type String
    The type of IP address. (ipv4, ipv6, ipv6/pool, ipv6/range)
    vpcNat11s List<Property Map>
    Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet.

    Supporting Types

    InstanceIpVpcNat11, InstanceIpVpcNat11Args

    Address string
    The resulting IPv4 address.
    SubnetId int
    VpcId int
    Address string
    The resulting IPv4 address.
    SubnetId int
    VpcId int
    address String
    The resulting IPv4 address.
    subnetId Integer
    vpcId Integer
    address string
    The resulting IPv4 address.
    subnetId number
    vpcId number
    address str
    The resulting IPv4 address.
    subnet_id int
    vpc_id int
    address String
    The resulting IPv4 address.
    subnetId Number
    vpcId Number

    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