1. Packages
  2. OpenStack
  3. API Docs
  4. blockstorage
  5. VolumeV1
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

openstack.blockstorage.VolumeV1

Explore with Pulumi AI

openstack logo
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

    Manages a V1 volume resource within OpenStack.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const volume1 = new openstack.blockstorage.VolumeV1("volume_1", {
        region: "RegionOne",
        name: "tf-test-volume",
        description: "first test volume",
        size: 3,
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    volume1 = openstack.blockstorage.VolumeV1("volume_1",
        region="RegionOne",
        name="tf-test-volume",
        description="first test volume",
        size=3)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v4/go/openstack/blockstorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := blockstorage.NewVolumeV1(ctx, "volume_1", &blockstorage.VolumeV1Args{
    			Region:      pulumi.String("RegionOne"),
    			Name:        pulumi.String("tf-test-volume"),
    			Description: pulumi.String("first test volume"),
    			Size:        pulumi.Int(3),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var volume1 = new OpenStack.BlockStorage.VolumeV1("volume_1", new()
        {
            Region = "RegionOne",
            Name = "tf-test-volume",
            Description = "first test volume",
            Size = 3,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.blockstorage.VolumeV1;
    import com.pulumi.openstack.blockstorage.VolumeV1Args;
    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 volume1 = new VolumeV1("volume1", VolumeV1Args.builder()        
                .region("RegionOne")
                .name("tf-test-volume")
                .description("first test volume")
                .size(3)
                .build());
    
        }
    }
    
    resources:
      volume1:
        type: openstack:blockstorage:VolumeV1
        name: volume_1
        properties:
          region: RegionOne
          name: tf-test-volume
          description: first test volume
          size: 3
    

    Create VolumeV1 Resource

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

    Constructor syntax

    new VolumeV1(name: string, args: VolumeV1Args, opts?: CustomResourceOptions);
    @overload
    def VolumeV1(resource_name: str,
                 args: VolumeV1Args,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def VolumeV1(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 size: Optional[int] = None,
                 availability_zone: Optional[str] = None,
                 description: Optional[str] = None,
                 image_id: Optional[str] = None,
                 metadata: Optional[Mapping[str, Any]] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 snapshot_id: Optional[str] = None,
                 source_vol_id: Optional[str] = None,
                 volume_type: Optional[str] = None)
    func NewVolumeV1(ctx *Context, name string, args VolumeV1Args, opts ...ResourceOption) (*VolumeV1, error)
    public VolumeV1(string name, VolumeV1Args args, CustomResourceOptions? opts = null)
    public VolumeV1(String name, VolumeV1Args args)
    public VolumeV1(String name, VolumeV1Args args, CustomResourceOptions options)
    
    type: openstack:blockstorage:VolumeV1
    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 VolumeV1Args
    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 VolumeV1Args
    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 VolumeV1Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VolumeV1Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VolumeV1Args
    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 volumeV1Resource = new OpenStack.BlockStorage.VolumeV1("volumeV1Resource", new()
    {
        Size = 0,
        AvailabilityZone = "string",
        Description = "string",
        ImageId = "string",
        Metadata = 
        {
            { "string", "any" },
        },
        Name = "string",
        Region = "string",
        SnapshotId = "string",
        SourceVolId = "string",
        VolumeType = "string",
    });
    
    example, err := blockstorage.NewVolumeV1(ctx, "volumeV1Resource", &blockstorage.VolumeV1Args{
    	Size:             pulumi.Int(0),
    	AvailabilityZone: pulumi.String("string"),
    	Description:      pulumi.String("string"),
    	ImageId:          pulumi.String("string"),
    	Metadata: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	Name:        pulumi.String("string"),
    	Region:      pulumi.String("string"),
    	SnapshotId:  pulumi.String("string"),
    	SourceVolId: pulumi.String("string"),
    	VolumeType:  pulumi.String("string"),
    })
    
    var volumeV1Resource = new VolumeV1("volumeV1Resource", VolumeV1Args.builder()
        .size(0)
        .availabilityZone("string")
        .description("string")
        .imageId("string")
        .metadata(Map.of("string", "any"))
        .name("string")
        .region("string")
        .snapshotId("string")
        .sourceVolId("string")
        .volumeType("string")
        .build());
    
    volume_v1_resource = openstack.blockstorage.VolumeV1("volumeV1Resource",
        size=0,
        availability_zone="string",
        description="string",
        image_id="string",
        metadata={
            "string": "any",
        },
        name="string",
        region="string",
        snapshot_id="string",
        source_vol_id="string",
        volume_type="string")
    
    const volumeV1Resource = new openstack.blockstorage.VolumeV1("volumeV1Resource", {
        size: 0,
        availabilityZone: "string",
        description: "string",
        imageId: "string",
        metadata: {
            string: "any",
        },
        name: "string",
        region: "string",
        snapshotId: "string",
        sourceVolId: "string",
        volumeType: "string",
    });
    
    type: openstack:blockstorage:VolumeV1
    properties:
        availabilityZone: string
        description: string
        imageId: string
        metadata:
            string: any
        name: string
        region: string
        size: 0
        snapshotId: string
        sourceVolId: string
        volumeType: string
    

    VolumeV1 Resource Properties

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

    Inputs

    The VolumeV1 resource accepts the following input properties:

    Size int
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    AvailabilityZone string
    The availability zone for the volume. Changing this creates a new volume.
    Description string
    A description of the volume. Changing this updates the volume's description.
    ImageId string
    The image ID from which to create the volume. Changing this creates a new volume.
    Metadata Dictionary<string, object>
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    Name string
    A unique name for the volume. Changing this updates the volume's name.
    Region string
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    SnapshotId string
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    SourceVolId string
    The volume ID from which to create the volume. Changing this creates a new volume.
    VolumeType string
    The type of volume to create. Changing this creates a new volume.
    Size int
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    AvailabilityZone string
    The availability zone for the volume. Changing this creates a new volume.
    Description string
    A description of the volume. Changing this updates the volume's description.
    ImageId string
    The image ID from which to create the volume. Changing this creates a new volume.
    Metadata map[string]interface{}
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    Name string
    A unique name for the volume. Changing this updates the volume's name.
    Region string
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    SnapshotId string
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    SourceVolId string
    The volume ID from which to create the volume. Changing this creates a new volume.
    VolumeType string
    The type of volume to create. Changing this creates a new volume.
    size Integer
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    availabilityZone String
    The availability zone for the volume. Changing this creates a new volume.
    description String
    A description of the volume. Changing this updates the volume's description.
    imageId String
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata Map<String,Object>
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name String
    A unique name for the volume. Changing this updates the volume's name.
    region String
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    snapshotId String
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    sourceVolId String
    The volume ID from which to create the volume. Changing this creates a new volume.
    volumeType String
    The type of volume to create. Changing this creates a new volume.
    size number
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    availabilityZone string
    The availability zone for the volume. Changing this creates a new volume.
    description string
    A description of the volume. Changing this updates the volume's description.
    imageId string
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata {[key: string]: any}
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name string
    A unique name for the volume. Changing this updates the volume's name.
    region string
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    snapshotId string
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    sourceVolId string
    The volume ID from which to create the volume. Changing this creates a new volume.
    volumeType string
    The type of volume to create. Changing this creates a new volume.
    size int
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    availability_zone str
    The availability zone for the volume. Changing this creates a new volume.
    description str
    A description of the volume. Changing this updates the volume's description.
    image_id str
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata Mapping[str, Any]
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name str
    A unique name for the volume. Changing this updates the volume's name.
    region str
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    snapshot_id str
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    source_vol_id str
    The volume ID from which to create the volume. Changing this creates a new volume.
    volume_type str
    The type of volume to create. Changing this creates a new volume.
    size Number
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    availabilityZone String
    The availability zone for the volume. Changing this creates a new volume.
    description String
    A description of the volume. Changing this updates the volume's description.
    imageId String
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata Map<Any>
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name String
    A unique name for the volume. Changing this updates the volume's name.
    region String
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    snapshotId String
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    sourceVolId String
    The volume ID from which to create the volume. Changing this creates a new volume.
    volumeType String
    The type of volume to create. Changing this creates a new volume.

    Outputs

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

    Attachments List<Pulumi.OpenStack.BlockStorage.Outputs.VolumeV1Attachment>
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    Id string
    The provider-assigned unique ID for this managed resource.
    Attachments []VolumeV1Attachment
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    Id string
    The provider-assigned unique ID for this managed resource.
    attachments List<VolumeV1Attachment>
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    id String
    The provider-assigned unique ID for this managed resource.
    attachments VolumeV1Attachment[]
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    id string
    The provider-assigned unique ID for this managed resource.
    attachments Sequence[VolumeV1Attachment]
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    id str
    The provider-assigned unique ID for this managed resource.
    attachments List<Property Map>
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VolumeV1 Resource

    Get an existing VolumeV1 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?: VolumeV1State, opts?: CustomResourceOptions): VolumeV1
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            attachments: Optional[Sequence[VolumeV1AttachmentArgs]] = None,
            availability_zone: Optional[str] = None,
            description: Optional[str] = None,
            image_id: Optional[str] = None,
            metadata: Optional[Mapping[str, Any]] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            size: Optional[int] = None,
            snapshot_id: Optional[str] = None,
            source_vol_id: Optional[str] = None,
            volume_type: Optional[str] = None) -> VolumeV1
    func GetVolumeV1(ctx *Context, name string, id IDInput, state *VolumeV1State, opts ...ResourceOption) (*VolumeV1, error)
    public static VolumeV1 Get(string name, Input<string> id, VolumeV1State? state, CustomResourceOptions? opts = null)
    public static VolumeV1 get(String name, Output<String> id, VolumeV1State 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.
    The following state arguments are supported:
    Attachments List<Pulumi.OpenStack.BlockStorage.Inputs.VolumeV1Attachment>
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    AvailabilityZone string
    The availability zone for the volume. Changing this creates a new volume.
    Description string
    A description of the volume. Changing this updates the volume's description.
    ImageId string
    The image ID from which to create the volume. Changing this creates a new volume.
    Metadata Dictionary<string, object>
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    Name string
    A unique name for the volume. Changing this updates the volume's name.
    Region string
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    Size int
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    SnapshotId string
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    SourceVolId string
    The volume ID from which to create the volume. Changing this creates a new volume.
    VolumeType string
    The type of volume to create. Changing this creates a new volume.
    Attachments []VolumeV1AttachmentArgs
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    AvailabilityZone string
    The availability zone for the volume. Changing this creates a new volume.
    Description string
    A description of the volume. Changing this updates the volume's description.
    ImageId string
    The image ID from which to create the volume. Changing this creates a new volume.
    Metadata map[string]interface{}
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    Name string
    A unique name for the volume. Changing this updates the volume's name.
    Region string
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    Size int
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    SnapshotId string
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    SourceVolId string
    The volume ID from which to create the volume. Changing this creates a new volume.
    VolumeType string
    The type of volume to create. Changing this creates a new volume.
    attachments List<VolumeV1Attachment>
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    availabilityZone String
    The availability zone for the volume. Changing this creates a new volume.
    description String
    A description of the volume. Changing this updates the volume's description.
    imageId String
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata Map<String,Object>
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name String
    A unique name for the volume. Changing this updates the volume's name.
    region String
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    size Integer
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    snapshotId String
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    sourceVolId String
    The volume ID from which to create the volume. Changing this creates a new volume.
    volumeType String
    The type of volume to create. Changing this creates a new volume.
    attachments VolumeV1Attachment[]
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    availabilityZone string
    The availability zone for the volume. Changing this creates a new volume.
    description string
    A description of the volume. Changing this updates the volume's description.
    imageId string
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata {[key: string]: any}
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name string
    A unique name for the volume. Changing this updates the volume's name.
    region string
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    size number
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    snapshotId string
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    sourceVolId string
    The volume ID from which to create the volume. Changing this creates a new volume.
    volumeType string
    The type of volume to create. Changing this creates a new volume.
    attachments Sequence[VolumeV1AttachmentArgs]
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    availability_zone str
    The availability zone for the volume. Changing this creates a new volume.
    description str
    A description of the volume. Changing this updates the volume's description.
    image_id str
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata Mapping[str, Any]
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name str
    A unique name for the volume. Changing this updates the volume's name.
    region str
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    size int
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    snapshot_id str
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    source_vol_id str
    The volume ID from which to create the volume. Changing this creates a new volume.
    volume_type str
    The type of volume to create. Changing this creates a new volume.
    attachments List<Property Map>
    If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.
    availabilityZone String
    The availability zone for the volume. Changing this creates a new volume.
    description String
    A description of the volume. Changing this updates the volume's description.
    imageId String
    The image ID from which to create the volume. Changing this creates a new volume.
    metadata Map<Any>
    Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.
    name String
    A unique name for the volume. Changing this updates the volume's name.
    region String
    The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.
    size Number
    The size of the volume to create (in gigabytes). Changing this creates a new volume.
    snapshotId String
    The snapshot ID from which to create the volume. Changing this creates a new volume.
    sourceVolId String
    The volume ID from which to create the volume. Changing this creates a new volume.
    volumeType String
    The type of volume to create. Changing this creates a new volume.

    Supporting Types

    VolumeV1Attachment, VolumeV1AttachmentArgs

    Device string
    Id string
    InstanceId string
    Device string
    Id string
    InstanceId string
    device String
    id String
    instanceId String
    device string
    id string
    instanceId string
    device String
    id String
    instanceId String

    Import

    Volumes can be imported using the id, e.g.

    $ pulumi import openstack:blockstorage/volumeV1:VolumeV1 volume_1 ea257959-eeb1-4c10-8d33-26f0409a755d
    

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

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi