SnapshotArgs

data class SnapshotArgs(val description: Output<String>? = null, val outpostArn: Output<String>? = null, val permanentRestore: Output<Boolean>? = null, val storageTier: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val temporaryRestoreDays: Output<Int>? = null, val volumeId: Output<String>? = null) : ConvertibleToJava<SnapshotArgs>

Creates a Snapshot of an EBS Volume.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ebs.Volume("example", {
availabilityZone: "us-west-2a",
size: 40,
tags: {
Name: "HelloWorld",
},
});
const exampleSnapshot = new aws.ebs.Snapshot("example_snapshot", {
volumeId: example.id,
tags: {
Name: "HelloWorld_snap",
},
});
import pulumi
import pulumi_aws as aws
example = aws.ebs.Volume("example",
availability_zone="us-west-2a",
size=40,
tags={
"Name": "HelloWorld",
})
example_snapshot = aws.ebs.Snapshot("example_snapshot",
volume_id=example.id,
tags={
"Name": "HelloWorld_snap",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ebs.Volume("example", new()
{
AvailabilityZone = "us-west-2a",
Size = 40,
Tags =
{
{ "Name", "HelloWorld" },
},
});
var exampleSnapshot = new Aws.Ebs.Snapshot("example_snapshot", new()
{
VolumeId = example.Id,
Tags =
{
{ "Name", "HelloWorld_snap" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ebs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ebs.NewVolume(ctx, "example", &ebs.VolumeArgs{
AvailabilityZone: pulumi.String("us-west-2a"),
Size: pulumi.Int(40),
Tags: pulumi.StringMap{
"Name": pulumi.String("HelloWorld"),
},
})
if err != nil {
return err
}
_, err = ebs.NewSnapshot(ctx, "example_snapshot", &ebs.SnapshotArgs{
VolumeId: example.ID(),
Tags: pulumi.StringMap{
"Name": pulumi.String("HelloWorld_snap"),
},
})
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.aws.ebs.Volume;
import com.pulumi.aws.ebs.VolumeArgs;
import com.pulumi.aws.ebs.Snapshot;
import com.pulumi.aws.ebs.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 example = new Volume("example", VolumeArgs.builder()
.availabilityZone("us-west-2a")
.size(40)
.tags(Map.of("Name", "HelloWorld"))
.build());
var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
.volumeId(example.id())
.tags(Map.of("Name", "HelloWorld_snap"))
.build());
}
}
resources:
example:
type: aws:ebs:Volume
properties:
availabilityZone: us-west-2a
size: 40
tags:
Name: HelloWorld
exampleSnapshot:
type: aws:ebs:Snapshot
name: example_snapshot
properties:
volumeId: ${example.id}
tags:
Name: HelloWorld_snap

Import

Using pulumi import, import EBS Snapshot using the id. For example:

$ pulumi import aws:ebs/snapshot:Snapshot id snap-049df61146c4d7901

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, outpostArn: Output<String>? = null, permanentRestore: Output<Boolean>? = null, storageTier: Output<String>? = null, tags: Output<Map<String, String>>? = null, temporaryRestoreDays: Output<Int>? = null, volumeId: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

A description of what the snapshot is.

Link copied to clipboard
val outpostArn: Output<String>? = null

The Amazon Resource Name (ARN) of the Outpost on which to create a local snapshot.

Link copied to clipboard
val permanentRestore: Output<Boolean>? = null

Indicates whether to permanently restore an archived snapshot.

Link copied to clipboard
val storageTier: Output<String>? = null

The name of the storage tier. Valid values are archive and standard. Default value is standard.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the snapshot. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val temporaryRestoreDays: Output<Int>? = null

Specifies the number of days for which to temporarily restore an archived snapshot. Required for temporary restores only. The snapshot will be automatically re-archived after this period.

Link copied to clipboard
val volumeId: Output<String>? = null

The Volume ID of which to make a snapshot.

Functions

Link copied to clipboard
open override fun toJava(): SnapshotArgs