get Ebs Volumes
aws.ebs.getEbsVolumes
provides identifying information for EBS volumes matching given criteria. This data source can be useful for getting a list of volume IDs with (for example) matching tags.
Example Usage
The following demonstrates obtaining a map of availability zone to EBS volume ID for volumes with a given tag value.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.ebs.getEbsVolumes({
tags: {
VolumeSet: "TestVolumeSet",
},
});
const exampleGetVolume = example.then(example => .reduce((__obj, [__key, __value]) => ({ ...__obj, [__key]: aws.ebs.getVolume({
filters: [{
name: "volume-id",
values: [__value],
}],
}) })));
export const availabilityZoneToVolumeId = exampleGetVolume.apply(exampleGetVolume => Object.values(exampleGetVolume).reduce((__obj, s) => ({ ...__obj, [s.id]: s.availabilityZone })));
import pulumi
import pulumi_aws as aws
example = aws.ebs.get_ebs_volumes(tags={
"VolumeSet": "TestVolumeSet",
})
example_get_volume = {__key: aws.ebs.get_volume(filters=[{
"name": "volume-id",
"values": [__value],
}]) for __key, __value in example.ids}
pulumi.export("availabilityZoneToVolumeId", {s.id: s.availability_zone for s in example_get_volume})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.Ebs.GetEbsVolumes.Invoke(new()
{
Tags =
{
{ "VolumeSet", "TestVolumeSet" },
},
});
var exampleGetVolume = ;
return new Dictionary<string, object?>
{
["availabilityZoneToVolumeId"] = exampleGetVolume.Apply(exampleGetVolume => (exampleGetVolume).Values.ToDictionary(item => {
var s = item.Value;
return s.Id;
}, item => {
var s = item.Value;
return s.AvailabilityZone;
})),
};
});
Return
A collection of values returned by getEbsVolumes.
Parameters
A collection of arguments for invoking getEbsVolumes.
Return
A collection of values returned by getEbsVolumes.
Parameters
Custom filter block as described below.
Map of tags, each pair of which must exactly match a pair on the desired volumes. More complex filters can be expressed using one or more filter
sub-blocks, which take the following arguments:
See also
Return
A collection of values returned by getEbsVolumes.
Parameters
Builder for com.pulumi.aws.ebs.kotlin.inputs.GetEbsVolumesPlainArgs.