gcore.Snapshot
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const snapshot = new gcore.Snapshot("snapshot", {
    description: "snapshot example description",
    metadata: {
        env: "test",
    },
    projectId: 1,
    regionId: 1,
    volumeId: "28e9edcb-1593-41fe-971b-da729c6ec301",
});
import pulumi
import pulumi_gcore as gcore
snapshot = gcore.Snapshot("snapshot",
    description="snapshot example description",
    metadata={
        "env": "test",
    },
    project_id=1,
    region_id=1,
    volume_id="28e9edcb-1593-41fe-971b-da729c6ec301")
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gcore.NewSnapshot(ctx, "snapshot", &gcore.SnapshotArgs{
			Description: pulumi.String("snapshot example description"),
			Metadata: pulumi.StringMap{
				"env": pulumi.String("test"),
			},
			ProjectId: pulumi.Float64(1),
			RegionId:  pulumi.Float64(1),
			VolumeId:  pulumi.String("28e9edcb-1593-41fe-971b-da729c6ec301"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() => 
{
    var snapshot = new Gcore.Snapshot("snapshot", new()
    {
        Description = "snapshot example description",
        Metadata = 
        {
            { "env", "test" },
        },
        ProjectId = 1,
        RegionId = 1,
        VolumeId = "28e9edcb-1593-41fe-971b-da729c6ec301",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.Snapshot;
import com.pulumi.gcore.SnapshotArgs;
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 snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
            .description("snapshot example description")
            .metadata(Map.of("env", "test"))
            .projectId(1)
            .regionId(1)
            .volumeId("28e9edcb-1593-41fe-971b-da729c6ec301")
            .build());
    }
}
resources:
  snapshot:
    type: gcore:Snapshot
    properties:
      description: snapshot example description
      metadata:
        env: test
      projectId: 1
      regionId: 1
      volumeId: 28e9edcb-1593-41fe-971b-da729c6ec301
Create Snapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);@overload
def Snapshot(resource_name: str,
             args: SnapshotArgs,
             opts: Optional[ResourceOptions] = None)
@overload
def Snapshot(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             volume_id: Optional[str] = None,
             description: Optional[str] = None,
             last_updated: Optional[str] = None,
             metadata: Optional[Mapping[str, str]] = None,
             name: Optional[str] = None,
             project_id: Optional[float] = None,
             project_name: Optional[str] = None,
             region_id: Optional[float] = None,
             region_name: Optional[str] = None,
             snapshot_id: Optional[str] = None)func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
public Snapshot(String name, SnapshotArgs args)
public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
type: gcore:Snapshot
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 SnapshotArgs
- 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 SnapshotArgs
- 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 SnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnapshotArgs
- 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 snapshotResource = new Gcore.Snapshot("snapshotResource", new()
{
    VolumeId = "string",
    Description = "string",
    LastUpdated = "string",
    Metadata = 
    {
        { "string", "string" },
    },
    Name = "string",
    ProjectId = 0,
    ProjectName = "string",
    RegionId = 0,
    RegionName = "string",
    SnapshotId = "string",
});
example, err := gcore.NewSnapshot(ctx, "snapshotResource", &gcore.SnapshotArgs{
	VolumeId:    pulumi.String("string"),
	Description: pulumi.String("string"),
	LastUpdated: pulumi.String("string"),
	Metadata: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:        pulumi.String("string"),
	ProjectId:   pulumi.Float64(0),
	ProjectName: pulumi.String("string"),
	RegionId:    pulumi.Float64(0),
	RegionName:  pulumi.String("string"),
	SnapshotId:  pulumi.String("string"),
})
var snapshotResource = new Snapshot("snapshotResource", SnapshotArgs.builder()
    .volumeId("string")
    .description("string")
    .lastUpdated("string")
    .metadata(Map.of("string", "string"))
    .name("string")
    .projectId(0.0)
    .projectName("string")
    .regionId(0.0)
    .regionName("string")
    .snapshotId("string")
    .build());
snapshot_resource = gcore.Snapshot("snapshotResource",
    volume_id="string",
    description="string",
    last_updated="string",
    metadata={
        "string": "string",
    },
    name="string",
    project_id=0,
    project_name="string",
    region_id=0,
    region_name="string",
    snapshot_id="string")
const snapshotResource = new gcore.Snapshot("snapshotResource", {
    volumeId: "string",
    description: "string",
    lastUpdated: "string",
    metadata: {
        string: "string",
    },
    name: "string",
    projectId: 0,
    projectName: "string",
    regionId: 0,
    regionName: "string",
    snapshotId: "string",
});
type: gcore:Snapshot
properties:
    description: string
    lastUpdated: string
    metadata:
        string: string
    name: string
    projectId: 0
    projectName: string
    regionId: 0
    regionName: string
    snapshotId: string
    volumeId: string
Snapshot 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 Snapshot resource accepts the following input properties:
- VolumeId string
- Description string
- LastUpdated string
- Metadata Dictionary<string, string>
- Name string
- ProjectId double
- ProjectName string
- RegionId double
- RegionName string
- SnapshotId string
- The ID of this resource.
- VolumeId string
- Description string
- LastUpdated string
- Metadata map[string]string
- Name string
- ProjectId float64
- ProjectName string
- RegionId float64
- RegionName string
- SnapshotId string
- The ID of this resource.
- volumeId String
- description String
- lastUpdated String
- metadata Map<String,String>
- name String
- projectId Double
- projectName String
- regionId Double
- regionName String
- snapshotId String
- The ID of this resource.
- volumeId string
- description string
- lastUpdated string
- metadata {[key: string]: string}
- name string
- projectId number
- projectName string
- regionId number
- regionName string
- snapshotId string
- The ID of this resource.
- volume_id str
- description str
- last_updated str
- metadata Mapping[str, str]
- name str
- project_id float
- project_name str
- region_id float
- region_name str
- snapshot_id str
- The ID of this resource.
- volumeId String
- description String
- lastUpdated String
- metadata Map<String>
- name String
- projectId Number
- projectName String
- regionId Number
- regionName String
- snapshotId String
- The ID of this resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:
Look up Existing Snapshot Resource
Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        last_updated: Optional[str] = None,
        metadata: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        project_id: Optional[float] = None,
        project_name: Optional[str] = None,
        region_id: Optional[float] = None,
        region_name: Optional[str] = None,
        size: Optional[float] = None,
        snapshot_id: Optional[str] = None,
        status: Optional[str] = None,
        volume_id: Optional[str] = None) -> Snapshotfunc GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)public static Snapshot get(String name, Output<String> id, SnapshotState state, CustomResourceOptions options)resources:  _:    type: gcore:Snapshot    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.
- Description string
- LastUpdated string
- Metadata Dictionary<string, string>
- Name string
- ProjectId double
- ProjectName string
- RegionId double
- RegionName string
- Size double
- SnapshotId string
- The ID of this resource.
- Status string
- VolumeId string
- Description string
- LastUpdated string
- Metadata map[string]string
- Name string
- ProjectId float64
- ProjectName string
- RegionId float64
- RegionName string
- Size float64
- SnapshotId string
- The ID of this resource.
- Status string
- VolumeId string
- description String
- lastUpdated String
- metadata Map<String,String>
- name String
- projectId Double
- projectName String
- regionId Double
- regionName String
- size Double
- snapshotId String
- The ID of this resource.
- status String
- volumeId String
- description string
- lastUpdated string
- metadata {[key: string]: string}
- name string
- projectId number
- projectName string
- regionId number
- regionName string
- size number
- snapshotId string
- The ID of this resource.
- status string
- volumeId string
- description str
- last_updated str
- metadata Mapping[str, str]
- name str
- project_id float
- project_name str
- region_id float
- region_name str
- size float
- snapshot_id str
- The ID of this resource.
- status str
- volume_id str
- description String
- lastUpdated String
- metadata Map<String>
- name String
- projectId Number
- projectName String
- regionId Number
- regionName String
- size Number
- snapshotId String
- The ID of this resource.
- status String
- volumeId String
Import
The pulumi import command can be used, for example:
import using <project_id>:<region_id>:<snapshot_id> format
$ pulumi import gcore:index/snapshot:Snapshot snapshot1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the gcoreTerraform Provider.
