1. Packages
  2. Scaleway
  3. API Docs
  4. InstanceVolume
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

scaleway.InstanceVolume

Explore with Pulumi AI

scaleway logo
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

    Creates and manages Scaleway compute Instance Volumes. For more information, see the documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const serverVolume = new scaleway.InstanceVolume("serverVolume", {
        sizeInGb: 20,
        type: "l_ssd",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    server_volume = scaleway.InstanceVolume("serverVolume",
        size_in_gb=20,
        type="l_ssd")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.NewInstanceVolume(ctx, "serverVolume", &scaleway.InstanceVolumeArgs{
    			SizeInGb: pulumi.Int(20),
    			Type:     pulumi.String("l_ssd"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var serverVolume = new Scaleway.InstanceVolume("serverVolume", new()
        {
            SizeInGb = 20,
            Type = "l_ssd",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.InstanceVolume;
    import com.pulumi.scaleway.InstanceVolumeArgs;
    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 serverVolume = new InstanceVolume("serverVolume", InstanceVolumeArgs.builder()        
                .sizeInGb(20)
                .type("l_ssd")
                .build());
    
        }
    }
    
    resources:
      serverVolume:
        type: scaleway:InstanceVolume
        properties:
          sizeInGb: 20
          type: l_ssd
    

    Create InstanceVolume Resource

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

    Constructor syntax

    new InstanceVolume(name: string, args: InstanceVolumeArgs, opts?: CustomResourceOptions);
    @overload
    def InstanceVolume(resource_name: str,
                       args: InstanceVolumeArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def InstanceVolume(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       type: Optional[str] = None,
                       from_snapshot_id: Optional[str] = None,
                       name: Optional[str] = None,
                       project_id: Optional[str] = None,
                       size_in_gb: Optional[int] = None,
                       tags: Optional[Sequence[str]] = None,
                       zone: Optional[str] = None)
    func NewInstanceVolume(ctx *Context, name string, args InstanceVolumeArgs, opts ...ResourceOption) (*InstanceVolume, error)
    public InstanceVolume(string name, InstanceVolumeArgs args, CustomResourceOptions? opts = null)
    public InstanceVolume(String name, InstanceVolumeArgs args)
    public InstanceVolume(String name, InstanceVolumeArgs args, CustomResourceOptions options)
    
    type: scaleway:InstanceVolume
    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 InstanceVolumeArgs
    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 InstanceVolumeArgs
    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 InstanceVolumeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceVolumeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceVolumeArgs
    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 instanceVolumeResource = new Scaleway.InstanceVolume("instanceVolumeResource", new()
    {
        Type = "string",
        FromSnapshotId = "string",
        Name = "string",
        ProjectId = "string",
        SizeInGb = 0,
        Tags = new[]
        {
            "string",
        },
        Zone = "string",
    });
    
    example, err := scaleway.NewInstanceVolume(ctx, "instanceVolumeResource", &scaleway.InstanceVolumeArgs{
    	Type:           pulumi.String("string"),
    	FromSnapshotId: pulumi.String("string"),
    	Name:           pulumi.String("string"),
    	ProjectId:      pulumi.String("string"),
    	SizeInGb:       pulumi.Int(0),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Zone: pulumi.String("string"),
    })
    
    var instanceVolumeResource = new InstanceVolume("instanceVolumeResource", InstanceVolumeArgs.builder()
        .type("string")
        .fromSnapshotId("string")
        .name("string")
        .projectId("string")
        .sizeInGb(0)
        .tags("string")
        .zone("string")
        .build());
    
    instance_volume_resource = scaleway.InstanceVolume("instanceVolumeResource",
        type="string",
        from_snapshot_id="string",
        name="string",
        project_id="string",
        size_in_gb=0,
        tags=["string"],
        zone="string")
    
    const instanceVolumeResource = new scaleway.InstanceVolume("instanceVolumeResource", {
        type: "string",
        fromSnapshotId: "string",
        name: "string",
        projectId: "string",
        sizeInGb: 0,
        tags: ["string"],
        zone: "string",
    });
    
    type: scaleway:InstanceVolume
    properties:
        fromSnapshotId: string
        name: string
        projectId: string
        sizeInGb: 0
        tags:
            - string
        type: string
        zone: string
    

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

    Type string
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    FromSnapshotId string
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    Name string
    The name of the volume. If not provided it will be randomly generated.
    ProjectId string
    project_id) The ID of the project the volume is associated with.
    SizeInGb int
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    Tags List<string>
    A list of tags to apply to the volume.
    Zone string
    zone) The zone in which the volume should be created.
    Type string
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    FromSnapshotId string
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    Name string
    The name of the volume. If not provided it will be randomly generated.
    ProjectId string
    project_id) The ID of the project the volume is associated with.
    SizeInGb int
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    Tags []string
    A list of tags to apply to the volume.
    Zone string
    zone) The zone in which the volume should be created.
    type String
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    fromSnapshotId String
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name String
    The name of the volume. If not provided it will be randomly generated.
    projectId String
    project_id) The ID of the project the volume is associated with.
    sizeInGb Integer
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags List<String>
    A list of tags to apply to the volume.
    zone String
    zone) The zone in which the volume should be created.
    type string
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    fromSnapshotId string
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name string
    The name of the volume. If not provided it will be randomly generated.
    projectId string
    project_id) The ID of the project the volume is associated with.
    sizeInGb number
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags string[]
    A list of tags to apply to the volume.
    zone string
    zone) The zone in which the volume should be created.
    type str
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    from_snapshot_id str
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name str
    The name of the volume. If not provided it will be randomly generated.
    project_id str
    project_id) The ID of the project the volume is associated with.
    size_in_gb int
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags Sequence[str]
    A list of tags to apply to the volume.
    zone str
    zone) The zone in which the volume should be created.
    type String
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    fromSnapshotId String
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name String
    The name of the volume. If not provided it will be randomly generated.
    projectId String
    project_id) The ID of the project the volume is associated with.
    sizeInGb Number
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags List<String>
    A list of tags to apply to the volume.
    zone String
    zone) The zone in which the volume should be created.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The organization ID the volume is associated with.
    ServerId string
    The id of the associated server.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrganizationId string
    The organization ID the volume is associated with.
    ServerId string
    The id of the associated server.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The organization ID the volume is associated with.
    serverId String
    The id of the associated server.
    id string
    The provider-assigned unique ID for this managed resource.
    organizationId string
    The organization ID the volume is associated with.
    serverId string
    The id of the associated server.
    id str
    The provider-assigned unique ID for this managed resource.
    organization_id str
    The organization ID the volume is associated with.
    server_id str
    The id of the associated server.
    id String
    The provider-assigned unique ID for this managed resource.
    organizationId String
    The organization ID the volume is associated with.
    serverId String
    The id of the associated server.

    Look up Existing InstanceVolume Resource

    Get an existing InstanceVolume 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?: InstanceVolumeState, opts?: CustomResourceOptions): InstanceVolume
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            from_snapshot_id: Optional[str] = None,
            name: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            server_id: Optional[str] = None,
            size_in_gb: Optional[int] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None,
            zone: Optional[str] = None) -> InstanceVolume
    func GetInstanceVolume(ctx *Context, name string, id IDInput, state *InstanceVolumeState, opts ...ResourceOption) (*InstanceVolume, error)
    public static InstanceVolume Get(string name, Input<string> id, InstanceVolumeState? state, CustomResourceOptions? opts = null)
    public static InstanceVolume get(String name, Output<String> id, InstanceVolumeState 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:
    FromSnapshotId string
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    Name string
    The name of the volume. If not provided it will be randomly generated.
    OrganizationId string
    The organization ID the volume is associated with.
    ProjectId string
    project_id) The ID of the project the volume is associated with.
    ServerId string
    The id of the associated server.
    SizeInGb int
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    Tags List<string>
    A list of tags to apply to the volume.
    Type string
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    Zone string
    zone) The zone in which the volume should be created.
    FromSnapshotId string
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    Name string
    The name of the volume. If not provided it will be randomly generated.
    OrganizationId string
    The organization ID the volume is associated with.
    ProjectId string
    project_id) The ID of the project the volume is associated with.
    ServerId string
    The id of the associated server.
    SizeInGb int
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    Tags []string
    A list of tags to apply to the volume.
    Type string
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    Zone string
    zone) The zone in which the volume should be created.
    fromSnapshotId String
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name String
    The name of the volume. If not provided it will be randomly generated.
    organizationId String
    The organization ID the volume is associated with.
    projectId String
    project_id) The ID of the project the volume is associated with.
    serverId String
    The id of the associated server.
    sizeInGb Integer
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags List<String>
    A list of tags to apply to the volume.
    type String
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    zone String
    zone) The zone in which the volume should be created.
    fromSnapshotId string
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name string
    The name of the volume. If not provided it will be randomly generated.
    organizationId string
    The organization ID the volume is associated with.
    projectId string
    project_id) The ID of the project the volume is associated with.
    serverId string
    The id of the associated server.
    sizeInGb number
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags string[]
    A list of tags to apply to the volume.
    type string
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    zone string
    zone) The zone in which the volume should be created.
    from_snapshot_id str
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name str
    The name of the volume. If not provided it will be randomly generated.
    organization_id str
    The organization ID the volume is associated with.
    project_id str
    project_id) The ID of the project the volume is associated with.
    server_id str
    The id of the associated server.
    size_in_gb int
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags Sequence[str]
    A list of tags to apply to the volume.
    type str
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    zone str
    zone) The zone in which the volume should be created.
    fromSnapshotId String
    If set, the new volume will be created from this snapshot. Only one of size_in_gb and from_snapshot_id should be specified.
    name String
    The name of the volume. If not provided it will be randomly generated.
    organizationId String
    The organization ID the volume is associated with.
    projectId String
    project_id) The ID of the project the volume is associated with.
    serverId String
    The id of the associated server.
    sizeInGb Number
    The size of the volume. Only one of size_in_gb and from_snapshot_id should be specified.
    tags List<String>
    A list of tags to apply to the volume.
    type String
    The type of the volume. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD), scratch (Local Scratch SSD).
    zone String
    zone) The zone in which the volume should be created.

    Import

    volumes can be imported using the {zone}/{id}, e.g.

    bash

    $ pulumi import scaleway:index/instanceVolume:InstanceVolume server_volume fr-par-1/11111111-1111-1111-1111-111111111111
    

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

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse