get Snapshot
Use this data source to get information about an EBS Snapshot for use when provisioning EBS Volumes
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ebsVolume = aws.ebs.getSnapshot({
mostRecent: true,
owners: ["self"],
filters: [
{
name: "volume-size",
values: ["40"],
},
{
name: "tag:Name",
values: ["Example"],
},
],
});
import pulumi
import pulumi_aws as aws
ebs_volume = aws.ebs.get_snapshot(most_recent=True,
owners=["self"],
filters=[
{
"name": "volume-size",
"values": ["40"],
},
{
"name": "tag:Name",
"values": ["Example"],
},
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var ebsVolume = Aws.Ebs.GetSnapshot.Invoke(new()
{
MostRecent = true,
Owners = new[]
{
"self",
},
Filters = new[]
{
new Aws.Ebs.Inputs.GetSnapshotFilterInputArgs
{
Name = "volume-size",
Values = new[]
{
"40",
},
},
new Aws.Ebs.Inputs.GetSnapshotFilterInputArgs
{
Name = "tag:Name",
Values = new[]
{
"Example",
},
},
},
});
});
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 {
_, err := ebs.LookupSnapshot(ctx, &ebs.LookupSnapshotArgs{
MostRecent: pulumi.BoolRef(true),
Owners: []string{
"self",
},
Filters: []ebs.GetSnapshotFilter{
{
Name: "volume-size",
Values: []string{
"40",
},
},
{
Name: "tag:Name",
Values: []string{
"Example",
},
},
},
}, nil)
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.EbsFunctions;
import com.pulumi.aws.ebs.inputs.GetSnapshotArgs;
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) {
final var ebsVolume = EbsFunctions.getSnapshot(GetSnapshotArgs.builder()
.mostRecent(true)
.owners("self")
.filters(
GetSnapshotFilterArgs.builder()
.name("volume-size")
.values("40")
.build(),
GetSnapshotFilterArgs.builder()
.name("tag:Name")
.values("Example")
.build())
.build());
}
}
variables:
ebsVolume:
fn::invoke:
function: aws:ebs:getSnapshot
arguments:
mostRecent: true
owners:
- self
filters:
- name: volume-size
values:
- '40'
- name: tag:Name
values:
- Example
Return
A collection of values returned by getSnapshot.
Parameters
A collection of arguments for invoking getSnapshot.
Return
A collection of values returned by getSnapshot.
Parameters
One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out 1.
If more than one result is returned, use the most recent snapshot.
Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
One or more AWS accounts IDs that can create volumes from the snapshot.
Returns information on a specific snapshot_id.
Map of tags for the resource.
See also
Return
A collection of values returned by getSnapshot.
Parameters
Builder for com.pulumi.aws.ebs.kotlin.inputs.GetSnapshotPlainArgs.