Get started with Pulumi in a free one hour introductory workshop. Register Now

Image

Provides a Linode Image resource. This can be used to create, modify, and delete Linodes Images. Linode Images are snapshots of a Linode Instance Disk which can then be used to provision more Linode Instances. Images can be used across regions.

For more information, see Linode’s documentation on Images and the Linode APIv4 docs.

Attributes

This resource exports the following attributes:

  • id - The unique ID of this Image. The ID of private images begin with private/ followed by the numeric identifier of the private image, for example private/12345.

  • created - When this Image was created.

  • created_by - The name of the User who created this Image.

  • deprecated - Whether or not this Image is deprecated. Will only be True for deprecated public Images.

  • is_public - True if the Image is public.

  • size - The minimum size this Image needs to deploy. Size is in MB.

  • type - How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

  • expiry - Only Images created automatically (from a deleted Linode; type=automatic) will expire.

  • vendor - The upstream distribution vendor. Nil for private Images.

Example Usage

using Pulumi;
using Linode = Pulumi.Linode;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = new Linode.Instance("foo", new Linode.InstanceArgs
        {
            Region = "us-central",
            Type = "g6-nanode-1",
        });
        var bar = new Linode.Image("bar", new Linode.ImageArgs
        {
            Description = "Image taken from foo",
            DiskId = foo.Disks.Apply(disks => disks[0].Id),
            Label = "foo-sda-image",
            LinodeId = foo.Id,
        });
        var barBased = new Linode.Instance("barBased", new Linode.InstanceArgs
        {
            Image = bar.Id,
            Region = "eu-west",
            Type = foo.Type,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-linode/sdk/v2/go/linode"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        foo, err := linode.NewInstance(ctx, "foo", &linode.InstanceArgs{
            Region: pulumi.String("us-central"),
            Type:   pulumi.String("g6-nanode-1"),
        })
        if err != nil {
            return err
        }
        bar, err := linode.NewImage(ctx, "bar", &linode.ImageArgs{
            Description: pulumi.String("Image taken from foo"),
            DiskId: pulumi.Int(foo.Disks.ApplyT(func(disks []linode.InstanceDisk) (int, error) {
                return disks[0].Id, nil
            }).(pulumi.IntOutput)),
            Label:    pulumi.String("foo-sda-image"),
            LinodeId: foo.ID(),
        })
        if err != nil {
            return err
        }
        _, err = linode.NewInstance(ctx, "barBased", &linode.InstanceArgs{
            Image:  bar.ID(),
            Region: pulumi.String("eu-west"),
            Type:   foo.Type,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_linode as linode

foo = linode.Instance("foo",
    region="us-central",
    type="g6-nanode-1")
bar = linode.Image("bar",
    description="Image taken from foo",
    disk_id=foo.disks[0].id,
    label="foo-sda-image",
    linode_id=foo.id)
bar_based = linode.Instance("barBased",
    image=bar.id,
    region="eu-west",
    type=foo.type)
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const foo = new linode.Instance("foo", {
    region: "us-central",
    type: "g6-nanode-1",
});
const bar = new linode.Image("bar", {
    description: "Image taken from foo",
    diskId: foo.disks.apply(disks => disks[0].id),
    label: "foo-sda-image",
    linodeId: foo.id.apply(id => Number.parseFloat(id)),
});
const barBased = new linode.Instance("bar_based", {
    image: bar.id,
    region: "eu-west",
    type: foo.type,
});

Create a Image Resource

new Image(name: string, args: ImageArgs, opts?: CustomResourceOptions);
def Image(resource_name: str, opts: Optional[ResourceOptions] = None, description: Optional[str] = None, disk_id: Optional[int] = None, label: Optional[str] = None, linode_id: Optional[int] = None)
func NewImage(ctx *Context, name string, args ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Image Resource Properties

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

Inputs

The Image resource accepts the following input properties:

DiskId int

The ID of the Linode Disk that this Image will be created from.

Label string

A short description of the Image. Labels cannot contain special characters.

LinodeId int

The ID of the Linode that this Image will be created from.

Description string

A detailed description of this Image.

DiskId int

The ID of the Linode Disk that this Image will be created from.

Label string

A short description of the Image. Labels cannot contain special characters.

LinodeId int

The ID of the Linode that this Image will be created from.

Description string

A detailed description of this Image.

diskId number

The ID of the Linode Disk that this Image will be created from.

label string

A short description of the Image. Labels cannot contain special characters.

linodeId number

The ID of the Linode that this Image will be created from.

description string

A detailed description of this Image.

disk_id int

The ID of the Linode Disk that this Image will be created from.

label str

A short description of the Image. Labels cannot contain special characters.

linode_id int

The ID of the Linode that this Image will be created from.

description str

A detailed description of this Image.

Outputs

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

Created string

When this Image was created.

CreatedBy string

The name of the User who created this Image.

Deprecated bool

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

Expiry string

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

Id string
The provider-assigned unique ID for this managed resource.
IsPublic bool

True if the Image is public.

Size int

The minimum size this Image needs to deploy. Size is in MB.

Type string

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

Vendor string

The upstream distribution vendor. Nil for private Images.

Created string

When this Image was created.

CreatedBy string

The name of the User who created this Image.

Deprecated bool

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

Expiry string

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

Id string
The provider-assigned unique ID for this managed resource.
IsPublic bool

True if the Image is public.

Size int

The minimum size this Image needs to deploy. Size is in MB.

Type string

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

Vendor string

The upstream distribution vendor. Nil for private Images.

created string

When this Image was created.

createdBy string

The name of the User who created this Image.

deprecated boolean

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

expiry string

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

id string
The provider-assigned unique ID for this managed resource.
isPublic boolean

True if the Image is public.

size number

The minimum size this Image needs to deploy. Size is in MB.

type string

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

vendor string

The upstream distribution vendor. Nil for private Images.

created str

When this Image was created.

created_by str

The name of the User who created this Image.

deprecated bool

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

expiry str

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

id str
The provider-assigned unique ID for this managed resource.
is_public bool

True if the Image is public.

size int

The minimum size this Image needs to deploy. Size is in MB.

type str

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

vendor str

The upstream distribution vendor. Nil for private Images.

Look up an Existing Image Resource

Get an existing Image 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?: ImageState, opts?: CustomResourceOptions): Image
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, created: Optional[str] = None, created_by: Optional[str] = None, deprecated: Optional[bool] = None, description: Optional[str] = None, disk_id: Optional[int] = None, expiry: Optional[str] = None, is_public: Optional[bool] = None, label: Optional[str] = None, linode_id: Optional[int] = None, size: Optional[int] = None, type: Optional[str] = None, vendor: Optional[str] = None) -> Image
func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Created string

When this Image was created.

CreatedBy string

The name of the User who created this Image.

Deprecated bool

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

Description string

A detailed description of this Image.

DiskId int

The ID of the Linode Disk that this Image will be created from.

Expiry string

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

IsPublic bool

True if the Image is public.

Label string

A short description of the Image. Labels cannot contain special characters.

LinodeId int

The ID of the Linode that this Image will be created from.

Size int

The minimum size this Image needs to deploy. Size is in MB.

Type string

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

Vendor string

The upstream distribution vendor. Nil for private Images.

Created string

When this Image was created.

CreatedBy string

The name of the User who created this Image.

Deprecated bool

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

Description string

A detailed description of this Image.

DiskId int

The ID of the Linode Disk that this Image will be created from.

Expiry string

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

IsPublic bool

True if the Image is public.

Label string

A short description of the Image. Labels cannot contain special characters.

LinodeId int

The ID of the Linode that this Image will be created from.

Size int

The minimum size this Image needs to deploy. Size is in MB.

Type string

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

Vendor string

The upstream distribution vendor. Nil for private Images.

created string

When this Image was created.

createdBy string

The name of the User who created this Image.

deprecated boolean

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

description string

A detailed description of this Image.

diskId number

The ID of the Linode Disk that this Image will be created from.

expiry string

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

isPublic boolean

True if the Image is public.

label string

A short description of the Image. Labels cannot contain special characters.

linodeId number

The ID of the Linode that this Image will be created from.

size number

The minimum size this Image needs to deploy. Size is in MB.

type string

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

vendor string

The upstream distribution vendor. Nil for private Images.

created str

When this Image was created.

created_by str

The name of the User who created this Image.

deprecated bool

Whether or not this Image is deprecated. Will only be True for deprecated public Images.

description str

A detailed description of this Image.

disk_id int

The ID of the Linode Disk that this Image will be created from.

expiry str

Only Images created automatically (from a deleted Linode; type=automatic) will expire.

is_public bool

True if the Image is public.

label str

A short description of the Image. Labels cannot contain special characters.

linode_id int

The ID of the Linode that this Image will be created from.

size int

The minimum size this Image needs to deploy. Size is in MB.

type str

How the Image was created. ‘Manual’ Images can be created at any time. ‘Automatic’ images are created automatically from a deleted Linode.

vendor str

The upstream distribution vendor. Nil for private Images.

Import

Linodes Images can be imported using the Linode Image id, e.g.

 $ pulumi import linode:index/image:Image myimage 1234567

Package Details

Repository
https://github.com/pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.