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<Get
Snapshot Ids Filter Args> 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.
- Restorable
By List<string>User Ids One or more AWS accounts IDs that can create volumes from the snapshot.
- Filters
[]Get
Snapshot Ids Filter 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.
- Restorable
By []stringUser Ids One or more AWS accounts IDs that can create volumes from the snapshot.
- filters
Get
Snapshot Ids Filter[] 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.
- restorable
By string[]User Ids One or more AWS accounts IDs that can create volumes from the snapshot.
- filters
List[Get
Snapshot Ids Filter] 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_ List[str]user_ ids 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<Get
Snapshot Ids Filter> - Owners List<string>
- Restorable
By List<string>User Ids
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Filters
[]Get
Snapshot Ids Filter - Owners []string
- Restorable
By []stringUser Ids
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- filters
Get
Snapshot Ids Filter[] - owners string[]
- restorable
By string[]User Ids
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
- filters
List[Get
Snapshot Ids Filter] - owners List[str]
- restorable_
by_ List[str]user_ ids
Supporting Types
GetSnapshotIdsFilter
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.