Volume
Provides a Linode Volume resource. This can be used to create, modify, and delete Linodes Block Storage Volumes. Block Storage Volumes are removable storage disks that persist outside the life-cycle of Linode Instances. These volumes can be attached to and detached from Linode instances throughout a region.
For more information, see How to Use Block Storage with Your Linode and the Linode APIv4 docs.
Attributes
This resource exports the following attributes:
status
- The label of the Linode Volume.filesystem_path
- The full filesystem path for the Volume based on the Volume’s label. The path is “/dev/disk/by-id/scsi-0LinodeVolume” + the Volume label
Example Usage
using Pulumi;
using Linode = Pulumi.Linode;
class MyStack : Stack
{
public MyStack()
{
var foobaz = new Linode.Instance("foobaz", new Linode.InstanceArgs
{
Region = "us-west",
RootPass = "3X4mp13",
Tags =
{
"foobaz",
},
Type = "g6-nanode-1",
});
var foobar = new Linode.Volume("foobar", new Linode.VolumeArgs
{
Label = "foo-volume",
LinodeId = foobaz.Id,
Region = foobaz.Region,
});
}
}
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 {
foobaz, err := linode.NewInstance(ctx, "foobaz", &linode.InstanceArgs{
Region: pulumi.String("us-west"),
RootPass: pulumi.String("3X4mp13"),
Tags: pulumi.StringArray{
pulumi.String("foobaz"),
},
Type: pulumi.String("g6-nanode-1"),
})
if err != nil {
return err
}
_, err = linode.NewVolume(ctx, "foobar", &linode.VolumeArgs{
Label: pulumi.String("foo-volume"),
LinodeId: foobaz.ID(),
Region: foobaz.Region,
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_linode as linode
foobaz = linode.Instance("foobaz",
region="us-west",
root_pass="3X4mp13",
tags=["foobaz"],
type="g6-nanode-1")
foobar = linode.Volume("foobar",
label="foo-volume",
linode_id=foobaz.id,
region=foobaz.region)
import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const foobaz = new linode.Instance("foobaz", {
region: "us-west",
rootPass: "3X4mp13",
tags: ["foobaz"],
type: "g6-nanode-1",
});
const foobar = new linode.Volume("foobar", {
label: "foo-volume",
linodeId: foobaz.id.apply(id => Number.parseFloat(id)),
region: foobaz.region,
});
Create a Volume Resource
new Volume(name: string, args: VolumeArgs, opts?: CustomResourceOptions);
def Volume(resource_name: str, opts: Optional[ResourceOptions] = None, label: Optional[str] = None, linode_id: Optional[int] = None, region: Optional[str] = None, size: Optional[int] = None, tags: Optional[Sequence[str]] = None)
func NewVolume(ctx *Context, name string, args VolumeArgs, opts ...ResourceOption) (*Volume, error)
public Volume(string name, VolumeArgs args, CustomResourceOptions? opts = null)
- name string
- The unique name of the resource.
- args VolumeArgs
- 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 VolumeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VolumeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Volume Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Volume resource accepts the following input properties:
- Label string
The label of the Linode Volume
- Region string
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- Linode
Id int The ID of a Linode Instance where the Volume should be attached.
- Size int
Size of the Volume in GB.
- List<string>
A list of tags applied to this object. Tags are for organizational purposes only.
- Label string
The label of the Linode Volume
- Region string
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- Linode
Id int The ID of a Linode Instance where the Volume should be attached.
- Size int
Size of the Volume in GB.
- []string
A list of tags applied to this object. Tags are for organizational purposes only.
- label string
The label of the Linode Volume
- region string
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- linode
Id number The ID of a Linode Instance where the Volume should be attached.
- size number
Size of the Volume in GB.
- string[]
A list of tags applied to this object. Tags are for organizational purposes only.
- label str
The label of the Linode Volume
- region str
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- linode_
id int The ID of a Linode Instance where the Volume should be attached.
- size int
Size of the Volume in GB.
- Sequence[str]
A list of tags applied to this object. Tags are for organizational purposes only.
Outputs
All input properties are implicitly available as output properties. Additionally, the Volume resource produces the following output properties:
- Filesystem
Path string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
The status of the volume, indicating the current readiness state.
- Filesystem
Path string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
The status of the volume, indicating the current readiness state.
- filesystem
Path string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
The status of the volume, indicating the current readiness state.
- filesystem_
path str The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
The status of the volume, indicating the current readiness state.
Look up an Existing Volume Resource
Get an existing Volume 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?: VolumeState, opts?: CustomResourceOptions): Volume
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, filesystem_path: Optional[str] = None, label: Optional[str] = None, linode_id: Optional[int] = None, region: Optional[str] = None, size: Optional[int] = None, status: Optional[str] = None, tags: Optional[Sequence[str]] = None) -> Volume
func GetVolume(ctx *Context, name string, id IDInput, state *VolumeState, opts ...ResourceOption) (*Volume, error)
public static Volume Get(string name, Input<string> id, VolumeState? 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:
- Filesystem
Path string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- Label string
The label of the Linode Volume
- Linode
Id int The ID of a Linode Instance where the Volume should be attached.
- Region string
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- Size int
Size of the Volume in GB.
- Status string
The status of the volume, indicating the current readiness state.
- List<string>
A list of tags applied to this object. Tags are for organizational purposes only.
- Filesystem
Path string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- Label string
The label of the Linode Volume
- Linode
Id int The ID of a Linode Instance where the Volume should be attached.
- Region string
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- Size int
Size of the Volume in GB.
- Status string
The status of the volume, indicating the current readiness state.
- []string
A list of tags applied to this object. Tags are for organizational purposes only.
- filesystem
Path string The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- label string
The label of the Linode Volume
- linode
Id number The ID of a Linode Instance where the Volume should be attached.
- region string
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- size number
Size of the Volume in GB.
- status string
The status of the volume, indicating the current readiness state.
- string[]
A list of tags applied to this object. Tags are for organizational purposes only.
- filesystem_
path str The full filesystem path for the Volume based on the Volume’s label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
- label str
The label of the Linode Volume
- linode_
id int The ID of a Linode Instance where the Volume should be attached.
- region str
The region where this volume will be deployed. Examples are
"us-east"
,"us-west"
,"ap-south"
, etc. Changingregion
forces the creation of a new Linode Volume..- size int
Size of the Volume in GB.
- status str
The status of the volume, indicating the current readiness state.
- Sequence[str]
A list of tags applied to this object. Tags are for organizational purposes only.
Import
Linodes Volumes can be imported using the Linode Volume id
, e.g.
$ pulumi import linode:index/volume:Volume myvolume 1234567
The Linode Guide, Import Existing Infrastructure to Terraform, offers resource importing examples for Block Storage Volumes and other Linode resource types.
Package Details
- Repository
- https://github.com/pulumi/pulumi-linode
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
linode
Terraform Provider.