The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

VolumeAttachment

Manages attaching a Volume to a Instance.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var db = new Civo.Volume("db", new Civo.VolumeArgs
        {
            SizeGb = 60,
            Bootable = false,
        });
        var foobar = new Civo.VolumeAttachment("foobar", new Civo.VolumeAttachmentArgs
        {
            InstanceId = civo_instance.My_test_instance.Id,
            VolumeId = db.Id,
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        db, err := civo.NewVolume(ctx, "db", &civo.VolumeArgs{
            SizeGb:   pulumi.Int(60),
            Bootable: pulumi.Bool(false),
        })
        if err != nil {
            return err
        }
        _, err = civo.NewVolumeAttachment(ctx, "foobar", &civo.VolumeAttachmentArgs{
            InstanceId: pulumi.Any(civo_instance.My - test - instance.Id),
            VolumeId:   db.ID(),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_civo as civo

db = civo.Volume("db",
    size_gb=60,
    bootable=False)
foobar = civo.VolumeAttachment("foobar",
    instance_id=civo_instance["my-test-instance"]["id"],
    volume_id=db.id)
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const db = new civo.Volume("db", {
    sizeGb: 60,
    bootable: false,
});
const foobar = new civo.VolumeAttachment("foobar", {
    instanceId: civo_instance["my-test-instance"].id,
    volumeId: db.id,
});

Create a VolumeAttachment Resource

def VolumeAttachment(resource_name: str, opts: Optional[ResourceOptions] = None, instance_id: Optional[str] = None, volume_id: Optional[str] = None)
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:

InstanceId string

ID of the instance to attach the volume to.

VolumeId string

ID of the Volume to be attached to the instance.

InstanceId string

ID of the instance to attach the volume to.

VolumeId string

ID of the Volume to be attached to the instance.

instanceId string

ID of the instance to attach the volume to.

volumeId string

ID of the Volume to be attached to the instance.

instance_id str

ID of the instance to attach the volume to.

volume_id str

ID of the Volume to be attached to the instance.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

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): VolumeAttachment
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, instance_id: Optional[str] = None, volume_id: Optional[str] = None) -> VolumeAttachment
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:

InstanceId string

ID of the instance to attach the volume to.

VolumeId string

ID of the Volume to be attached to the instance.

InstanceId string

ID of the instance to attach the volume to.

VolumeId string

ID of the Volume to be attached to the instance.

instanceId string

ID of the instance to attach the volume to.

volumeId string

ID of the Volume to be attached to the instance.

instance_id str

ID of the instance to attach the volume to.

volume_id str

ID of the Volume to be attached to the instance.

Package Details

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