vkcs.BlockstorageSnapshot
Explore with Pulumi AI
Provides a blockstorage snapshot resource. This can be used to create, modify and delete blockstorage snapshot.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vkcs from "@pulumi/vkcs";
const recentSnapshot = new vkcs.BlockstorageSnapshot("recentSnapshot", {
volumeId: vkcs_blockstorage_volume.data.id,
description: "test snapshot",
metadata: {
foo: "bar",
},
});
import pulumi
import pulumi_vkcs as vkcs
recent_snapshot = vkcs.BlockstorageSnapshot("recentSnapshot",
volume_id=vkcs_blockstorage_volume["data"]["id"],
description="test snapshot",
metadata={
"foo": "bar",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vkcs.NewBlockstorageSnapshot(ctx, "recentSnapshot", &vkcs.BlockstorageSnapshotArgs{
VolumeId: pulumi.Any(vkcs_blockstorage_volume.Data.Id),
Description: pulumi.String("test snapshot"),
Metadata: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vkcs = Pulumi.Vkcs;
return await Deployment.RunAsync(() =>
{
var recentSnapshot = new Vkcs.BlockstorageSnapshot("recentSnapshot", new()
{
VolumeId = vkcs_blockstorage_volume.Data.Id,
Description = "test snapshot",
Metadata =
{
{ "foo", "bar" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vkcs.BlockstorageSnapshot;
import com.pulumi.vkcs.BlockstorageSnapshotArgs;
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 recentSnapshot = new BlockstorageSnapshot("recentSnapshot", BlockstorageSnapshotArgs.builder()
.volumeId(vkcs_blockstorage_volume.data().id())
.description("test snapshot")
.metadata(Map.of("foo", "bar"))
.build());
}
}
resources:
recentSnapshot:
type: vkcs:BlockstorageSnapshot
properties:
volumeId: ${vkcs_blockstorage_volume.data.id}
description: test snapshot
metadata:
foo: bar
Create BlockstorageSnapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BlockstorageSnapshot(name: string, args: BlockstorageSnapshotArgs, opts?: CustomResourceOptions);
@overload
def BlockstorageSnapshot(resource_name: str,
args: BlockstorageSnapshotArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BlockstorageSnapshot(resource_name: str,
opts: Optional[ResourceOptions] = None,
volume_id: Optional[str] = None,
blockstorage_snapshot_id: Optional[str] = None,
description: Optional[str] = None,
force: Optional[bool] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
region: Optional[str] = None,
timeouts: Optional[BlockstorageSnapshotTimeoutsArgs] = None)
func NewBlockstorageSnapshot(ctx *Context, name string, args BlockstorageSnapshotArgs, opts ...ResourceOption) (*BlockstorageSnapshot, error)
public BlockstorageSnapshot(string name, BlockstorageSnapshotArgs args, CustomResourceOptions? opts = null)
public BlockstorageSnapshot(String name, BlockstorageSnapshotArgs args)
public BlockstorageSnapshot(String name, BlockstorageSnapshotArgs args, CustomResourceOptions options)
type: vkcs:BlockstorageSnapshot
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 BlockstorageSnapshotArgs
- 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 BlockstorageSnapshotArgs
- 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 BlockstorageSnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BlockstorageSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BlockstorageSnapshotArgs
- 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 blockstorageSnapshotResource = new Vkcs.BlockstorageSnapshot("blockstorageSnapshotResource", new()
{
VolumeId = "string",
BlockstorageSnapshotId = "string",
Description = "string",
Force = false,
Metadata =
{
{ "string", "string" },
},
Name = "string",
Region = "string",
Timeouts = new Vkcs.Inputs.BlockstorageSnapshotTimeoutsArgs
{
Create = "string",
},
});
example, err := vkcs.NewBlockstorageSnapshot(ctx, "blockstorageSnapshotResource", &vkcs.BlockstorageSnapshotArgs{
VolumeId: pulumi.String("string"),
BlockstorageSnapshotId: pulumi.String("string"),
Description: pulumi.String("string"),
Force: pulumi.Bool(false),
Metadata: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
Region: pulumi.String("string"),
Timeouts: &vkcs.BlockstorageSnapshotTimeoutsArgs{
Create: pulumi.String("string"),
},
})
var blockstorageSnapshotResource = new BlockstorageSnapshot("blockstorageSnapshotResource", BlockstorageSnapshotArgs.builder()
.volumeId("string")
.blockstorageSnapshotId("string")
.description("string")
.force(false)
.metadata(Map.of("string", "string"))
.name("string")
.region("string")
.timeouts(BlockstorageSnapshotTimeoutsArgs.builder()
.create("string")
.build())
.build());
blockstorage_snapshot_resource = vkcs.BlockstorageSnapshot("blockstorageSnapshotResource",
volume_id="string",
blockstorage_snapshot_id="string",
description="string",
force=False,
metadata={
"string": "string",
},
name="string",
region="string",
timeouts={
"create": "string",
})
const blockstorageSnapshotResource = new vkcs.BlockstorageSnapshot("blockstorageSnapshotResource", {
volumeId: "string",
blockstorageSnapshotId: "string",
description: "string",
force: false,
metadata: {
string: "string",
},
name: "string",
region: "string",
timeouts: {
create: "string",
},
});
type: vkcs:BlockstorageSnapshot
properties:
blockstorageSnapshotId: string
description: string
force: false
metadata:
string: string
name: string
region: string
timeouts:
create: string
volumeId: string
BlockstorageSnapshot 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 BlockstorageSnapshot resource accepts the following input properties:
- Volume
Id string - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- Blockstorage
Snapshot stringId - string → ID of the resource.
- Description string
- optional string → The description of the volume.
- Force bool
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- Metadata Dictionary<string, string>
- optional map of string → Map of key-value metadata of the volume.
- Name string
- optional string → The name of the snapshot.
- Region string
- optional string
- Timeouts
Blockstorage
Snapshot Timeouts
- Volume
Id string - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- Blockstorage
Snapshot stringId - string → ID of the resource.
- Description string
- optional string → The description of the volume.
- Force bool
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- Metadata map[string]string
- optional map of string → Map of key-value metadata of the volume.
- Name string
- optional string → The name of the snapshot.
- Region string
- optional string
- Timeouts
Blockstorage
Snapshot Timeouts Args
- volume
Id String - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage
Snapshot StringId - string → ID of the resource.
- description String
- optional string → The description of the volume.
- force Boolean
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata Map<String,String>
- optional map of string → Map of key-value metadata of the volume.
- name String
- optional string → The name of the snapshot.
- region String
- optional string
- timeouts
Blockstorage
Snapshot Timeouts
- volume
Id string - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage
Snapshot stringId - string → ID of the resource.
- description string
- optional string → The description of the volume.
- force boolean
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata {[key: string]: string}
- optional map of string → Map of key-value metadata of the volume.
- name string
- optional string → The name of the snapshot.
- region string
- optional string
- timeouts
Blockstorage
Snapshot Timeouts
- volume_
id str - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage_
snapshot_ strid - string → ID of the resource.
- description str
- optional string → The description of the volume.
- force bool
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata Mapping[str, str]
- optional map of string → Map of key-value metadata of the volume.
- name str
- optional string → The name of the snapshot.
- region str
- optional string
- timeouts
Blockstorage
Snapshot Timeouts Args
- volume
Id String - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage
Snapshot StringId - string → ID of the resource.
- description String
- optional string → The description of the volume.
- force Boolean
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata Map<String>
- optional map of string → Map of key-value metadata of the volume.
- name String
- optional string → The name of the snapshot.
- region String
- optional string
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the BlockstorageSnapshot 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 BlockstorageSnapshot Resource
Get an existing BlockstorageSnapshot 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?: BlockstorageSnapshotState, opts?: CustomResourceOptions): BlockstorageSnapshot
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
blockstorage_snapshot_id: Optional[str] = None,
description: Optional[str] = None,
force: Optional[bool] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
region: Optional[str] = None,
timeouts: Optional[BlockstorageSnapshotTimeoutsArgs] = None,
volume_id: Optional[str] = None) -> BlockstorageSnapshot
func GetBlockstorageSnapshot(ctx *Context, name string, id IDInput, state *BlockstorageSnapshotState, opts ...ResourceOption) (*BlockstorageSnapshot, error)
public static BlockstorageSnapshot Get(string name, Input<string> id, BlockstorageSnapshotState? state, CustomResourceOptions? opts = null)
public static BlockstorageSnapshot get(String name, Output<String> id, BlockstorageSnapshotState state, CustomResourceOptions options)
resources: _: type: vkcs:BlockstorageSnapshot get: id: ${id}
- 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.
- Blockstorage
Snapshot stringId - string → ID of the resource.
- Description string
- optional string → The description of the volume.
- Force bool
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- Metadata Dictionary<string, string>
- optional map of string → Map of key-value metadata of the volume.
- Name string
- optional string → The name of the snapshot.
- Region string
- optional string
- Timeouts
Blockstorage
Snapshot Timeouts - Volume
Id string - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- Blockstorage
Snapshot stringId - string → ID of the resource.
- Description string
- optional string → The description of the volume.
- Force bool
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- Metadata map[string]string
- optional map of string → Map of key-value metadata of the volume.
- Name string
- optional string → The name of the snapshot.
- Region string
- optional string
- Timeouts
Blockstorage
Snapshot Timeouts Args - Volume
Id string - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage
Snapshot StringId - string → ID of the resource.
- description String
- optional string → The description of the volume.
- force Boolean
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata Map<String,String>
- optional map of string → Map of key-value metadata of the volume.
- name String
- optional string → The name of the snapshot.
- region String
- optional string
- timeouts
Blockstorage
Snapshot Timeouts - volume
Id String - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage
Snapshot stringId - string → ID of the resource.
- description string
- optional string → The description of the volume.
- force boolean
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata {[key: string]: string}
- optional map of string → Map of key-value metadata of the volume.
- name string
- optional string → The name of the snapshot.
- region string
- optional string
- timeouts
Blockstorage
Snapshot Timeouts - volume
Id string - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage_
snapshot_ strid - string → ID of the resource.
- description str
- optional string → The description of the volume.
- force bool
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata Mapping[str, str]
- optional map of string → Map of key-value metadata of the volume.
- name str
- optional string → The name of the snapshot.
- region str
- optional string
- timeouts
Blockstorage
Snapshot Timeouts Args - volume_
id str - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
- blockstorage
Snapshot StringId - string → ID of the resource.
- description String
- optional string → The description of the volume.
- force Boolean
- optional boolean → Allows or disallows snapshot of a volume when the volume is attached to an instance.
- metadata Map<String>
- optional map of string → Map of key-value metadata of the volume.
- name String
- optional string → The name of the snapshot.
- region String
- optional string
- timeouts Property Map
- volume
Id String - required string → ID of the volume to create snapshot for. Changing this creates a new snapshot.
Supporting Types
BlockstorageSnapshotTimeouts, BlockstorageSnapshotTimeoutsArgs
- Create string
- Create string
- create String
- create string
- create str
- create String
Import
Volume snapshots can be imported using the id
, e.g.
$ pulumi import vkcs:index/blockstorageSnapshot:BlockstorageSnapshot myvolumesnapshot 0b4f5a9b-554e-4e80-b553-82aba6502315
After the import you can use terraform show to view imported fields and write their values to your .tf file.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vkcs vk-cs/terraform-provider-vkcs
- License
- Notes
- This Pulumi package is based on the
vkcs
Terraform Provider.