gcorelabs.Snapshot
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const snapshot = new gcore.index.Gcore_snapshot("snapshot", {
projectId: 1,
regionId: 1,
name: "snapshot example",
volumeId: "28e9edcb-1593-41fe-971b-da729c6ec301",
description: "snapshot example description",
metadata: {
env: "test",
},
});
import pulumi
import pulumi_gcore as gcore
snapshot = gcore.index.Gcore_snapshot("snapshot",
project_id=1,
region_id=1,
name=snapshot example,
volume_id=28e9edcb-1593-41fe-971b-da729c6ec301,
description=snapshot example description,
metadata={
env: test,
})
package main
import (
"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gcore.NewGcore_snapshot(ctx, "snapshot", &gcore.Gcore_snapshotArgs{
ProjectId: 1,
RegionId: 1,
Name: "snapshot example",
VolumeId: "28e9edcb-1593-41fe-971b-da729c6ec301",
Description: "snapshot example description",
Metadata: map[string]interface{}{
"env": "test",
},
})
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.Index.Gcore_snapshot("snapshot", new()
{
ProjectId = 1,
RegionId = 1,
Name = "snapshot example",
VolumeId = "28e9edcb-1593-41fe-971b-da729c6ec301",
Description = "snapshot example description",
Metadata =
{
{ "env", "test" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.gcore_snapshot;
import com.pulumi.gcore.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 Gcore_snapshot("snapshot", Gcore_snapshotArgs.builder()
.projectId(1)
.regionId(1)
.name("snapshot example")
.volumeId("28e9edcb-1593-41fe-971b-da729c6ec301")
.description("snapshot example description")
.metadata(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
}
}
resources:
snapshot:
type: gcore:gcore_snapshot
properties:
projectId: 1
regionId: 1
name: snapshot example
volumeId: 28e9edcb-1593-41fe-971b-da729c6ec301
description: snapshot example description
metadata:
env: test
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: gcorelabs: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 Gcorelabs.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 := gcorelabs.NewSnapshot(ctx, "snapshotResource", &gcorelabs.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)
.projectName("string")
.regionId(0)
.regionName("string")
.snapshotId("string")
.build());
snapshot_resource = gcorelabs.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 gcorelabs.Snapshot("snapshotResource", {
volumeId: "string",
description: "string",
lastUpdated: "string",
metadata: {
string: "string",
},
name: "string",
projectId: 0,
projectName: "string",
regionId: 0,
regionName: "string",
snapshotId: "string",
});
type: gcorelabs: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:
- Volume
Id string - Description string
- Last
Updated string - Metadata Dictionary<string, string>
- Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Snapshot
Id string - The ID of this resource.
- Volume
Id string - Description string
- Last
Updated string - Metadata map[string]string
- Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Snapshot
Id string - The ID of this resource.
- volume
Id String - description String
- last
Updated String - metadata Map<String,String>
- name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - snapshot
Id String - The ID of this resource.
- volume
Id string - description string
- last
Updated string - metadata {[key: string]: string}
- name string
- project
Id number - project
Name string - region
Id number - region
Name string - snapshot
Id 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.
- volume
Id String - description String
- last
Updated String - metadata Map<String>
- name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - snapshot
Id 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) -> Snapshot
func 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: gcorelabs: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
- Last
Updated string - Metadata Dictionary<string, string>
- Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Size double
- Snapshot
Id string - The ID of this resource.
- Status string
- Volume
Id string
- Description string
- Last
Updated string - Metadata map[string]string
- Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Size float64
- Snapshot
Id string - The ID of this resource.
- Status string
- Volume
Id string
- description String
- last
Updated String - metadata Map<String,String>
- name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - size Double
- snapshot
Id String - The ID of this resource.
- status String
- volume
Id String
- description string
- last
Updated string - metadata {[key: string]: string}
- name string
- project
Id number - project
Name string - region
Id number - region
Name string - size number
- snapshot
Id string - The ID of this resource.
- status string
- volume
Id 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
- last
Updated String - metadata Map<String>
- name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - size Number
- snapshot
Id String - The ID of this resource.
- status String
- volume
Id String
Import
import using <project_id>:<region_id>:<snapshot_id> format
$ pulumi import gcorelabs: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
- gcorelabs g-core/terraform-provider-gcorelabs
- License
- Notes
- This Pulumi package is based on the
gcorelabs
Terraform Provider.