1. Packages
  2. Scaleway
  3. API Docs
  4. BlockSnapshot
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.BlockSnapshot

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    The scaleway.BlockSnapshot resource is used to create and manage snapshots of Block Storage volumes.

    Refer to the Block Storage product documentation and API documentation for more information.

    Example Usage

    Create a snapshot of a Block Storage volume

    The following command allows you to create a snapshot (some-snapshot-name) from a Block Storage volume specified by its ID.

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const blockVolume = new scaleway.BlockVolume("block_volume", {
        iops: 5000,
        name: "some-volume-name",
        sizeInGb: 20,
    });
    const blockSnapshot = new scaleway.BlockSnapshot("block_snapshot", {
        name: "some-snapshot-name",
        volumeId: blockVolume.id,
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    block_volume = scaleway.BlockVolume("block_volume",
        iops=5000,
        name="some-volume-name",
        size_in_gb=20)
    block_snapshot = scaleway.BlockSnapshot("block_snapshot",
        name="some-snapshot-name",
        volume_id=block_volume.id)
    
    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 {
    		blockVolume, err := scaleway.NewBlockVolume(ctx, "block_volume", &scaleway.BlockVolumeArgs{
    			Iops:     pulumi.Int(5000),
    			Name:     pulumi.String("some-volume-name"),
    			SizeInGb: pulumi.Int(20),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewBlockSnapshot(ctx, "block_snapshot", &scaleway.BlockSnapshotArgs{
    			Name:     pulumi.String("some-snapshot-name"),
    			VolumeId: blockVolume.ID(),
    		})
    		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 blockVolume = new Scaleway.BlockVolume("block_volume", new()
        {
            Iops = 5000,
            Name = "some-volume-name",
            SizeInGb = 20,
        });
    
        var blockSnapshot = new Scaleway.BlockSnapshot("block_snapshot", new()
        {
            Name = "some-snapshot-name",
            VolumeId = blockVolume.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.BlockVolume;
    import com.pulumi.scaleway.BlockVolumeArgs;
    import com.pulumi.scaleway.BlockSnapshot;
    import com.pulumi.scaleway.BlockSnapshotArgs;
    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 blockVolume = new BlockVolume("blockVolume", BlockVolumeArgs.builder()
                .iops(5000)
                .name("some-volume-name")
                .sizeInGb(20)
                .build());
    
            var blockSnapshot = new BlockSnapshot("blockSnapshot", BlockSnapshotArgs.builder()
                .name("some-snapshot-name")
                .volumeId(blockVolume.id())
                .build());
    
        }
    }
    
    resources:
      blockVolume:
        type: scaleway:BlockVolume
        name: block_volume
        properties:
          iops: 5000
          name: some-volume-name
          sizeInGb: 20
      blockSnapshot:
        type: scaleway:BlockSnapshot
        name: block_snapshot
        properties:
          name: some-snapshot-name
          volumeId: ${blockVolume.id}
    

    Create BlockSnapshot Resource

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

    Constructor syntax

    new BlockSnapshot(name: string, args: BlockSnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def BlockSnapshot(resource_name: str,
                      args: BlockSnapshotArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def BlockSnapshot(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      volume_id: Optional[str] = None,
                      name: Optional[str] = None,
                      project_id: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None,
                      zone: Optional[str] = None)
    func NewBlockSnapshot(ctx *Context, name string, args BlockSnapshotArgs, opts ...ResourceOption) (*BlockSnapshot, error)
    public BlockSnapshot(string name, BlockSnapshotArgs args, CustomResourceOptions? opts = null)
    public BlockSnapshot(String name, BlockSnapshotArgs args)
    public BlockSnapshot(String name, BlockSnapshotArgs args, CustomResourceOptions options)
    
    type: scaleway:BlockSnapshot
    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 BlockSnapshotArgs
    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 BlockSnapshotArgs
    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 BlockSnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BlockSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BlockSnapshotArgs
    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 blockSnapshotResource = new Scaleway.BlockSnapshot("blockSnapshotResource", new()
    {
        VolumeId = "string",
        Name = "string",
        ProjectId = "string",
        Tags = new[]
        {
            "string",
        },
        Zone = "string",
    });
    
    example, err := scaleway.NewBlockSnapshot(ctx, "blockSnapshotResource", &scaleway.BlockSnapshotArgs{
    	VolumeId:  pulumi.String("string"),
    	Name:      pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Zone: pulumi.String("string"),
    })
    
    var blockSnapshotResource = new BlockSnapshot("blockSnapshotResource", BlockSnapshotArgs.builder()
        .volumeId("string")
        .name("string")
        .projectId("string")
        .tags("string")
        .zone("string")
        .build());
    
    block_snapshot_resource = scaleway.BlockSnapshot("blockSnapshotResource",
        volume_id="string",
        name="string",
        project_id="string",
        tags=["string"],
        zone="string")
    
    const blockSnapshotResource = new scaleway.BlockSnapshot("blockSnapshotResource", {
        volumeId: "string",
        name: "string",
        projectId: "string",
        tags: ["string"],
        zone: "string",
    });
    
    type: scaleway:BlockSnapshot
    properties:
        name: string
        projectId: string
        tags:
            - string
        volumeId: string
        zone: string
    

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

    VolumeId string
    The ID of the volume to take a snapshot from.
    Name string
    The name of the snapshot. If not provided, a name will be randomly generated.
    ProjectId string
    ). The ID of the Scaleway Project the snapshot is associated with.
    Tags List<string>
    A list of tags to apply to the snapshot.
    Zone string
    ). The zone in which the snapshot should be created.
    VolumeId string
    The ID of the volume to take a snapshot from.
    Name string
    The name of the snapshot. If not provided, a name will be randomly generated.
    ProjectId string
    ). The ID of the Scaleway Project the snapshot is associated with.
    Tags []string
    A list of tags to apply to the snapshot.
    Zone string
    ). The zone in which the snapshot should be created.
    volumeId String
    The ID of the volume to take a snapshot from.
    name String
    The name of the snapshot. If not provided, a name will be randomly generated.
    projectId String
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags List<String>
    A list of tags to apply to the snapshot.
    zone String
    ). The zone in which the snapshot should be created.
    volumeId string
    The ID of the volume to take a snapshot from.
    name string
    The name of the snapshot. If not provided, a name will be randomly generated.
    projectId string
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags string[]
    A list of tags to apply to the snapshot.
    zone string
    ). The zone in which the snapshot should be created.
    volume_id str
    The ID of the volume to take a snapshot from.
    name str
    The name of the snapshot. If not provided, a name will be randomly generated.
    project_id str
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags Sequence[str]
    A list of tags to apply to the snapshot.
    zone str
    ). The zone in which the snapshot should be created.
    volumeId String
    The ID of the volume to take a snapshot from.
    name String
    The name of the snapshot. If not provided, a name will be randomly generated.
    projectId String
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags List<String>
    A list of tags to apply to the snapshot.
    zone String
    ). The zone in which the snapshot should be created.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing BlockSnapshot Resource

    Get an existing BlockSnapshot 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?: BlockSnapshotState, opts?: CustomResourceOptions): BlockSnapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            volume_id: Optional[str] = None,
            zone: Optional[str] = None) -> BlockSnapshot
    func GetBlockSnapshot(ctx *Context, name string, id IDInput, state *BlockSnapshotState, opts ...ResourceOption) (*BlockSnapshot, error)
    public static BlockSnapshot Get(string name, Input<string> id, BlockSnapshotState? state, CustomResourceOptions? opts = null)
    public static BlockSnapshot get(String name, Output<String> id, BlockSnapshotState 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:
    Name string
    The name of the snapshot. If not provided, a name will be randomly generated.
    ProjectId string
    ). The ID of the Scaleway Project the snapshot is associated with.
    Tags List<string>
    A list of tags to apply to the snapshot.
    VolumeId string
    The ID of the volume to take a snapshot from.
    Zone string
    ). The zone in which the snapshot should be created.
    Name string
    The name of the snapshot. If not provided, a name will be randomly generated.
    ProjectId string
    ). The ID of the Scaleway Project the snapshot is associated with.
    Tags []string
    A list of tags to apply to the snapshot.
    VolumeId string
    The ID of the volume to take a snapshot from.
    Zone string
    ). The zone in which the snapshot should be created.
    name String
    The name of the snapshot. If not provided, a name will be randomly generated.
    projectId String
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags List<String>
    A list of tags to apply to the snapshot.
    volumeId String
    The ID of the volume to take a snapshot from.
    zone String
    ). The zone in which the snapshot should be created.
    name string
    The name of the snapshot. If not provided, a name will be randomly generated.
    projectId string
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags string[]
    A list of tags to apply to the snapshot.
    volumeId string
    The ID of the volume to take a snapshot from.
    zone string
    ). The zone in which the snapshot should be created.
    name str
    The name of the snapshot. If not provided, a name will be randomly generated.
    project_id str
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags Sequence[str]
    A list of tags to apply to the snapshot.
    volume_id str
    The ID of the volume to take a snapshot from.
    zone str
    ). The zone in which the snapshot should be created.
    name String
    The name of the snapshot. If not provided, a name will be randomly generated.
    projectId String
    ). The ID of the Scaleway Project the snapshot is associated with.
    tags List<String>
    A list of tags to apply to the snapshot.
    volumeId String
    The ID of the volume to take a snapshot from.
    zone String
    ). The zone in which the snapshot should be created.

    Import

    This section explains how to import the snapshot of a Block Storage volume using the zoned ID format ({zone}/{id}).

    bash

    $ pulumi import scaleway:index/blockSnapshot:BlockSnapshot main 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.20.0 published on Monday, Nov 4, 2024 by pulumiverse