Snapshot
Creates a Snapshot of an EBS Volume.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
{
AvailabilityZone = "us-west-2a",
Size = 40,
Tags =
{
{ "Name", "HelloWorld" },
},
});
var exampleSnapshot = new Aws.Ebs.Snapshot("exampleSnapshot", new Aws.Ebs.SnapshotArgs
{
Tags =
{
{ "Name", "HelloWorld_snap" },
},
VolumeId = example.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ebs"
"github.com/pulumi/pulumi/sdk/v2/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, "exampleSnapshot", &ebs.SnapshotArgs{
Tags: pulumi.StringMap{
"Name": pulumi.String("HelloWorld_snap"),
},
VolumeId: example.ID(),
})
if err != nil {
return err
}
return nil
})
}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("exampleSnapshot",
tags={
"Name": "HelloWorld_snap",
},
volume_id=example.id)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", {
tags: {
Name: "HelloWorld_snap",
},
volumeId: example.id,
});Create a Snapshot Resource
new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);def Snapshot(resource_name, opts=None, description=None, tags=None, volume_id=None, __props__=None);func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Snapshot Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Snapshot resource accepts the following input properties:
- Volume
Id string The Volume ID of which to make a snapshot.
- Description string
A description of what the snapshot is.
- Dictionary<string, string>
A map of tags to assign to the snapshot
- Volume
Id string The Volume ID of which to make a snapshot.
- Description string
A description of what the snapshot is.
- map[string]string
A map of tags to assign to the snapshot
- volume
Id string The Volume ID of which to make a snapshot.
- description string
A description of what the snapshot is.
- {[key: string]: string}
A map of tags to assign to the snapshot
- volume_
id str The Volume ID of which to make a snapshot.
- description str
A description of what the snapshot is.
- Dict[str, str]
A map of tags to assign to the snapshot
Outputs
All input properties are implicitly available as output properties. Additionally, the Snapshot resource produces the following output properties:
- Arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot.
- Encrypted bool
Whether the snapshot is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Kms
Key stringId The ARN for the KMS encryption key.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the EBS snapshot owner.
- Volume
Size int The size of the drive in GiBs.
- Arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot.
- Encrypted bool
Whether the snapshot is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Kms
Key stringId The ARN for the KMS encryption key.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the EBS snapshot owner.
- Volume
Size int The size of the drive in GiBs.
- arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- data
Encryption stringKey Id The data encryption key identifier for the snapshot.
- encrypted boolean
Whether the snapshot is encrypted.
- id string
- The provider-assigned unique ID for this managed resource.
- kms
Key stringId The ARN for the KMS encryption key.
- owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- owner
Id string The AWS account ID of the EBS snapshot owner.
- volume
Size number The size of the drive in GiBs.
- arn str
Amazon Resource Name (ARN) of the EBS Snapshot.
- data_
encryption_ strkey_ id The data encryption key identifier for the snapshot.
- encrypted bool
Whether the snapshot is encrypted.
- id str
- The provider-assigned unique ID for this managed resource.
- kms_
key_ strid The ARN for the KMS encryption key.
- owner_
alias str Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- owner_
id str The AWS account ID of the EBS snapshot owner.
- volume_
size float The size of the drive in GiBs.
Look up an 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): Snapshotstatic get(resource_name, id, opts=None, arn=None, data_encryption_key_id=None, description=None, encrypted=None, kms_key_id=None, owner_alias=None, owner_id=None, tags=None, volume_id=None, volume_size=None, __props__=None);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)- 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.
The following state arguments are supported:
- Arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot.
- Description string
A description of what the snapshot is.
- Encrypted bool
Whether the snapshot is encrypted.
- Kms
Key stringId The ARN for the KMS encryption key.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the EBS snapshot owner.
- Dictionary<string, string>
A map of tags to assign to the snapshot
- Volume
Id string The Volume ID of which to make a snapshot.
- Volume
Size int The size of the drive in GiBs.
- Arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot.
- Description string
A description of what the snapshot is.
- Encrypted bool
Whether the snapshot is encrypted.
- Kms
Key stringId The ARN for the KMS encryption key.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the EBS snapshot owner.
- map[string]string
A map of tags to assign to the snapshot
- Volume
Id string The Volume ID of which to make a snapshot.
- Volume
Size int The size of the drive in GiBs.
- arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- data
Encryption stringKey Id The data encryption key identifier for the snapshot.
- description string
A description of what the snapshot is.
- encrypted boolean
Whether the snapshot is encrypted.
- kms
Key stringId The ARN for the KMS encryption key.
- owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- owner
Id string The AWS account ID of the EBS snapshot owner.
- {[key: string]: string}
A map of tags to assign to the snapshot
- volume
Id string The Volume ID of which to make a snapshot.
- volume
Size number The size of the drive in GiBs.
- arn str
Amazon Resource Name (ARN) of the EBS Snapshot.
- data_
encryption_ strkey_ id The data encryption key identifier for the snapshot.
- description str
A description of what the snapshot is.
- encrypted bool
Whether the snapshot is encrypted.
- kms_
key_ strid The ARN for the KMS encryption key.
- owner_
alias str Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- owner_
id str The AWS account ID of the EBS snapshot owner.
- Dict[str, str]
A map of tags to assign to the snapshot
- volume_
id str The Volume ID of which to make a snapshot.
- volume_
size float The size of the drive in GiBs.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.