ionoscloud.getVolume
Explore with Pulumi AI
The volume data source can be used to search for and return existing volumes. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getVolume({
datacenterId: "datacenter_id",
id: "volume_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_volume(datacenter_id="datacenter_id",
id="volume_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupVolume(ctx, &ionoscloud.LookupVolumeArgs{
DatacenterId: "datacenter_id",
Id: pulumi.StringRef("volume_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetVolume.Invoke(new()
{
DatacenterId = "datacenter_id",
Id = "volume_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetVolumeArgs;
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) {
final var example = IonoscloudFunctions.getVolume(GetVolumeArgs.builder()
.datacenterId("datacenter_id")
.id("volume_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getVolume
arguments:
datacenterId: datacenter_id
id: volume_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getVolume({
datacenterId: "datacenter_id",
name: "Volume Example",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_volume(datacenter_id="datacenter_id",
name="Volume Example")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupVolume(ctx, &ionoscloud.LookupVolumeArgs{
DatacenterId: "datacenter_id",
Name: pulumi.StringRef("Volume Example"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetVolume.Invoke(new()
{
DatacenterId = "datacenter_id",
Name = "Volume Example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetVolumeArgs;
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) {
final var example = IonoscloudFunctions.getVolume(GetVolumeArgs.builder()
.datacenterId("datacenter_id")
.name("Volume Example")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getVolume
arguments:
datacenterId: datacenter_id
name: Volume Example
Using getVolume
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVolume(args: GetVolumeArgs, opts?: InvokeOptions): Promise<GetVolumeResult>
function getVolumeOutput(args: GetVolumeOutputArgs, opts?: InvokeOptions): Output<GetVolumeResult>
def get_volume(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[GetVolumeTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetVolumeResult
def get_volume_output(datacenter_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetVolumeTimeoutsArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVolumeResult]
func LookupVolume(ctx *Context, args *LookupVolumeArgs, opts ...InvokeOption) (*LookupVolumeResult, error)
func LookupVolumeOutput(ctx *Context, args *LookupVolumeOutputArgs, opts ...InvokeOption) LookupVolumeResultOutput
> Note: This function is named LookupVolume
in the Go SDK.
public static class GetVolume
{
public static Task<GetVolumeResult> InvokeAsync(GetVolumeArgs args, InvokeOptions? opts = null)
public static Output<GetVolumeResult> Invoke(GetVolumeInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
public static Output<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getVolume:getVolume
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - Id string
ID of the volume you want to search for.
Either
volume
orid
must be provided. If none, or both are provided, the datasource will return an error.- Name string
- Name of an existing volume that you want to search for.
- Timeouts
Get
Volume Timeouts
- Datacenter
Id string - Id string
ID of the volume you want to search for.
Either
volume
orid
must be provided. If none, or both are provided, the datasource will return an error.- Name string
- Name of an existing volume that you want to search for.
- Timeouts
Get
Volume Timeouts
- datacenter
Id String - id String
ID of the volume you want to search for.
Either
volume
orid
must be provided. If none, or both are provided, the datasource will return an error.- name String
- Name of an existing volume that you want to search for.
- timeouts
Get
Volume Timeouts
- datacenter
Id string - id string
ID of the volume you want to search for.
Either
volume
orid
must be provided. If none, or both are provided, the datasource will return an error.- name string
- Name of an existing volume that you want to search for.
- timeouts
Get
Volume Timeouts
- datacenter_
id str - id str
ID of the volume you want to search for.
Either
volume
orid
must be provided. If none, or both are provided, the datasource will return an error.- name str
- Name of an existing volume that you want to search for.
- timeouts
Get
Volume Timeouts
- datacenter
Id String - id String
ID of the volume you want to search for.
Either
volume
orid
must be provided. If none, or both are provided, the datasource will return an error.- name String
- Name of an existing volume that you want to search for.
- timeouts Property Map
getVolume Result
The following output properties are available:
- Availability
Zone string - The storage availability zone assigned to the volume: AUTO, ZONE_1, ZONE_2, or ZONE_3. This property is immutable.
- Backup
Unit stringId - The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.
- Boot
Server string - The UUID of the attached server.
- Bus string
- The bus type of the volume: VIRTIO or IDE.
- Cpu
Hot boolPlug - Is capable of CPU hot plug (no reboot required)
- Datacenter
Id string - Device
Number double - The LUN ID of the storage volume. Null for volumes not mounted to any VM
- Disc
Virtio boolHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- Disc
Virtio boolHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- Disk
Type string - The volume type: HDD or SSD.
- Id string
- The id of the volume.
- Image string
- The image or snapshot UUID.
- Image
Password string - Required if
sshkey_path
is not provided. - Licence
Type string - The type of the licence.
- Name string
- The name of the volume.
- Nic
Hot boolPlug - Is capable of nic hot plug (no reboot required)
- Nic
Hot boolUnplug - Is capable of nic hot unplug (no reboot required)
- Ram
Hot boolPlug - Is capable of memory hot plug (no reboot required)
- Size double
- The size of the volume in GB.
- Sshkey string
- The associated public SSH key.
- User
Data string - The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. This option will work only with cloud-init compatible images.
- Timeouts
Get
Volume Timeouts
- Availability
Zone string - The storage availability zone assigned to the volume: AUTO, ZONE_1, ZONE_2, or ZONE_3. This property is immutable.
- Backup
Unit stringId - The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.
- Boot
Server string - The UUID of the attached server.
- Bus string
- The bus type of the volume: VIRTIO or IDE.
- Cpu
Hot boolPlug - Is capable of CPU hot plug (no reboot required)
- Datacenter
Id string - Device
Number float64 - The LUN ID of the storage volume. Null for volumes not mounted to any VM
- Disc
Virtio boolHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- Disc
Virtio boolHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- Disk
Type string - The volume type: HDD or SSD.
- Id string
- The id of the volume.
- Image string
- The image or snapshot UUID.
- Image
Password string - Required if
sshkey_path
is not provided. - Licence
Type string - The type of the licence.
- Name string
- The name of the volume.
- Nic
Hot boolPlug - Is capable of nic hot plug (no reboot required)
- Nic
Hot boolUnplug - Is capable of nic hot unplug (no reboot required)
- Ram
Hot boolPlug - Is capable of memory hot plug (no reboot required)
- Size float64
- The size of the volume in GB.
- Sshkey string
- The associated public SSH key.
- User
Data string - The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. This option will work only with cloud-init compatible images.
- Timeouts
Get
Volume Timeouts
- availability
Zone String - The storage availability zone assigned to the volume: AUTO, ZONE_1, ZONE_2, or ZONE_3. This property is immutable.
- backup
Unit StringId - The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.
- boot
Server String - The UUID of the attached server.
- bus String
- The bus type of the volume: VIRTIO or IDE.
- cpu
Hot BooleanPlug - Is capable of CPU hot plug (no reboot required)
- datacenter
Id String - device
Number Double - The LUN ID of the storage volume. Null for volumes not mounted to any VM
- disc
Virtio BooleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio BooleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disk
Type String - The volume type: HDD or SSD.
- id String
- The id of the volume.
- image String
- The image or snapshot UUID.
- image
Password String - Required if
sshkey_path
is not provided. - licence
Type String - The type of the licence.
- name String
- The name of the volume.
- nic
Hot BooleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot BooleanUnplug - Is capable of nic hot unplug (no reboot required)
- ram
Hot BooleanPlug - Is capable of memory hot plug (no reboot required)
- size Double
- The size of the volume in GB.
- sshkey String
- The associated public SSH key.
- user
Data String - The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. This option will work only with cloud-init compatible images.
- timeouts
Get
Volume Timeouts
- availability
Zone string - The storage availability zone assigned to the volume: AUTO, ZONE_1, ZONE_2, or ZONE_3. This property is immutable.
- backup
Unit stringId - The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.
- boot
Server string - The UUID of the attached server.
- bus string
- The bus type of the volume: VIRTIO or IDE.
- cpu
Hot booleanPlug - Is capable of CPU hot plug (no reboot required)
- datacenter
Id string - device
Number number - The LUN ID of the storage volume. Null for volumes not mounted to any VM
- disc
Virtio booleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio booleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disk
Type string - The volume type: HDD or SSD.
- id string
- The id of the volume.
- image string
- The image or snapshot UUID.
- image
Password string - Required if
sshkey_path
is not provided. - licence
Type string - The type of the licence.
- name string
- The name of the volume.
- nic
Hot booleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot booleanUnplug - Is capable of nic hot unplug (no reboot required)
- ram
Hot booleanPlug - Is capable of memory hot plug (no reboot required)
- size number
- The size of the volume in GB.
- sshkey string
- The associated public SSH key.
- user
Data string - The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. This option will work only with cloud-init compatible images.
- timeouts
Get
Volume Timeouts
- availability_
zone str - The storage availability zone assigned to the volume: AUTO, ZONE_1, ZONE_2, or ZONE_3. This property is immutable.
- backup_
unit_ strid - The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.
- boot_
server str - The UUID of the attached server.
- bus str
- The bus type of the volume: VIRTIO or IDE.
- cpu_
hot_ boolplug - Is capable of CPU hot plug (no reboot required)
- datacenter_
id str - device_
number float - The LUN ID of the storage volume. Null for volumes not mounted to any VM
- disc_
virtio_ boolhot_ plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc_
virtio_ boolhot_ unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disk_
type str - The volume type: HDD or SSD.
- id str
- The id of the volume.
- image str
- The image or snapshot UUID.
- image_
password str - Required if
sshkey_path
is not provided. - licence_
type str - The type of the licence.
- name str
- The name of the volume.
- nic_
hot_ boolplug - Is capable of nic hot plug (no reboot required)
- nic_
hot_ boolunplug - Is capable of nic hot unplug (no reboot required)
- ram_
hot_ boolplug - Is capable of memory hot plug (no reboot required)
- size float
- The size of the volume in GB.
- sshkey str
- The associated public SSH key.
- user_
data str - The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. This option will work only with cloud-init compatible images.
- timeouts
Get
Volume Timeouts
- availability
Zone String - The storage availability zone assigned to the volume: AUTO, ZONE_1, ZONE_2, or ZONE_3. This property is immutable.
- backup
Unit StringId - The uuid of the Backup Unit that user has access to. The property is immutable and is only allowed to be set on a new volume creation. It is mandatory to provide either 'public image' or 'imageAlias' in conjunction with this property.
- boot
Server String - The UUID of the attached server.
- bus String
- The bus type of the volume: VIRTIO or IDE.
- cpu
Hot BooleanPlug - Is capable of CPU hot plug (no reboot required)
- datacenter
Id String - device
Number Number - The LUN ID of the storage volume. Null for volumes not mounted to any VM
- disc
Virtio BooleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio BooleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disk
Type String - The volume type: HDD or SSD.
- id String
- The id of the volume.
- image String
- The image or snapshot UUID.
- image
Password String - Required if
sshkey_path
is not provided. - licence
Type String - The type of the licence.
- name String
- The name of the volume.
- nic
Hot BooleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot BooleanUnplug - Is capable of nic hot unplug (no reboot required)
- ram
Hot BooleanPlug - Is capable of memory hot plug (no reboot required)
- size Number
- The size of the volume in GB.
- sshkey String
- The associated public SSH key.
- user
Data String - The cloud-init configuration for the volume as base64 encoded string. The property is immutable and is only allowed to be set on a new volume creation. This option will work only with cloud-init compatible images.
- timeouts Property Map
Supporting Types
GetVolumeTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.