1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. Volume
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.Volume

Explore with Pulumi AI

Represent volume. A volume is a file storage which is similar to SSD and HDD hard disks but located in the cloud

Example Usage

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

const volume = new gcore.index.Gcore_volume("volume", {
    name: "volume_example",
    typeName: "standard",
    size: 1,
    regionId: 1,
    projectId: 1,
});
Copy
import pulumi
import pulumi_gcore as gcore

volume = gcore.index.Gcore_volume("volume",
    name=volume_example,
    type_name=standard,
    size=1,
    region_id=1,
    project_id=1)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gcore.NewGcore_volume(ctx, "volume", &gcore.Gcore_volumeArgs{
			Name:      "volume_example",
			TypeName:  "standard",
			Size:      1,
			RegionId:  1,
			ProjectId: 1,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;

return await Deployment.RunAsync(() => 
{
    var volume = new Gcore.Index.Gcore_volume("volume", new()
    {
        Name = "volume_example",
        TypeName = "standard",
        Size = 1,
        RegionId = 1,
        ProjectId = 1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.gcore_volume;
import com.pulumi.gcore.Gcore_volumeArgs;
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 volume = new Gcore_volume("volume", Gcore_volumeArgs.builder()
            .name("volume_example")
            .typeName("standard")
            .size(1)
            .regionId(1)
            .projectId(1)
            .build());

    }
}
Copy
resources:
  volume:
    type: gcore:gcore_volume
    properties:
      name: volume_example
      typeName: standard
      size: 1
      regionId: 1
      projectId: 1
Copy

Create Volume Resource

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

Constructor syntax

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

@overload
def Volume(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           image_id: Optional[str] = None,
           last_updated: Optional[str] = None,
           metadata_map: Optional[Mapping[str, str]] = None,
           name: Optional[str] = None,
           project_id: Optional[float] = None,
           project_name: Optional[str] = None,
           region_id: Optional[float] = None,
           region_name: Optional[str] = None,
           size: Optional[float] = None,
           snapshot_id: Optional[str] = None,
           type_name: Optional[str] = None,
           volume_id: Optional[str] = None)
func NewVolume(ctx *Context, name string, args *VolumeArgs, opts ...ResourceOption) (*Volume, error)
public Volume(string name, VolumeArgs? args = null, CustomResourceOptions? opts = null)
public Volume(String name, VolumeArgs args)
public Volume(String name, VolumeArgs args, CustomResourceOptions options)
type: gcorelabs:Volume
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 VolumeArgs
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 VolumeArgs
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 VolumeArgs
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 VolumeArgs
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. VolumeArgs
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 volumeResource = new Gcorelabs.Volume("volumeResource", new()
{
    ImageId = "string",
    LastUpdated = "string",
    MetadataMap = 
    {
        { "string", "string" },
    },
    Name = "string",
    ProjectId = 0,
    ProjectName = "string",
    RegionId = 0,
    RegionName = "string",
    Size = 0,
    SnapshotId = "string",
    TypeName = "string",
    VolumeId = "string",
});
Copy
example, err := gcorelabs.NewVolume(ctx, "volumeResource", &gcorelabs.VolumeArgs{
ImageId: pulumi.String("string"),
LastUpdated: pulumi.String("string"),
MetadataMap: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
ProjectName: pulumi.String("string"),
RegionId: pulumi.Float64(0),
RegionName: pulumi.String("string"),
Size: pulumi.Float64(0),
SnapshotId: pulumi.String("string"),
TypeName: pulumi.String("string"),
VolumeId: pulumi.String("string"),
})
Copy
var volumeResource = new Volume("volumeResource", VolumeArgs.builder()
    .imageId("string")
    .lastUpdated("string")
    .metadataMap(Map.of("string", "string"))
    .name("string")
    .projectId(0)
    .projectName("string")
    .regionId(0)
    .regionName("string")
    .size(0)
    .snapshotId("string")
    .typeName("string")
    .volumeId("string")
    .build());
Copy
volume_resource = gcorelabs.Volume("volumeResource",
    image_id="string",
    last_updated="string",
    metadata_map={
        "string": "string",
    },
    name="string",
    project_id=0,
    project_name="string",
    region_id=0,
    region_name="string",
    size=0,
    snapshot_id="string",
    type_name="string",
    volume_id="string")
Copy
const volumeResource = new gcorelabs.Volume("volumeResource", {
    imageId: "string",
    lastUpdated: "string",
    metadataMap: {
        string: "string",
    },
    name: "string",
    projectId: 0,
    projectName: "string",
    regionId: 0,
    regionName: "string",
    size: 0,
    snapshotId: "string",
    typeName: "string",
    volumeId: "string",
});
Copy
type: gcorelabs:Volume
properties:
    imageId: string
    lastUpdated: string
    metadataMap:
        string: string
    name: string
    projectId: 0
    projectName: string
    regionId: 0
    regionName: string
    size: 0
    snapshotId: string
    typeName: string
    volumeId: string
Copy

Volume 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 Volume resource accepts the following input properties:

ImageId string
Mandatory if volume is created from image
LastUpdated string
MetadataMap Dictionary<string, string>
Name string
ProjectId double
ProjectName string
RegionId double
RegionName string
Size double
SnapshotId string
Mandatory if volume is created from a snapshot
TypeName string
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
VolumeId string
The ID of this resource.
ImageId string
Mandatory if volume is created from image
LastUpdated string
MetadataMap map[string]string
Name string
ProjectId float64
ProjectName string
RegionId float64
RegionName string
Size float64
SnapshotId string
Mandatory if volume is created from a snapshot
TypeName string
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
VolumeId string
The ID of this resource.
imageId String
Mandatory if volume is created from image
lastUpdated String
metadataMap Map<String,String>
name String
projectId Double
projectName String
regionId Double
regionName String
size Double
snapshotId String
Mandatory if volume is created from a snapshot
typeName String
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volumeId String
The ID of this resource.
imageId string
Mandatory if volume is created from image
lastUpdated string
metadataMap {[key: string]: string}
name string
projectId number
projectName string
regionId number
regionName string
size number
snapshotId string
Mandatory if volume is created from a snapshot
typeName string
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volumeId string
The ID of this resource.
image_id str
Mandatory if volume is created from image
last_updated str
metadata_map Mapping[str, str]
name str
project_id float
project_name str
region_id float
region_name str
size float
snapshot_id str
Mandatory if volume is created from a snapshot
type_name str
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volume_id str
The ID of this resource.
imageId String
Mandatory if volume is created from image
lastUpdated String
metadataMap Map<String>
name String
projectId Number
projectName String
regionId Number
regionName String
size Number
snapshotId String
Mandatory if volume is created from a snapshot
typeName String
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volumeId String
The ID of this resource.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
MetadataReadOnlies List<VolumeMetadataReadOnly>
Id string
The provider-assigned unique ID for this managed resource.
MetadataReadOnlies []VolumeMetadataReadOnly
id String
The provider-assigned unique ID for this managed resource.
metadataReadOnlies List<VolumeMetadataReadOnly>
id string
The provider-assigned unique ID for this managed resource.
metadataReadOnlies VolumeMetadataReadOnly[]
id str
The provider-assigned unique ID for this managed resource.
metadata_read_onlies Sequence[VolumeMetadataReadOnly]
id String
The provider-assigned unique ID for this managed resource.
metadataReadOnlies List<Property Map>

Look up 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,
        image_id: Optional[str] = None,
        last_updated: Optional[str] = None,
        metadata_map: Optional[Mapping[str, str]] = None,
        metadata_read_onlies: Optional[Sequence[VolumeMetadataReadOnlyArgs]] = None,
        name: Optional[str] = None,
        project_id: Optional[float] = None,
        project_name: Optional[str] = None,
        region_id: Optional[float] = None,
        region_name: Optional[str] = None,
        size: Optional[float] = None,
        snapshot_id: Optional[str] = None,
        type_name: Optional[str] = None,
        volume_id: Optional[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)
public static Volume get(String name, Output<String> id, VolumeState state, CustomResourceOptions options)
resources:  _:    type: gcorelabs:Volume    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:
ImageId string
Mandatory if volume is created from image
LastUpdated string
MetadataMap Dictionary<string, string>
MetadataReadOnlies List<VolumeMetadataReadOnly>
Name string
ProjectId double
ProjectName string
RegionId double
RegionName string
Size double
SnapshotId string
Mandatory if volume is created from a snapshot
TypeName string
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
VolumeId string
The ID of this resource.
ImageId string
Mandatory if volume is created from image
LastUpdated string
MetadataMap map[string]string
MetadataReadOnlies []VolumeMetadataReadOnlyArgs
Name string
ProjectId float64
ProjectName string
RegionId float64
RegionName string
Size float64
SnapshotId string
Mandatory if volume is created from a snapshot
TypeName string
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
VolumeId string
The ID of this resource.
imageId String
Mandatory if volume is created from image
lastUpdated String
metadataMap Map<String,String>
metadataReadOnlies List<VolumeMetadataReadOnly>
name String
projectId Double
projectName String
regionId Double
regionName String
size Double
snapshotId String
Mandatory if volume is created from a snapshot
typeName String
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volumeId String
The ID of this resource.
imageId string
Mandatory if volume is created from image
lastUpdated string
metadataMap {[key: string]: string}
metadataReadOnlies VolumeMetadataReadOnly[]
name string
projectId number
projectName string
regionId number
regionName string
size number
snapshotId string
Mandatory if volume is created from a snapshot
typeName string
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volumeId string
The ID of this resource.
image_id str
Mandatory if volume is created from image
last_updated str
metadata_map Mapping[str, str]
metadata_read_onlies Sequence[VolumeMetadataReadOnlyArgs]
name str
project_id float
project_name str
region_id float
region_name str
size float
snapshot_id str
Mandatory if volume is created from a snapshot
type_name str
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volume_id str
The ID of this resource.
imageId String
Mandatory if volume is created from image
lastUpdated String
metadataMap Map<String>
metadataReadOnlies List<Property Map>
name String
projectId Number
projectName String
regionId Number
regionName String
size Number
snapshotId String
Mandatory if volume is created from a snapshot
typeName String
Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
volumeId String
The ID of this resource.

Supporting Types

VolumeMetadataReadOnly
, VolumeMetadataReadOnlyArgs

Key This property is required. string
ReadOnly This property is required. bool
Value This property is required. string
Key This property is required. string
ReadOnly This property is required. bool
Value This property is required. string
key This property is required. String
readOnly This property is required. Boolean
value This property is required. String
key This property is required. string
readOnly This property is required. boolean
value This property is required. string
key This property is required. str
read_only This property is required. bool
value This property is required. str
key This property is required. String
readOnly This property is required. Boolean
value This property is required. String

Import

import using <project_id>:<region_id>:<volume_id> format

$ pulumi import gcorelabs:index/volume:Volume volume1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
Copy

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

Package Details

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