1. Packages
  2. Outscale Provider
  3. API Docs
  4. VolumeLink
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.VolumeLink

Explore with Pulumi AI

Manages a volume link.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

Required resources

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const volume01 = new outscale.Volume("volume01", {
    subregionName: `${_var.region}a`,
    size: 40,
});
const vm01 = new outscale.Vm("vm01", {
    imageId: _var.image_id,
    vmType: _var.vm_type,
    keypairName: _var.keypair_name,
    securityGroupIds: [_var.security_group_id],
});
Copy
import pulumi
import pulumi_outscale as outscale

volume01 = outscale.Volume("volume01",
    subregion_name=f"{var['region']}a",
    size=40)
vm01 = outscale.Vm("vm01",
    image_id=var["image_id"],
    vm_type=var["vm_type"],
    keypair_name=var["keypair_name"],
    security_group_ids=[var["security_group_id"]])
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewVolume(ctx, "volume01", &outscale.VolumeArgs{
			SubregionName: pulumi.Sprintf("%va", _var.Region),
			Size:          pulumi.Float64(40),
		})
		if err != nil {
			return err
		}
		_, err = outscale.NewVm(ctx, "vm01", &outscale.VmArgs{
			ImageId:     pulumi.Any(_var.Image_id),
			VmType:      pulumi.Any(_var.Vm_type),
			KeypairName: pulumi.Any(_var.Keypair_name),
			SecurityGroupIds: pulumi.StringArray{
				_var.Security_group_id,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var volume01 = new Outscale.Volume("volume01", new()
    {
        SubregionName = $"{@var.Region}a",
        Size = 40,
    });

    var vm01 = new Outscale.Vm("vm01", new()
    {
        ImageId = @var.Image_id,
        VmType = @var.Vm_type,
        KeypairName = @var.Keypair_name,
        SecurityGroupIds = new[]
        {
            @var.Security_group_id,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.Volume;
import com.pulumi.outscale.VolumeArgs;
import com.pulumi.outscale.Vm;
import com.pulumi.outscale.VmArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var volume01 = new Volume("volume01", VolumeArgs.builder()
            .subregionName(String.format("%sa", var_.region()))
            .size(40)
            .build());

        var vm01 = new Vm("vm01", VmArgs.builder()
            .imageId(var_.image_id())
            .vmType(var_.vm_type())
            .keypairName(var_.keypair_name())
            .securityGroupIds(var_.security_group_id())
            .build());

    }
}
Copy
resources:
  volume01:
    type: outscale:Volume
    properties:
      subregionName: ${var.region}a
      size: 40
  vm01:
    type: outscale:Vm
    properties:
      imageId: ${var.image_id}
      vmType: ${var.vm_type}
      keypairName: ${var.keypair_name}
      securityGroupIds:
        - ${var.security_group_id}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const volumeLink01 = new outscale.VolumeLink("volumeLink01", {
    deviceName: "/dev/xvdc",
    volumeId: outscale_volume.volume01.id,
    vmId: outscale_vm.vm01.id,
});
Copy
import pulumi
import pulumi_outscale as outscale

volume_link01 = outscale.VolumeLink("volumeLink01",
    device_name="/dev/xvdc",
    volume_id=outscale_volume["volume01"]["id"],
    vm_id=outscale_vm["vm01"]["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewVolumeLink(ctx, "volumeLink01", &outscale.VolumeLinkArgs{
			DeviceName: pulumi.String("/dev/xvdc"),
			VolumeId:   pulumi.Any(outscale_volume.Volume01.Id),
			VmId:       pulumi.Any(outscale_vm.Vm01.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var volumeLink01 = new Outscale.VolumeLink("volumeLink01", new()
    {
        DeviceName = "/dev/xvdc",
        VolumeId = outscale_volume.Volume01.Id,
        VmId = outscale_vm.Vm01.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.VolumeLink;
import com.pulumi.outscale.VolumeLinkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var volumeLink01 = new VolumeLink("volumeLink01", VolumeLinkArgs.builder()
            .deviceName("/dev/xvdc")
            .volumeId(outscale_volume.volume01().id())
            .vmId(outscale_vm.vm01().id())
            .build());

    }
}
Copy
resources:
  volumeLink01:
    type: outscale:VolumeLink
    properties:
      deviceName: /dev/xvdc
      volumeId: ${outscale_volume.volume01.id}
      vmId: ${outscale_vm.vm01.id}
Copy

Create VolumeLink Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VolumeLink(name: string, args: VolumeLinkArgs, opts?: CustomResourceOptions);
@overload
def VolumeLink(resource_name: str,
               args: VolumeLinkArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def VolumeLink(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               device_name: Optional[str] = None,
               vm_id: Optional[str] = None,
               volume_id: Optional[str] = None,
               delete_on_vm_termination: Optional[bool] = None,
               force_unlink: Optional[bool] = None,
               timeouts: Optional[VolumeLinkTimeoutsArgs] = None,
               volume_link_id: Optional[str] = None)
func NewVolumeLink(ctx *Context, name string, args VolumeLinkArgs, opts ...ResourceOption) (*VolumeLink, error)
public VolumeLink(string name, VolumeLinkArgs args, CustomResourceOptions? opts = null)
public VolumeLink(String name, VolumeLinkArgs args)
public VolumeLink(String name, VolumeLinkArgs args, CustomResourceOptions options)
type: outscale:VolumeLink
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VolumeLinkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VolumeLinkArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VolumeLinkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VolumeLinkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VolumeLinkArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var volumeLinkResource = new Outscale.VolumeLink("volumeLinkResource", new()
{
    DeviceName = "string",
    VmId = "string",
    VolumeId = "string",
    DeleteOnVmTermination = false,
    ForceUnlink = false,
    Timeouts = new Outscale.Inputs.VolumeLinkTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
    },
    VolumeLinkId = "string",
});
Copy
example, err := outscale.NewVolumeLink(ctx, "volumeLinkResource", &outscale.VolumeLinkArgs{
DeviceName: pulumi.String("string"),
VmId: pulumi.String("string"),
VolumeId: pulumi.String("string"),
DeleteOnVmTermination: pulumi.Bool(false),
ForceUnlink: pulumi.Bool(false),
Timeouts: &.VolumeLinkTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
VolumeLinkId: pulumi.String("string"),
})
Copy
var volumeLinkResource = new VolumeLink("volumeLinkResource", VolumeLinkArgs.builder()
    .deviceName("string")
    .vmId("string")
    .volumeId("string")
    .deleteOnVmTermination(false)
    .forceUnlink(false)
    .timeouts(VolumeLinkTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .build())
    .volumeLinkId("string")
    .build());
Copy
volume_link_resource = outscale.VolumeLink("volumeLinkResource",
    device_name="string",
    vm_id="string",
    volume_id="string",
    delete_on_vm_termination=False,
    force_unlink=False,
    timeouts={
        "create": "string",
        "delete": "string",
    },
    volume_link_id="string")
Copy
const volumeLinkResource = new outscale.VolumeLink("volumeLinkResource", {
    deviceName: "string",
    vmId: "string",
    volumeId: "string",
    deleteOnVmTermination: false,
    forceUnlink: false,
    timeouts: {
        create: "string",
        "delete": "string",
    },
    volumeLinkId: "string",
});
Copy
type: outscale:VolumeLink
properties:
    deleteOnVmTermination: false
    deviceName: string
    forceUnlink: false
    timeouts:
        create: string
        delete: string
    vmId: string
    volumeId: string
    volumeLinkId: string
Copy

VolumeLink Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VolumeLink resource accepts the following input properties:

DeviceName This property is required. string
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
VmId This property is required. string
The ID of the VM you want to attach the volume to.
VolumeId This property is required. string
The ID of the volume you want to attach.
DeleteOnVmTermination bool
ForceUnlink bool
Timeouts VolumeLinkTimeouts
VolumeLinkId string
DeviceName This property is required. string
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
VmId This property is required. string
The ID of the VM you want to attach the volume to.
VolumeId This property is required. string
The ID of the volume you want to attach.
DeleteOnVmTermination bool
ForceUnlink bool
Timeouts VolumeLinkTimeoutsArgs
VolumeLinkId string
deviceName This property is required. String
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
vmId This property is required. String
The ID of the VM you want to attach the volume to.
volumeId This property is required. String
The ID of the volume you want to attach.
deleteOnVmTermination Boolean
forceUnlink Boolean
timeouts VolumeLinkTimeouts
volumeLinkId String
deviceName This property is required. string
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
vmId This property is required. string
The ID of the VM you want to attach the volume to.
volumeId This property is required. string
The ID of the volume you want to attach.
deleteOnVmTermination boolean
forceUnlink boolean
timeouts VolumeLinkTimeouts
volumeLinkId string
device_name This property is required. str
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
vm_id This property is required. str
The ID of the VM you want to attach the volume to.
volume_id This property is required. str
The ID of the volume you want to attach.
delete_on_vm_termination bool
force_unlink bool
timeouts VolumeLinkTimeoutsArgs
volume_link_id str
deviceName This property is required. String
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
vmId This property is required. String
The ID of the VM you want to attach the volume to.
volumeId This property is required. String
The ID of the volume you want to attach.
deleteOnVmTermination Boolean
forceUnlink Boolean
timeouts Property Map
volumeLinkId String

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RequestId string
State string
The state of the attachment of the volume (attaching | detaching | attached | detached).
Id string
The provider-assigned unique ID for this managed resource.
RequestId string
State string
The state of the attachment of the volume (attaching | detaching | attached | detached).
id String
The provider-assigned unique ID for this managed resource.
requestId String
state String
The state of the attachment of the volume (attaching | detaching | attached | detached).
id string
The provider-assigned unique ID for this managed resource.
requestId string
state string
The state of the attachment of the volume (attaching | detaching | attached | detached).
id str
The provider-assigned unique ID for this managed resource.
request_id str
state str
The state of the attachment of the volume (attaching | detaching | attached | detached).
id String
The provider-assigned unique ID for this managed resource.
requestId String
state String
The state of the attachment of the volume (attaching | detaching | attached | detached).

Look up Existing VolumeLink Resource

Get an existing VolumeLink 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?: VolumeLinkState, opts?: CustomResourceOptions): VolumeLink
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        delete_on_vm_termination: Optional[bool] = None,
        device_name: Optional[str] = None,
        force_unlink: Optional[bool] = None,
        request_id: Optional[str] = None,
        state: Optional[str] = None,
        timeouts: Optional[VolumeLinkTimeoutsArgs] = None,
        vm_id: Optional[str] = None,
        volume_id: Optional[str] = None,
        volume_link_id: Optional[str] = None) -> VolumeLink
func GetVolumeLink(ctx *Context, name string, id IDInput, state *VolumeLinkState, opts ...ResourceOption) (*VolumeLink, error)
public static VolumeLink Get(string name, Input<string> id, VolumeLinkState? state, CustomResourceOptions? opts = null)
public static VolumeLink get(String name, Output<String> id, VolumeLinkState state, CustomResourceOptions options)
resources:  _:    type: outscale:VolumeLink    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DeleteOnVmTermination bool
DeviceName string
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
ForceUnlink bool
RequestId string
State string
The state of the attachment of the volume (attaching | detaching | attached | detached).
Timeouts VolumeLinkTimeouts
VmId string
The ID of the VM you want to attach the volume to.
VolumeId string
The ID of the volume you want to attach.
VolumeLinkId string
DeleteOnVmTermination bool
DeviceName string
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
ForceUnlink bool
RequestId string
State string
The state of the attachment of the volume (attaching | detaching | attached | detached).
Timeouts VolumeLinkTimeoutsArgs
VmId string
The ID of the VM you want to attach the volume to.
VolumeId string
The ID of the volume you want to attach.
VolumeLinkId string
deleteOnVmTermination Boolean
deviceName String
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
forceUnlink Boolean
requestId String
state String
The state of the attachment of the volume (attaching | detaching | attached | detached).
timeouts VolumeLinkTimeouts
vmId String
The ID of the VM you want to attach the volume to.
volumeId String
The ID of the volume you want to attach.
volumeLinkId String
deleteOnVmTermination boolean
deviceName string
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
forceUnlink boolean
requestId string
state string
The state of the attachment of the volume (attaching | detaching | attached | detached).
timeouts VolumeLinkTimeouts
vmId string
The ID of the VM you want to attach the volume to.
volumeId string
The ID of the volume you want to attach.
volumeLinkId string
delete_on_vm_termination bool
device_name str
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
force_unlink bool
request_id str
state str
The state of the attachment of the volume (attaching | detaching | attached | detached).
timeouts VolumeLinkTimeoutsArgs
vm_id str
The ID of the VM you want to attach the volume to.
volume_id str
The ID of the volume you want to attach.
volume_link_id str
deleteOnVmTermination Boolean
deviceName String
The name of the device. For a root device, you must use /dev/sda1. For other volumes, you must use /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX (where the first X is a letter between b and z, and the second X is a letter between a and z).
forceUnlink Boolean
requestId String
state String
The state of the attachment of the volume (attaching | detaching | attached | detached).
timeouts Property Map
vmId String
The ID of the VM you want to attach the volume to.
volumeId String
The ID of the volume you want to attach.
volumeLinkId String

Supporting Types

VolumeLinkTimeouts
, VolumeLinkTimeoutsArgs

Create string
Delete string
Create string
Delete string
create String
delete String
create string
delete string
create str
delete str
create String
delete String

Import

A volume link can be imported using a volume ID. For example:

console

$ pulumi import outscale:index/volumeLink:VolumeLink ImportedVolumeLink vol-12345678
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.