GetSnapshotIds

Use this data source to get a list of EBS Snapshot IDs matching the specified criteria.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var ebsVolumes = Output.Create(Aws.Ebs.GetSnapshotIds.InvokeAsync(new Aws.Ebs.GetSnapshotIdsArgs
        {
            Filters = 
            {
                new Aws.Ebs.Inputs.GetSnapshotIdsFilterArgs
                {
                    Name = "volume-size",
                    Values = 
                    {
                        "40",
                    },
                },
                new Aws.Ebs.Inputs.GetSnapshotIdsFilterArgs
                {
                    Name = "tag:Name",
                    Values = 
                    {
                        "Example",
                    },
                },
            },
            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 {
        _, err := ebs.GetSnapshotIds(ctx, &ebs.GetSnapshotIdsArgs{
            Filters: []ebs.GetSnapshotIdsFilter{
                ebs.GetSnapshotIdsFilter{
                    Name: "volume-size",
                    Values: []string{
                        "40",
                    },
                },
                ebs.GetSnapshotIdsFilter{
                    Name: "tag:Name",
                    Values: []string{
                        "Example",
                    },
                },
            },
            Owners: []string{
                "self",
            },
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

ebs_volumes = aws.ebs.get_snapshot_ids(filters=[
        {
            "name": "volume-size",
            "values": ["40"],
        },
        {
            "name": "tag:Name",
            "values": ["Example"],
        },
    ],
    owners=["self"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ebsVolumes = pulumi.output(aws.ebs.getSnapshotIds({
    filters: [
        {
            name: "volume-size",
            values: ["40"],
        },
        {
            name: "tag:Name",
            values: ["Example"],
        },
    ],
    owners: ["self"],
}, { async: true }));

Using GetSnapshotIds

function getSnapshotIds(args: GetSnapshotIdsArgs, opts?: InvokeOptions): Promise<GetSnapshotIdsResult>
function  get_snapshot_ids(filters=None, owners=None, restorable_by_user_ids=None, opts=None)
func GetSnapshotIds(ctx *Context, args *GetSnapshotIdsArgs, opts ...InvokeOption) (*GetSnapshotIdsResult, error)
public static class GetSnapshotIds {
    public static Task<GetSnapshotIdsResult> InvokeAsync(GetSnapshotIdsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetSnapshotIdsFilterArgs>

One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-volumes in the AWS CLI reference][1].

Owners List<string>

Returns the snapshots owned by the specified owner id. Multiple owners can be specified.

RestorableByUserIds List<string>

One or more AWS accounts IDs that can create volumes from the snapshot.

Filters []GetSnapshotIdsFilter

One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-volumes in the AWS CLI reference][1].

Owners []string

Returns the snapshots owned by the specified owner id. Multiple owners can be specified.

RestorableByUserIds []string

One or more AWS accounts IDs that can create volumes from the snapshot.

filters GetSnapshotIdsFilter[]

One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-volumes in the AWS CLI reference][1].

owners string[]

Returns the snapshots owned by the specified owner id. Multiple owners can be specified.

restorableByUserIds string[]

One or more AWS accounts IDs that can create volumes from the snapshot.

filters List[GetSnapshotIdsFilter]

One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out [describe-volumes in the AWS CLI reference][1].

owners List[str]

Returns the snapshots owned by the specified owner id. Multiple owners can be specified.

restorable_by_user_ids List[str]

One or more AWS accounts IDs that can create volumes from the snapshot.

GetSnapshotIds Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Filters List<GetSnapshotIdsFilter>
Owners List<string>
RestorableByUserIds List<string>
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Filters []GetSnapshotIdsFilter
Owners []string
RestorableByUserIds []string
id string

The provider-assigned unique ID for this managed resource.

ids string[]
filters GetSnapshotIdsFilter[]
owners string[]
restorableByUserIds string[]
id str

The provider-assigned unique ID for this managed resource.

ids List[str]
filters List[GetSnapshotIdsFilter]
owners List[str]
restorable_by_user_ids List[str]

Supporting Types

GetSnapshotIdsFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Name string
Values List<string>
Name string
Values []string
name string
values string[]
name str
values List[str]

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.