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,
});
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)
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
})
}
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,
});
});
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());
}
}
resources:
volume:
type: gcore:gcore_volume
properties:
name: volume_example
typeName: standard
size: 1
regionId: 1
projectId: 1
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 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 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 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 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 String
- The unique name of the resource.
- args 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",
});
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"),
})
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());
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")
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",
});
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
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:
- Image
Id string - Mandatory if volume is created from image
- Last
Updated string - Metadata
Map Dictionary<string, string> - Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Size double
- Snapshot
Id string - Mandatory if volume is created from a snapshot
- Type
Name string - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- Volume
Id string - The ID of this resource.
- Image
Id string - Mandatory if volume is created from image
- Last
Updated string - Metadata
Map map[string]string - Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Size float64
- Snapshot
Id string - Mandatory if volume is created from a snapshot
- Type
Name string - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- Volume
Id string - The ID of this resource.
- image
Id String - Mandatory if volume is created from image
- last
Updated String - metadata
Map Map<String,String> - name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - size Double
- snapshot
Id String - Mandatory if volume is created from a snapshot
- type
Name String - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- volume
Id String - The ID of this resource.
- image
Id string - Mandatory if volume is created from image
- last
Updated string - metadata
Map {[key: string]: string} - name string
- project
Id number - project
Name string - region
Id number - region
Name string - size number
- snapshot
Id string - Mandatory if volume is created from a snapshot
- type
Name string - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- volume
Id 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.
- image
Id String - Mandatory if volume is created from image
- last
Updated String - metadata
Map Map<String> - name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - size Number
- snapshot
Id String - Mandatory if volume is created from a snapshot
- type
Name String - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- volume
Id 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.
- Metadata
Read List<VolumeOnlies Metadata Read Only>
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata
Read []VolumeOnlies Metadata Read Only
- id String
- The provider-assigned unique ID for this managed resource.
- metadata
Read List<VolumeOnlies Metadata Read Only>
- id string
- The provider-assigned unique ID for this managed resource.
- metadata
Read VolumeOnlies Metadata Read Only[]
- id str
- The provider-assigned unique ID for this managed resource.
- metadata_
read_ Sequence[Volumeonlies Metadata Read Only]
- id String
- The provider-assigned unique ID for this managed resource.
- metadata
Read List<Property Map>Onlies
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
- 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.
- 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.
- Image
Id string - Mandatory if volume is created from image
- Last
Updated string - Metadata
Map Dictionary<string, string> - Metadata
Read List<VolumeOnlies Metadata Read Only> - Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Size double
- Snapshot
Id string - Mandatory if volume is created from a snapshot
- Type
Name string - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- Volume
Id string - The ID of this resource.
- Image
Id string - Mandatory if volume is created from image
- Last
Updated string - Metadata
Map map[string]string - Metadata
Read []VolumeOnlies Metadata Read Only Args - Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Size float64
- Snapshot
Id string - Mandatory if volume is created from a snapshot
- Type
Name string - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- Volume
Id string - The ID of this resource.
- image
Id String - Mandatory if volume is created from image
- last
Updated String - metadata
Map Map<String,String> - metadata
Read List<VolumeOnlies Metadata Read Only> - name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - size Double
- snapshot
Id String - Mandatory if volume is created from a snapshot
- type
Name String - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- volume
Id String - The ID of this resource.
- image
Id string - Mandatory if volume is created from image
- last
Updated string - metadata
Map {[key: string]: string} - metadata
Read VolumeOnlies Metadata Read Only[] - name string
- project
Id number - project
Name string - region
Id number - region
Name string - size number
- snapshot
Id string - Mandatory if volume is created from a snapshot
- type
Name string - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- volume
Id 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_ Sequence[Volumeonlies Metadata Read Only Args] - 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.
- image
Id String - Mandatory if volume is created from image
- last
Updated String - metadata
Map Map<String> - metadata
Read List<Property Map>Onlies - name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - size Number
- snapshot
Id String - Mandatory if volume is created from a snapshot
- type
Name String - Available value is 'standard', 'ssd_hiiops', 'cold', 'ultra'. Defaults to standard
- volume
Id String - The ID of this resource.
Supporting Types
VolumeMetadataReadOnly, VolumeMetadataReadOnlyArgs
Import
import using <project_id>:<region_id>:<volume_id> format
$ pulumi import gcorelabs:index/volume:Volume volume1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
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.