GetSnapshot
Use this data source to get information about an EBS Snapshot for use when provisioning EBS Volumes
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var ebsVolume = Output.Create(Aws.Ebs.GetSnapshot.InvokeAsync(new Aws.Ebs.GetSnapshotArgs
{
Filters =
{
new Aws.Ebs.Inputs.GetSnapshotFilterArgs
{
Name = "volume-size",
Values =
{
"40",
},
},
new Aws.Ebs.Inputs.GetSnapshotFilterArgs
{
Name = "tag:Name",
Values =
{
"Example",
},
},
},
MostRecent = true,
Owners =
{
"self",
},
}));
}
}
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 {
opt0 := true
_, err := ebs.LookupSnapshot(ctx, &ebs.LookupSnapshotArgs{
Filters: []ebs.GetSnapshotFilter{
ebs.GetSnapshotFilter{
Name: "volume-size",
Values: []string{
"40",
},
},
ebs.GetSnapshotFilter{
Name: "tag:Name",
Values: []string{
"Example",
},
},
},
MostRecent: &opt0,
Owners: []string{
"self",
},
}, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
ebs_volume = aws.ebs.get_snapshot(filters=[
{
"name": "volume-size",
"values": ["40"],
},
{
"name": "tag:Name",
"values": ["Example"],
},
],
most_recent=True,
owners=["self"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ebsVolume = pulumi.output(aws.ebs.getSnapshot({
filters: [
{
name: "volume-size",
values: ["40"],
},
{
name: "tag:Name",
values: ["Example"],
},
],
mostRecent: true,
owners: ["self"],
}, { async: true }));Using GetSnapshot
function getSnapshot(args: GetSnapshotArgs, opts?: InvokeOptions): Promise<GetSnapshotResult>function get_snapshot(filters=None, most_recent=None, owners=None, restorable_by_user_ids=None, snapshot_ids=None, tags=None, opts=None)func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)Note: This function is named
LookupSnapshotin the Go SDK.
public static class GetSnapshot {
public static Task<GetSnapshotResult> InvokeAsync(GetSnapshotArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Filters
List<Get
Snapshot Filter Args> One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-snapshots in the AWS CLI reference][1].
- Most
Recent bool If more than one result is returned, use the most recent snapshot.
- Owners List<string>
Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
- Restorable
By List<string>User Ids One or more AWS accounts IDs that can create volumes from the snapshot.
- Snapshot
Ids List<string> Returns information on a specific snapshot_id.
- Dictionary<string, string>
A map of tags for the resource.
- Filters
[]Get
Snapshot Filter One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-snapshots in the AWS CLI reference][1].
- Most
Recent bool If more than one result is returned, use the most recent snapshot.
- Owners []string
Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
- Restorable
By []stringUser Ids One or more AWS accounts IDs that can create volumes from the snapshot.
- Snapshot
Ids []string Returns information on a specific snapshot_id.
- map[string]string
A map of tags for the resource.
- filters
Get
Snapshot Filter[] One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-snapshots in the AWS CLI reference][1].
- most
Recent boolean If more than one result is returned, use the most recent snapshot.
- owners string[]
Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
- restorable
By string[]User Ids One or more AWS accounts IDs that can create volumes from the snapshot.
- snapshot
Ids string[] Returns information on a specific snapshot_id.
- {[key: string]: string}
A map of tags for the resource.
- filters
List[Get
Snapshot Filter] One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-snapshots in the AWS CLI reference][1].
- most_
recent bool If more than one result is returned, use the most recent snapshot.
- owners List[str]
Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
- restorable_
by_ List[str]user_ ids One or more AWS accounts IDs that can create volumes from the snapshot.
- snapshot_
ids List[str] Returns information on a specific snapshot_id.
- Dict[str, str]
A map of tags for the resource.
GetSnapshot Result
The following output properties are available:
- 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 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.
- Snapshot
Id string The snapshot ID (e.g. snap-59fcb34e).
- State string
The snapshot state.
- Dictionary<string, string>
A map of tags for the resource.
- Volume
Id string The volume ID (e.g. vol-59fcb34e).
- Volume
Size int The size of the drive in GiBs.
- Filters
List<Get
Snapshot Filter> - Most
Recent bool - Owners List<string>
- Restorable
By List<string>User Ids - Snapshot
Ids List<string>
- 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 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.
- Snapshot
Id string The snapshot ID (e.g. snap-59fcb34e).
- State string
The snapshot state.
- map[string]string
A map of tags for the resource.
- Volume
Id string The volume ID (e.g. vol-59fcb34e).
- Volume
Size int The size of the drive in GiBs.
- Filters
[]Get
Snapshot Filter - Most
Recent bool - Owners []string
- Restorable
By []stringUser Ids - Snapshot
Ids []string
- 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 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.
- snapshot
Id string The snapshot ID (e.g. snap-59fcb34e).
- state string
The snapshot state.
- {[key: string]: string}
A map of tags for the resource.
- volume
Id string The volume ID (e.g. vol-59fcb34e).
- volume
Size number The size of the drive in GiBs.
- filters
Get
Snapshot Filter[] - most
Recent boolean - owners string[]
- restorable
By string[]User Ids - snapshot
Ids string[]
- 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 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.
- snapshot_
id str The snapshot ID (e.g. snap-59fcb34e).
- state str
The snapshot state.
- Dict[str, str]
A map of tags for the resource.
- volume_
id str The volume ID (e.g. vol-59fcb34e).
- volume_
size float The size of the drive in GiBs.
- filters
List[Get
Snapshot Filter] - most_
recent bool - owners List[str]
- restorable_
by_ List[str]user_ ids - snapshot_
ids List[str]
Supporting Types
GetSnapshotFilter
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.