AWS v6.63.0 published on Wednesday, Dec 4, 2024 by Pulumi
aws.ebs.getSnapshotIds
Explore with Pulumi AI
Use this data source to get a list of EBS Snapshot IDs matching the specified criteria.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ebsVolumes = aws.ebs.getSnapshotIds({
owners: ["self"],
filters: [
{
name: "volume-size",
values: ["40"],
},
{
name: "tag:Name",
values: ["Example"],
},
],
});
import pulumi
import pulumi_aws as aws
ebs_volumes = aws.ebs.get_snapshot_ids(owners=["self"],
filters=[
{
"name": "volume-size",
"values": ["40"],
},
{
"name": "tag:Name",
"values": ["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.GetSnapshotIds(ctx, &ebs.GetSnapshotIdsArgs{
Owners: []string{
"self",
},
Filters: []ebs.GetSnapshotIdsFilter{
{
Name: "volume-size",
Values: []string{
"40",
},
},
{
Name: "tag:Name",
Values: []string{
"Example",
},
},
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var ebsVolumes = Aws.Ebs.GetSnapshotIds.Invoke(new()
{
Owners = new[]
{
"self",
},
Filters = new[]
{
new Aws.Ebs.Inputs.GetSnapshotIdsFilterInputArgs
{
Name = "volume-size",
Values = new[]
{
"40",
},
},
new Aws.Ebs.Inputs.GetSnapshotIdsFilterInputArgs
{
Name = "tag:Name",
Values = new[]
{
"Example",
},
},
},
});
});
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.GetSnapshotIdsArgs;
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 ebsVolumes = EbsFunctions.getSnapshotIds(GetSnapshotIdsArgs.builder()
.owners("self")
.filters(
GetSnapshotIdsFilterArgs.builder()
.name("volume-size")
.values("40")
.build(),
GetSnapshotIdsFilterArgs.builder()
.name("tag:Name")
.values("Example")
.build())
.build());
}
}
variables:
ebsVolumes:
fn::invoke:
Function: aws:ebs:getSnapshotIds
Arguments:
owners:
- self
filters:
- name: volume-size
values:
- '40'
- name: tag:Name
values:
- Example
Using getSnapshotIds
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSnapshotIds(args: GetSnapshotIdsArgs, opts?: InvokeOptions): Promise<GetSnapshotIdsResult>
function getSnapshotIdsOutput(args: GetSnapshotIdsOutputArgs, opts?: InvokeOptions): Output<GetSnapshotIdsResult>
def get_snapshot_ids(filters: Optional[Sequence[GetSnapshotIdsFilter]] = None,
owners: Optional[Sequence[str]] = None,
restorable_by_user_ids: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetSnapshotIdsResult
def get_snapshot_ids_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSnapshotIdsFilterArgs]]]] = None,
owners: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
restorable_by_user_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotIdsResult]
func GetSnapshotIds(ctx *Context, args *GetSnapshotIdsArgs, opts ...InvokeOption) (*GetSnapshotIdsResult, error)
func GetSnapshotIdsOutput(ctx *Context, args *GetSnapshotIdsOutputArgs, opts ...InvokeOption) GetSnapshotIdsResultOutput
> Note: This function is named GetSnapshotIds
in the Go SDK.
public static class GetSnapshotIds
{
public static Task<GetSnapshotIdsResult> InvokeAsync(GetSnapshotIdsArgs args, InvokeOptions? opts = null)
public static Output<GetSnapshotIdsResult> Invoke(GetSnapshotIdsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSnapshotIdsResult> getSnapshotIds(GetSnapshotIdsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ebs/getSnapshotIds:getSnapshotIds
arguments:
# arguments dictionary
The following arguments are supported:
- 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<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
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<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 string[]User Ids - One or more AWS accounts IDs that can create volumes from the snapshot.
- filters
Sequence[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 Sequence[str]
- Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
- restorable_
by_ Sequence[str]user_ ids - One or more AWS accounts IDs that can create volumes from the snapshot.
- filters List<Property Map>
- 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.
getSnapshotIds Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Set of EBS snapshot IDs, sorted by creation time in descending order.
- 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
- Set of EBS snapshot IDs, sorted by creation time in descending order.
- Filters
[]Get
Snapshot Ids Filter - Owners []string
- Restorable
By []stringUser Ids
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- Set of EBS snapshot IDs, sorted by creation time in descending order.
- 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[]
- Set of EBS snapshot IDs, sorted by creation time in descending order.
- filters
Get
Snapshot Ids Filter[] - owners string[]
- restorable
By string[]User Ids
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- Set of EBS snapshot IDs, sorted by creation time in descending order.
- filters
Sequence[Get
Snapshot Ids Filter] - owners Sequence[str]
- restorable_
by_ Sequence[str]user_ ids
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- Set of EBS snapshot IDs, sorted by creation time in descending order.
- filters List<Property Map>
- owners List<String>
- restorable
By List<String>User Ids
Supporting Types
GetSnapshotIdsFilter
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.