Class Instance
Provides a Linode Instance resource. This can be used to create, modify, and delete Linodes. For more information, see Getting Started with Linode and the Linode APIv4 docs.
Example Usage
Simple Linode Instance
using Pulumi;
using Linode = Pulumi.Linode;
class MyStack : Stack
{
public MyStack()
{
var web = new Linode.Instance("web", new Linode.InstanceArgs
{
AuthorizedKeys =
{
"ssh-rsa AAAA...Gw== user@example.local",
},
Group = "foo",
Image = "linode/ubuntu18.04",
Label = "simple_instance",
PrivateIp = true,
Region = "us-central",
RootPass = "terr4form-test",
SwapSize = 256,
Tags =
{
"foo",
},
Type = "g6-standard-1",
});
}
}
Linode Instance with explicit Configs and Disks
using Pulumi;
using Linode = Pulumi.Linode;
class MyStack : Stack
{
public MyStack()
{
var me = Output.Create(Linode.GetProfile.InvokeAsync());
var webVolume = new Linode.Volume("webVolume", new Linode.VolumeArgs
{
Label = "web_volume",
Region = "us-central",
Size = 20,
});
var web = new Linode.Instance("web", new Linode.InstanceArgs
{
BootConfigLabel = "boot_config",
Configs =
{
new Linode.Inputs.InstanceConfigArgs
{
Devices = new Linode.Inputs.InstanceConfigDevicesArgs
{
Sda = new Linode.Inputs.InstanceConfigDevicesSdaArgs
{
DiskLabel = "boot",
},
Sdb = new Linode.Inputs.InstanceConfigDevicesSdbArgs
{
VolumeId = webVolume.Id,
},
},
Kernel = "linode/latest-64bit",
Label = "boot_config",
RootDevice = "/dev/sda",
},
},
Disks =
{
new Linode.Inputs.InstanceDiskArgs
{
AuthorizedKeys =
{
"ssh-rsa AAAA...Gw== user@example.local",
},
AuthorizedUsers =
{
me.Apply(me => me.Username),
},
Image = "linode/ubuntu18.04",
Label = "boot",
RootPass = "terr4form-test",
Size = 3000,
},
},
Group = "foo",
Label = "complex_instance",
PrivateIp = true,
Region = "us-central",
Tags =
{
"foo",
},
Type = "g6-nanode-1",
});
}
}
Attributes
This Linode Instance resource exports the following attributes:
status- The status of the instance, indicating the current readiness state. (running,offline, ...)ip_address- A string containing the Linode's public IP address.private_ip_address- This Linode's Private IPv4 Address, if enabled. The regional private IP address range, 192.168.128.0/17, is shared by all Linode Instances in a region.ipv6- This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared. The prefix (/64) is included in this attribute.ipv4- This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses.specs.0.disk- The amount of storage space, in GB. this Linode has access to. A typical Linode will divide this space between a primary disk with an image deployed to it, and a swap disk, usually 512 MB. This is the default configuration created when deploying a Linode with an image through POST /linode/instances.specs.0.memory- The amount of RAM, in MB, this Linode has access to. Typically a Linode will choose to boot with all of its available RAM, but this can be configured in a Config profile.specs.0.vcpus- The number of vcpus this Linode has access to. Typically a Linode will choose to boot with all of its available vcpus, but this can be configured in a Config Profile.specs.0.transfer- The amount of network transfer this Linode is allotted each month.backups- Information about this Linode's backups status.enabled- If this Linode has the Backup service enabled.scheduleday- The day of the week that your Linode's weekly Backup is taken. If not set manually, a day will be chosen for you. Backups are taken every day, but backups taken on this day are preferred when selecting backups to retain for a longer period. If not set manually, then when backups are initially enabled, this may come back as "Scheduling" until the day is automatically selected.window- The window ('W0'-'W22') in which your backups will be taken, in UTC. A backups window is a two-hour span of time in which the backup may occur. For example, 'W10' indicates that your backups should be taken between 10:00 and 12:00. If you do not choose a backup window, one will be selected for you automatically. If not set manually, when backups are initially enabled this may come back as Scheduling until the window is automatically selected.
Inherited Members
Namespace: Pulumi.Linode
Assembly: Pulumi.Linode.dll
Syntax
public class Instance : CustomResource
Constructors
View SourceInstance(String, InstanceArgs, CustomResourceOptions)
Create a Instance resource with the given unique name, arguments, and options.
Declaration
public Instance(string name, InstanceArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| InstanceArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAlerts
Declaration
public Output<InstanceAlerts> Alerts { get; }
Property Value
| Type | Description |
|---|---|
| Output<InstanceAlerts> |
AuthorizedKeys
A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if image is provided. This value can not be imported. Changing authorized_keys forces the creation of a new Linode Instance.
Declaration
public Output<ImmutableArray<string>> AuthorizedKeys { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
AuthorizedUsers
A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the root user's ~/.ssh/authorized_keys file automatically. This value can not be imported. Changing authorized_users forces the creation of a new Linode Instance.
Declaration
public Output<ImmutableArray<string>> AuthorizedUsers { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
BackupId
A Backup ID from another Linode's available backups. Your User must have read_write access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. This value can not be imported. Changing backup_id forces the creation of a new Linode Instance.
Declaration
public Output<int?> BackupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Backups
Information about this Linode's backups status.
Declaration
public Output<InstanceBackups> Backups { get; }
Property Value
| Type | Description |
|---|---|
| Output<InstanceBackups> |
BackupsEnabled
If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed.
Declaration
public Output<bool> BackupsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
BootConfigLabel
The Label of the Instance Config that should be used to boot the Linode instance. If there is only one config, the label of that config will be used as the boot_config_label. This value can not be imported.
Declaration
public Output<string> BootConfigLabel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Configs
Configuration profiles define the VM settings and boot behavior of the Linode Instance.
Declaration
public Output<ImmutableArray<InstanceConfig>> Configs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<InstanceConfig>> |
Disks
Declaration
public Output<ImmutableArray<InstanceDisk>> Disks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<InstanceDisk>> |
Group
The display group of the Linode instance.
Declaration
public Output<string> Group { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Image
An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. Examples are linode/debian9, linode/fedora28, linode/ubuntu16.04lts, linode/arch, and private/12345. See all images here. Changing image forces the creation of a new Linode Instance.
Declaration
public Output<string> Image { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IpAddress
This Linode's Public IPv4 Address. If there are multiple public IPv4 addresses on this Instance, an arbitrary address will be used for this field.
Declaration
public Output<string> IpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ipv4s
This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses.
Declaration
public Output<ImmutableArray<string>> Ipv4s { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Ipv6
This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared.
Declaration
public Output<string> Ipv6 { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Label
The Config's label for display purposes. Also used by boot_config_label.
Declaration
public Output<string> Label { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PrivateIp
If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled.
Declaration
public Output<bool?> PrivateIp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
PrivateIpAddress
This Linode's Private IPv4 Address. The regional private IP address range is 192.168.128/17 address shared by all Linode Instances in a region.
Declaration
public Output<string> PrivateIpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
This is the location where the Linode is deployed. Examples are "us-east", "us-west", "ap-south", etc. See all regions here. Changing region forces the creation of a new Linode Instance..
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RootPass
The initial password for the root user account. This value can not be imported. Changing root_pass forces the creation of a new Linode Instance. If omitted, a random password will be generated but will not be stored in state.
Declaration
public Output<string> RootPass { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Specs
Declaration
public Output<InstanceSpecs> Specs { get; }
Property Value
| Type | Description |
|---|---|
| Output<InstanceSpecs> |
StackscriptData
An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. This value can not be imported. Changing stackscript_data forces the creation of a new Linode Instance.
Declaration
public Output<ImmutableDictionary<string, object>> StackscriptData { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
StackscriptId
The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. This value can not be imported. Changing stackscript_id forces the creation of a new Linode Instance.
Declaration
public Output<int?> StackscriptId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Status
The status of the instance, indicating the current readiness state.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SwapSize
When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode.
Declaration
public Output<int> SwapSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Tags
A list of tags applied to this object. Tags are for organizational purposes only.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Type
The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", "g6-highmem-16", "g6-dedicated-16", etc. See all types here.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
WatchdogEnabled
The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes.
Declaration
public Output<bool?> WatchdogEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, InstanceState, CustomResourceOptions)
Get an existing Instance resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Instance Get(string name, Input<string> id, InstanceState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| InstanceState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Instance |