VolumeAttachment
Manages attaching a Volume to a Droplet.
NOTE: Volumes can be attached either directly on the
digitalocean..Dropletresource, or using thedigitalocean..VolumeAttachmentresource - but the two cannot be used together. If both are used against the same Droplet, the volume attachments will constantly drift.
Example Usage
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var foobarVolume = new DigitalOcean.Volume("foobarVolume", new DigitalOcean.VolumeArgs
{
Region = "nyc1",
Size = 100,
InitialFilesystemType = "ext4",
Description = "an example volume",
});
var foobarDroplet = new DigitalOcean.Droplet("foobarDroplet", new DigitalOcean.DropletArgs
{
Size = "s-1vcpu-1gb",
Image = "ubuntu-18-04-x64",
Region = "nyc1",
});
var foobarVolumeAttachment = new DigitalOcean.VolumeAttachment("foobarVolumeAttachment", new DigitalOcean.VolumeAttachmentArgs
{
DropletId = foobarDroplet.Id,
VolumeId = foobarVolume.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
foobar_volume = digitalocean.Volume("foobarVolume",
region="nyc1",
size=100,
initial_filesystem_type="ext4",
description="an example volume")
foobar_droplet = digitalocean.Droplet("foobarDroplet",
size="s-1vcpu-1gb",
image="ubuntu-18-04-x64",
region="nyc1")
foobar_volume_attachment = digitalocean.VolumeAttachment("foobarVolumeAttachment",
droplet_id=foobar_droplet.id,
volume_id=foobar_volume.id)import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const foobarVolume = new digitalocean.Volume("foobarVolume", {
region: "nyc1",
size: 100,
initialFilesystemType: "ext4",
description: "an example volume",
});
const foobarDroplet = new digitalocean.Droplet("foobarDroplet", {
size: "s-1vcpu-1gb",
image: "ubuntu-18-04-x64",
region: "nyc1",
});
const foobarVolumeAttachment = new digitalocean.VolumeAttachment("foobarVolumeAttachment", {
dropletId: foobarDroplet.id,
volumeId: foobarVolume.id,
});Create a VolumeAttachment Resource
new VolumeAttachment(name: string, args: VolumeAttachmentArgs, opts?: CustomResourceOptions);def VolumeAttachment(resource_name, opts=None, droplet_id=None, volume_id=None, __props__=None);func NewVolumeAttachment(ctx *Context, name string, args VolumeAttachmentArgs, opts ...ResourceOption) (*VolumeAttachment, error)public VolumeAttachment(string name, VolumeAttachmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args VolumeAttachmentArgs
- 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 VolumeAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VolumeAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
VolumeAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The VolumeAttachment resource accepts the following input properties:
- droplet_
id float ID of the Droplet to attach the volume to.
- volume_
id str ID of the Volume to be attached to the Droplet.
Outputs
All input properties are implicitly available as output properties. Additionally, the VolumeAttachment resource produces the following output properties:
Look up an Existing VolumeAttachment Resource
Get an existing VolumeAttachment 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?: VolumeAttachmentState, opts?: CustomResourceOptions): VolumeAttachmentstatic get(resource_name, id, opts=None, droplet_id=None, volume_id=None, __props__=None);func GetVolumeAttachment(ctx *Context, name string, id IDInput, state *VolumeAttachmentState, opts ...ResourceOption) (*VolumeAttachment, error)public static VolumeAttachment Get(string name, Input<string> id, VolumeAttachmentState? 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:
- droplet_
id float ID of the Droplet to attach the volume to.
- volume_
id str ID of the Volume to be attached to the Droplet.
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.