1. Packages
  2. Scaleway
  3. API Docs
  4. InstanceSnapshot
Scaleway v1.10.0 published on Saturday, Jul 1, 2023 by lbrlabs

scaleway.InstanceSnapshot

Explore with Pulumi AI

scaleway logo
Scaleway v1.10.0 published on Saturday, Jul 1, 2023 by lbrlabs

    Creates and manages Scaleway Compute Snapshots. For more information, see the documentation.

    Example

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@lbrlabs/pulumi-scaleway";
    
    const main = new scaleway.InstanceSnapshot("main", {volumeId: "11111111-1111-1111-1111-111111111111"});
    
    import pulumi
    import lbrlabs_pulumi_scaleway as scaleway
    
    main = scaleway.InstanceSnapshot("main", volume_id="11111111-1111-1111-1111-111111111111")
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.InstanceSnapshot("main", new()
        {
            VolumeId = "11111111-1111-1111-1111-111111111111",
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.NewInstanceSnapshot(ctx, "main", &scaleway.InstanceSnapshotArgs{
    			VolumeId: pulumi.String("11111111-1111-1111-1111-111111111111"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.InstanceSnapshot;
    import com.pulumi.scaleway.InstanceSnapshotArgs;
    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 main = new InstanceSnapshot("main", InstanceSnapshotArgs.builder()        
                .volumeId("11111111-1111-1111-1111-111111111111")
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:InstanceSnapshot
        properties:
          volumeId: 11111111-1111-1111-1111-111111111111
    

    Example with Unified type

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@lbrlabs/pulumi-scaleway";
    
    const mainInstanceVolume = new scaleway.InstanceVolume("mainInstanceVolume", {
        type: "l_ssd",
        sizeInGb: 10,
    });
    const mainInstanceServer = new scaleway.InstanceServer("mainInstanceServer", {
        image: "ubuntu_jammy",
        type: "DEV1-S",
        rootVolume: {
            sizeInGb: 10,
            volumeType: "l_ssd",
        },
        additionalVolumeIds: [mainInstanceVolume.id],
    });
    const mainInstanceSnapshot = new scaleway.InstanceSnapshot("mainInstanceSnapshot", {
        volumeId: mainInstanceVolume.id,
        type: "unified",
    }, {
        dependsOn: [mainInstanceServer],
    });
    
    import pulumi
    import lbrlabs_pulumi_scaleway as scaleway
    
    main_instance_volume = scaleway.InstanceVolume("mainInstanceVolume",
        type="l_ssd",
        size_in_gb=10)
    main_instance_server = scaleway.InstanceServer("mainInstanceServer",
        image="ubuntu_jammy",
        type="DEV1-S",
        root_volume=scaleway.InstanceServerRootVolumeArgs(
            size_in_gb=10,
            volume_type="l_ssd",
        ),
        additional_volume_ids=[main_instance_volume.id])
    main_instance_snapshot = scaleway.InstanceSnapshot("mainInstanceSnapshot",
        volume_id=main_instance_volume.id,
        type="unified",
        opts=pulumi.ResourceOptions(depends_on=[main_instance_server]))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var mainInstanceVolume = new Scaleway.InstanceVolume("mainInstanceVolume", new()
        {
            Type = "l_ssd",
            SizeInGb = 10,
        });
    
        var mainInstanceServer = new Scaleway.InstanceServer("mainInstanceServer", new()
        {
            Image = "ubuntu_jammy",
            Type = "DEV1-S",
            RootVolume = new Scaleway.Inputs.InstanceServerRootVolumeArgs
            {
                SizeInGb = 10,
                VolumeType = "l_ssd",
            },
            AdditionalVolumeIds = new[]
            {
                mainInstanceVolume.Id,
            },
        });
    
        var mainInstanceSnapshot = new Scaleway.InstanceSnapshot("mainInstanceSnapshot", new()
        {
            VolumeId = mainInstanceVolume.Id,
            Type = "unified",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                mainInstanceServer,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		mainInstanceVolume, err := scaleway.NewInstanceVolume(ctx, "mainInstanceVolume", &scaleway.InstanceVolumeArgs{
    			Type:     pulumi.String("l_ssd"),
    			SizeInGb: pulumi.Int(10),
    		})
    		if err != nil {
    			return err
    		}
    		mainInstanceServer, err := scaleway.NewInstanceServer(ctx, "mainInstanceServer", &scaleway.InstanceServerArgs{
    			Image: pulumi.String("ubuntu_jammy"),
    			Type:  pulumi.String("DEV1-S"),
    			RootVolume: &scaleway.InstanceServerRootVolumeArgs{
    				SizeInGb:   pulumi.Int(10),
    				VolumeType: pulumi.String("l_ssd"),
    			},
    			AdditionalVolumeIds: pulumi.StringArray{
    				mainInstanceVolume.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewInstanceSnapshot(ctx, "mainInstanceSnapshot", &scaleway.InstanceSnapshotArgs{
    			VolumeId: mainInstanceVolume.ID(),
    			Type:     pulumi.String("unified"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			mainInstanceServer,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 com.pulumi.scaleway.InstanceServer;
    import com.pulumi.scaleway.InstanceServerArgs;
    import com.pulumi.scaleway.inputs.InstanceServerRootVolumeArgs;
    import com.pulumi.scaleway.InstanceSnapshot;
    import com.pulumi.scaleway.InstanceSnapshotArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 mainInstanceVolume = new InstanceVolume("mainInstanceVolume", InstanceVolumeArgs.builder()        
                .type("l_ssd")
                .sizeInGb(10)
                .build());
    
            var mainInstanceServer = new InstanceServer("mainInstanceServer", InstanceServerArgs.builder()        
                .image("ubuntu_jammy")
                .type("DEV1-S")
                .rootVolume(InstanceServerRootVolumeArgs.builder()
                    .sizeInGb(10)
                    .volumeType("l_ssd")
                    .build())
                .additionalVolumeIds(mainInstanceVolume.id())
                .build());
    
            var mainInstanceSnapshot = new InstanceSnapshot("mainInstanceSnapshot", InstanceSnapshotArgs.builder()        
                .volumeId(mainInstanceVolume.id())
                .type("unified")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(mainInstanceServer)
                    .build());
    
        }
    }
    
    resources:
      mainInstanceVolume:
        type: scaleway:InstanceVolume
        properties:
          type: l_ssd
          sizeInGb: 10
      mainInstanceServer:
        type: scaleway:InstanceServer
        properties:
          image: ubuntu_jammy
          type: DEV1-S
          rootVolume:
            sizeInGb: 10
            volumeType: l_ssd
          additionalVolumeIds:
            - ${mainInstanceVolume.id}
      mainInstanceSnapshot:
        type: scaleway:InstanceSnapshot
        properties:
          volumeId: ${mainInstanceVolume.id}
          type: unified
        options:
          dependson:
            - ${mainInstanceServer}
    

    Create InstanceSnapshot Resource

    new InstanceSnapshot(name: string, args?: InstanceSnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def InstanceSnapshot(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         import_: Optional[InstanceSnapshotImportArgs] = None,
                         name: Optional[str] = None,
                         project_id: Optional[str] = None,
                         tags: Optional[Sequence[str]] = None,
                         type: Optional[str] = None,
                         volume_id: Optional[str] = None,
                         zone: Optional[str] = None)
    @overload
    def InstanceSnapshot(resource_name: str,
                         args: Optional[InstanceSnapshotArgs] = None,
                         opts: Optional[ResourceOptions] = None)
    func NewInstanceSnapshot(ctx *Context, name string, args *InstanceSnapshotArgs, opts ...ResourceOption) (*InstanceSnapshot, error)
    public InstanceSnapshot(string name, InstanceSnapshotArgs? args = null, CustomResourceOptions? opts = null)
    public InstanceSnapshot(String name, InstanceSnapshotArgs args)
    public InstanceSnapshot(String name, InstanceSnapshotArgs args, CustomResourceOptions options)
    
    type: scaleway:InstanceSnapshot
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args InstanceSnapshotArgs
    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 InstanceSnapshotArgs
    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 InstanceSnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InstanceSnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InstanceSnapshotArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Import Lbrlabs.PulumiPackage.Scaleway.Inputs.InstanceSnapshotImport

    Import a snapshot from a qcow2 file located in a bucket

    Name string

    The name of the snapshot. If not provided it will be randomly generated.

    ProjectId string

    project_id) The ID of the project the snapshot is associated with.

    Tags List<string>

    A list of tags to apply to the snapshot.

    Type string

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    VolumeId string

    The ID of the volume to take a snapshot from.

    Zone string

    zone) The zone in which the snapshot should be created.

    Import InstanceSnapshotImportArgs

    Import a snapshot from a qcow2 file located in a bucket

    Name string

    The name of the snapshot. If not provided it will be randomly generated.

    ProjectId string

    project_id) The ID of the project the snapshot is associated with.

    Tags []string

    A list of tags to apply to the snapshot.

    Type string

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    VolumeId string

    The ID of the volume to take a snapshot from.

    Zone string

    zone) The zone in which the snapshot should be created.

    import_ InstanceSnapshotImport

    Import a snapshot from a qcow2 file located in a bucket

    name String

    The name of the snapshot. If not provided it will be randomly generated.

    projectId String

    project_id) The ID of the project the snapshot is associated with.

    tags List<String>

    A list of tags to apply to the snapshot.

    type String

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volumeId String

    The ID of the volume to take a snapshot from.

    zone String

    zone) The zone in which the snapshot should be created.

    import InstanceSnapshotImport

    Import a snapshot from a qcow2 file located in a bucket

    name string

    The name of the snapshot. If not provided it will be randomly generated.

    projectId string

    project_id) The ID of the project the snapshot is associated with.

    tags string[]

    A list of tags to apply to the snapshot.

    type string

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volumeId string

    The ID of the volume to take a snapshot from.

    zone string

    zone) The zone in which the snapshot should be created.

    import_ InstanceSnapshotImportArgs

    Import a snapshot from a qcow2 file located in a bucket

    name str

    The name of the snapshot. If not provided it will be randomly generated.

    project_id str

    project_id) The ID of the project the snapshot is associated with.

    tags Sequence[str]

    A list of tags to apply to the snapshot.

    type str

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volume_id str

    The ID of the volume to take a snapshot from.

    zone str

    zone) The zone in which the snapshot should be created.

    import Property Map

    Import a snapshot from a qcow2 file located in a bucket

    name String

    The name of the snapshot. If not provided it will be randomly generated.

    projectId String

    project_id) The ID of the project the snapshot is associated with.

    tags List<String>

    A list of tags to apply to the snapshot.

    type String

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volumeId String

    The ID of the volume to take a snapshot from.

    zone String

    zone) The zone in which the snapshot should be created.

    Outputs

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

    CreatedAt string

    The snapshot creation time.

    Id string

    The provider-assigned unique ID for this managed resource.

    OrganizationId string

    The organization ID the snapshot is associated with.

    SizeInGb int

    (Optional) The size of the snapshot.

    CreatedAt string

    The snapshot creation time.

    Id string

    The provider-assigned unique ID for this managed resource.

    OrganizationId string

    The organization ID the snapshot is associated with.

    SizeInGb int

    (Optional) The size of the snapshot.

    createdAt String

    The snapshot creation time.

    id String

    The provider-assigned unique ID for this managed resource.

    organizationId String

    The organization ID the snapshot is associated with.

    sizeInGb Integer

    (Optional) The size of the snapshot.

    createdAt string

    The snapshot creation time.

    id string

    The provider-assigned unique ID for this managed resource.

    organizationId string

    The organization ID the snapshot is associated with.

    sizeInGb number

    (Optional) The size of the snapshot.

    created_at str

    The snapshot creation time.

    id str

    The provider-assigned unique ID for this managed resource.

    organization_id str

    The organization ID the snapshot is associated with.

    size_in_gb int

    (Optional) The size of the snapshot.

    createdAt String

    The snapshot creation time.

    id String

    The provider-assigned unique ID for this managed resource.

    organizationId String

    The organization ID the snapshot is associated with.

    sizeInGb Number

    (Optional) The size of the snapshot.

    Look up Existing InstanceSnapshot Resource

    Get an existing InstanceSnapshot 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?: InstanceSnapshotState, opts?: CustomResourceOptions): InstanceSnapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            import_: Optional[InstanceSnapshotImportArgs] = None,
            name: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            size_in_gb: Optional[int] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None,
            volume_id: Optional[str] = None,
            zone: Optional[str] = None) -> InstanceSnapshot
    func GetInstanceSnapshot(ctx *Context, name string, id IDInput, state *InstanceSnapshotState, opts ...ResourceOption) (*InstanceSnapshot, error)
    public static InstanceSnapshot Get(string name, Input<string> id, InstanceSnapshotState? state, CustomResourceOptions? opts = null)
    public static InstanceSnapshot get(String name, Output<String> id, InstanceSnapshotState 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:
    CreatedAt string

    The snapshot creation time.

    Import Lbrlabs.PulumiPackage.Scaleway.Inputs.InstanceSnapshotImport

    Import a snapshot from a qcow2 file located in a bucket

    Name string

    The name of the snapshot. If not provided it will be randomly generated.

    OrganizationId string

    The organization ID the snapshot is associated with.

    ProjectId string

    project_id) The ID of the project the snapshot is associated with.

    SizeInGb int

    (Optional) The size of the snapshot.

    Tags List<string>

    A list of tags to apply to the snapshot.

    Type string

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    VolumeId string

    The ID of the volume to take a snapshot from.

    Zone string

    zone) The zone in which the snapshot should be created.

    CreatedAt string

    The snapshot creation time.

    Import InstanceSnapshotImportArgs

    Import a snapshot from a qcow2 file located in a bucket

    Name string

    The name of the snapshot. If not provided it will be randomly generated.

    OrganizationId string

    The organization ID the snapshot is associated with.

    ProjectId string

    project_id) The ID of the project the snapshot is associated with.

    SizeInGb int

    (Optional) The size of the snapshot.

    Tags []string

    A list of tags to apply to the snapshot.

    Type string

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    VolumeId string

    The ID of the volume to take a snapshot from.

    Zone string

    zone) The zone in which the snapshot should be created.

    createdAt String

    The snapshot creation time.

    import_ InstanceSnapshotImport

    Import a snapshot from a qcow2 file located in a bucket

    name String

    The name of the snapshot. If not provided it will be randomly generated.

    organizationId String

    The organization ID the snapshot is associated with.

    projectId String

    project_id) The ID of the project the snapshot is associated with.

    sizeInGb Integer

    (Optional) The size of the snapshot.

    tags List<String>

    A list of tags to apply to the snapshot.

    type String

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volumeId String

    The ID of the volume to take a snapshot from.

    zone String

    zone) The zone in which the snapshot should be created.

    createdAt string

    The snapshot creation time.

    import InstanceSnapshotImport

    Import a snapshot from a qcow2 file located in a bucket

    name string

    The name of the snapshot. If not provided it will be randomly generated.

    organizationId string

    The organization ID the snapshot is associated with.

    projectId string

    project_id) The ID of the project the snapshot is associated with.

    sizeInGb number

    (Optional) The size of the snapshot.

    tags string[]

    A list of tags to apply to the snapshot.

    type string

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volumeId string

    The ID of the volume to take a snapshot from.

    zone string

    zone) The zone in which the snapshot should be created.

    created_at str

    The snapshot creation time.

    import_ InstanceSnapshotImportArgs

    Import a snapshot from a qcow2 file located in a bucket

    name str

    The name of the snapshot. If not provided it will be randomly generated.

    organization_id str

    The organization ID the snapshot is associated with.

    project_id str

    project_id) The ID of the project the snapshot is associated with.

    size_in_gb int

    (Optional) The size of the snapshot.

    tags Sequence[str]

    A list of tags to apply to the snapshot.

    type str

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volume_id str

    The ID of the volume to take a snapshot from.

    zone str

    zone) The zone in which the snapshot should be created.

    createdAt String

    The snapshot creation time.

    import Property Map

    Import a snapshot from a qcow2 file located in a bucket

    name String

    The name of the snapshot. If not provided it will be randomly generated.

    organizationId String

    The organization ID the snapshot is associated with.

    projectId String

    project_id) The ID of the project the snapshot is associated with.

    sizeInGb Number

    (Optional) The size of the snapshot.

    tags List<String>

    A list of tags to apply to the snapshot.

    type String

    The snapshot's volume type. The possible values are: b_ssd (Block SSD), l_ssd (Local SSD) and unified. Updates to this field will recreate a new resource.

    volumeId String

    The ID of the volume to take a snapshot from.

    zone String

    zone) The zone in which the snapshot should be created.

    Supporting Types

    InstanceSnapshotImport, InstanceSnapshotImportArgs

    Bucket string

    Bucket name containing qcow2 to import

    Key string

    Key of the object to import

    Note: The type unified could be instantiated on both l_ssd and b_ssd volumes.

    Bucket string

    Bucket name containing qcow2 to import

    Key string

    Key of the object to import

    Note: The type unified could be instantiated on both l_ssd and b_ssd volumes.

    bucket String

    Bucket name containing qcow2 to import

    key String

    Key of the object to import

    Note: The type unified could be instantiated on both l_ssd and b_ssd volumes.

    bucket string

    Bucket name containing qcow2 to import

    key string

    Key of the object to import

    Note: The type unified could be instantiated on both l_ssd and b_ssd volumes.

    bucket str

    Bucket name containing qcow2 to import

    key str

    Key of the object to import

    Note: The type unified could be instantiated on both l_ssd and b_ssd volumes.

    bucket String

    Bucket name containing qcow2 to import

    key String

    Key of the object to import

    Note: The type unified could be instantiated on both l_ssd and b_ssd volumes.

    Import

    a local qcow2 file

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@lbrlabs/pulumi-scaleway";
    
    const bucket = new scaleway.ObjectBucket("bucket", {});
    const qcow = new scaleway.ObjectItem("qcow", {
        bucket: bucket.name,
        key: "server.qcow2",
        file: "myqcow.qcow2",
    });
    const snapshot = new scaleway.InstanceSnapshot("snapshot", {
        type: "unified",
        "import": {
            bucket: qcow.bucket,
            key: qcow.key,
        },
    });
    
    import pulumi
    import lbrlabs_pulumi_scaleway as scaleway
    
    bucket = scaleway.ObjectBucket("bucket")
    qcow = scaleway.ObjectItem("qcow",
        bucket=bucket.name,
        key="server.qcow2",
        file="myqcow.qcow2")
    snapshot = scaleway.InstanceSnapshot("snapshot",
        type="unified",
        import_=scaleway.InstanceSnapshotImportArgs(
            bucket=qcow.bucket,
            key=qcow.key,
        ))
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Lbrlabs.PulumiPackage.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var bucket = new Scaleway.ObjectBucket("bucket");
    
        var qcow = new Scaleway.ObjectItem("qcow", new()
        {
            Bucket = bucket.Name,
            Key = "server.qcow2",
            File = "myqcow.qcow2",
        });
    
        var snapshot = new Scaleway.InstanceSnapshot("snapshot", new()
        {
            Type = "unified",
            Import = new Scaleway.Inputs.InstanceSnapshotImportArgs
            {
                Bucket = qcow.Bucket,
                Key = qcow.Key,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/lbrlabs/pulumi-scaleway/sdk/go/scaleway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		bucket, err := scaleway.NewObjectBucket(ctx, "bucket", nil)
    		if err != nil {
    			return err
    		}
    		qcow, err := scaleway.NewObjectItem(ctx, "qcow", &scaleway.ObjectItemArgs{
    			Bucket: bucket.Name,
    			Key:    pulumi.String("server.qcow2"),
    			File:   pulumi.String("myqcow.qcow2"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewInstanceSnapshot(ctx, "snapshot", &scaleway.InstanceSnapshotArgs{
    			Type: pulumi.String("unified"),
    			Import: &scaleway.InstanceSnapshotImportArgs{
    				Bucket: qcow.Bucket,
    				Key:    qcow.Key,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ObjectBucket;
    import com.pulumi.scaleway.ObjectItem;
    import com.pulumi.scaleway.ObjectItemArgs;
    import com.pulumi.scaleway.InstanceSnapshot;
    import com.pulumi.scaleway.InstanceSnapshotArgs;
    import com.pulumi.scaleway.inputs.InstanceSnapshotImportArgs;
    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 bucket = new ObjectBucket("bucket");
    
            var qcow = new ObjectItem("qcow", ObjectItemArgs.builder()        
                .bucket(bucket.name())
                .key("server.qcow2")
                .file("myqcow.qcow2")
                .build());
    
            var snapshot = new InstanceSnapshot("snapshot", InstanceSnapshotArgs.builder()        
                .type("unified")
                .import_(InstanceSnapshotImportArgs.builder()
                    .bucket(qcow.bucket())
                    .key(qcow.key())
                    .build())
                .build());
    
        }
    }
    
    resources:
      bucket:
        type: scaleway:ObjectBucket
      qcow:
        type: scaleway:ObjectItem
        properties:
          bucket: ${bucket.name}
          key: server.qcow2
          file: myqcow.qcow2
      snapshot:
        type: scaleway:InstanceSnapshot
        properties:
          type: unified
          import:
            bucket: ${qcow.bucket}
            key: ${qcow.key}
    

    Package Details

    Repository
    scaleway lbrlabs/pulumi-scaleway
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the scaleway Terraform Provider.

    scaleway logo
    Scaleway v1.10.0 published on Saturday, Jul 1, 2023 by lbrlabs