vultr.BlockStorage
Explore with Pulumi AI
Provides a Vultr Block Storage resource. This can be used to create, read, modify, and delete Block Storage.
Example Usage
Create a new Block Storage
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const myBlockstorage = new vultr.BlockStorage("myBlockstorage", {
label: "vultr-block-storage",
region: "ewr",
sizeGb: 10,
});
import pulumi
import ediri_vultr as vultr
my_blockstorage = vultr.BlockStorage("myBlockstorage",
label="vultr-block-storage",
region="ewr",
size_gb=10)
package main
import (
"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vultr.NewBlockStorage(ctx, "myBlockstorage", &vultr.BlockStorageArgs{
Label: pulumi.String("vultr-block-storage"),
Region: pulumi.String("ewr"),
SizeGb: pulumi.Int(10),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = ediri.Vultr;
return await Deployment.RunAsync(() =>
{
var myBlockstorage = new Vultr.BlockStorage("myBlockstorage", new()
{
Label = "vultr-block-storage",
Region = "ewr",
SizeGb = 10,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.BlockStorage;
import com.pulumi.vultr.BlockStorageArgs;
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 myBlockstorage = new BlockStorage("myBlockstorage", BlockStorageArgs.builder()
.label("vultr-block-storage")
.region("ewr")
.sizeGb(10)
.build());
}
}
resources:
myBlockstorage:
type: vultr:BlockStorage
properties:
label: vultr-block-storage
region: ewr
sizeGb: 10
Create BlockStorage Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BlockStorage(name: string, args: BlockStorageArgs, opts?: CustomResourceOptions);
@overload
def BlockStorage(resource_name: str,
args: BlockStorageArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BlockStorage(resource_name: str,
opts: Optional[ResourceOptions] = None,
region: Optional[str] = None,
size_gb: Optional[int] = None,
attached_to_instance: Optional[str] = None,
block_type: Optional[str] = None,
label: Optional[str] = None,
live: Optional[bool] = None)
func NewBlockStorage(ctx *Context, name string, args BlockStorageArgs, opts ...ResourceOption) (*BlockStorage, error)
public BlockStorage(string name, BlockStorageArgs args, CustomResourceOptions? opts = null)
public BlockStorage(String name, BlockStorageArgs args)
public BlockStorage(String name, BlockStorageArgs args, CustomResourceOptions options)
type: vultr:BlockStorage
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 BlockStorageArgs
- 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 BlockStorageArgs
- 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 BlockStorageArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BlockStorageArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BlockStorageArgs
- 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 blockStorageResource = new Vultr.BlockStorage("blockStorageResource", new()
{
Region = "string",
SizeGb = 0,
AttachedToInstance = "string",
BlockType = "string",
Label = "string",
Live = false,
});
example, err := vultr.NewBlockStorage(ctx, "blockStorageResource", &vultr.BlockStorageArgs{
Region: pulumi.String("string"),
SizeGb: pulumi.Int(0),
AttachedToInstance: pulumi.String("string"),
BlockType: pulumi.String("string"),
Label: pulumi.String("string"),
Live: pulumi.Bool(false),
})
var blockStorageResource = new BlockStorage("blockStorageResource", BlockStorageArgs.builder()
.region("string")
.sizeGb(0)
.attachedToInstance("string")
.blockType("string")
.label("string")
.live(false)
.build());
block_storage_resource = vultr.BlockStorage("blockStorageResource",
region="string",
size_gb=0,
attached_to_instance="string",
block_type="string",
label="string",
live=False)
const blockStorageResource = new vultr.BlockStorage("blockStorageResource", {
region: "string",
sizeGb: 0,
attachedToInstance: "string",
blockType: "string",
label: "string",
live: false,
});
type: vultr:BlockStorage
properties:
attachedToInstance: string
blockType: string
label: string
live: false
region: string
sizeGb: 0
BlockStorage 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 BlockStorage resource accepts the following input properties:
- Region string
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- Size
Gb int - The size of the given block storage.
- Attached
To stringInstance - VPS ID that you want to have this block storage attached to.
- Block
Type string - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - Label string
- Label that is given to your block storage.
- Live bool
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- Region string
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- Size
Gb int - The size of the given block storage.
- Attached
To stringInstance - VPS ID that you want to have this block storage attached to.
- Block
Type string - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - Label string
- Label that is given to your block storage.
- Live bool
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- region String
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size
Gb Integer - The size of the given block storage.
- attached
To StringInstance - VPS ID that you want to have this block storage attached to.
- block
Type String - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - label String
- Label that is given to your block storage.
- live Boolean
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- region string
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size
Gb number - The size of the given block storage.
- attached
To stringInstance - VPS ID that you want to have this block storage attached to.
- block
Type string - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - label string
- Label that is given to your block storage.
- live boolean
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- region str
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size_
gb int - The size of the given block storage.
- attached_
to_ strinstance - VPS ID that you want to have this block storage attached to.
- block_
type str - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - label str
- Label that is given to your block storage.
- live bool
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- region String
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size
Gb Number - The size of the given block storage.
- attached
To StringInstance - VPS ID that you want to have this block storage attached to.
- block
Type String - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - label String
- Label that is given to your block storage.
- live Boolean
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
Outputs
All input properties are implicitly available as output properties. Additionally, the BlockStorage resource produces the following output properties:
- Cost double
- The monthly cost of this block storage.
- Date
Created string - The date this block storage was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Mount
Id string - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- Status string
- Current status of your block storage.
- Cost float64
- The monthly cost of this block storage.
- Date
Created string - The date this block storage was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Mount
Id string - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- Status string
- Current status of your block storage.
- cost Double
- The monthly cost of this block storage.
- date
Created String - The date this block storage was created.
- id String
- The provider-assigned unique ID for this managed resource.
- mount
Id String - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- status String
- Current status of your block storage.
- cost number
- The monthly cost of this block storage.
- date
Created string - The date this block storage was created.
- id string
- The provider-assigned unique ID for this managed resource.
- mount
Id string - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- status string
- Current status of your block storage.
- cost float
- The monthly cost of this block storage.
- date_
created str - The date this block storage was created.
- id str
- The provider-assigned unique ID for this managed resource.
- mount_
id str - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- status str
- Current status of your block storage.
- cost Number
- The monthly cost of this block storage.
- date
Created String - The date this block storage was created.
- id String
- The provider-assigned unique ID for this managed resource.
- mount
Id String - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- status String
- Current status of your block storage.
Look up Existing BlockStorage Resource
Get an existing BlockStorage 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?: BlockStorageState, opts?: CustomResourceOptions): BlockStorage
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
attached_to_instance: Optional[str] = None,
block_type: Optional[str] = None,
cost: Optional[float] = None,
date_created: Optional[str] = None,
label: Optional[str] = None,
live: Optional[bool] = None,
mount_id: Optional[str] = None,
region: Optional[str] = None,
size_gb: Optional[int] = None,
status: Optional[str] = None) -> BlockStorage
func GetBlockStorage(ctx *Context, name string, id IDInput, state *BlockStorageState, opts ...ResourceOption) (*BlockStorage, error)
public static BlockStorage Get(string name, Input<string> id, BlockStorageState? state, CustomResourceOptions? opts = null)
public static BlockStorage get(String name, Output<String> id, BlockStorageState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Attached
To stringInstance - VPS ID that you want to have this block storage attached to.
- Block
Type string - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - Cost double
- The monthly cost of this block storage.
- Date
Created string - The date this block storage was created.
- Label string
- Label that is given to your block storage.
- Live bool
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- Mount
Id string - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- Region string
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- Size
Gb int - The size of the given block storage.
- Status string
- Current status of your block storage.
- Attached
To stringInstance - VPS ID that you want to have this block storage attached to.
- Block
Type string - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - Cost float64
- The monthly cost of this block storage.
- Date
Created string - The date this block storage was created.
- Label string
- Label that is given to your block storage.
- Live bool
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- Mount
Id string - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- Region string
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- Size
Gb int - The size of the given block storage.
- Status string
- Current status of your block storage.
- attached
To StringInstance - VPS ID that you want to have this block storage attached to.
- block
Type String - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - cost Double
- The monthly cost of this block storage.
- date
Created String - The date this block storage was created.
- label String
- Label that is given to your block storage.
- live Boolean
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- mount
Id String - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- region String
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size
Gb Integer - The size of the given block storage.
- status String
- Current status of your block storage.
- attached
To stringInstance - VPS ID that you want to have this block storage attached to.
- block
Type string - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - cost number
- The monthly cost of this block storage.
- date
Created string - The date this block storage was created.
- label string
- Label that is given to your block storage.
- live boolean
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- mount
Id string - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- region string
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size
Gb number - The size of the given block storage.
- status string
- Current status of your block storage.
- attached_
to_ strinstance - VPS ID that you want to have this block storage attached to.
- block_
type str - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - cost float
- The monthly cost of this block storage.
- date_
created str - The date this block storage was created.
- label str
- Label that is given to your block storage.
- live bool
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- mount_
id str - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- region str
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size_
gb int - The size of the given block storage.
- status str
- Current status of your block storage.
- attached
To StringInstance - VPS ID that you want to have this block storage attached to.
- block
Type String - Determines on the type of block storage volume that will be created. Soon to become a required parameter. Options are
high_perf
orstorage_opt
. - cost Number
- The monthly cost of this block storage.
- date
Created String - The date this block storage was created.
- label String
- Label that is given to your block storage.
- live Boolean
- Boolean value that will allow attachment of the volume to an instance without a restart. Default is false.
- mount
Id String - An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
- region String
- Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr")
- size
Gb Number - The size of the given block storage.
- status String
- Current status of your block storage.
Import
Block Storage can be imported using the Block Storage ID
, e.g.
$ pulumi import vultr:index/blockStorage:BlockStorage my_blockstorage e315835e-d466-4e89-9b4c-dfd8788d7685
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.