AWS v7.11.0 published on Wednesday, Nov 5, 2025 by Pulumi
aws.ebs.getVolume
Start a Neo task
Explain and create an aws.ebs.getVolume resource
Use this data source to get information about an EBS volume for use in other resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ebsVolume = aws.ebs.getVolume({
mostRecent: true,
filters: [
{
name: "volume-type",
values: ["gp2"],
},
{
name: "tag:Name",
values: ["Example"],
},
],
});
import pulumi
import pulumi_aws as aws
ebs_volume = aws.ebs.get_volume(most_recent=True,
filters=[
{
"name": "volume-type",
"values": ["gp2"],
},
{
"name": "tag:Name",
"values": ["Example"],
},
])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ebs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ebs.LookupVolume(ctx, &ebs.LookupVolumeArgs{
MostRecent: pulumi.BoolRef(true),
Filters: []ebs.GetVolumeFilter{
{
Name: "volume-type",
Values: []string{
"gp2",
},
},
{
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 ebsVolume = Aws.Ebs.GetVolume.Invoke(new()
{
MostRecent = true,
Filters = new[]
{
new Aws.Ebs.Inputs.GetVolumeFilterInputArgs
{
Name = "volume-type",
Values = new[]
{
"gp2",
},
},
new Aws.Ebs.Inputs.GetVolumeFilterInputArgs
{
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.GetVolumeArgs;
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.getVolume(GetVolumeArgs.builder()
.mostRecent(true)
.filters(
GetVolumeFilterArgs.builder()
.name("volume-type")
.values("gp2")
.build(),
GetVolumeFilterArgs.builder()
.name("tag:Name")
.values("Example")
.build())
.build());
}
}
variables:
ebsVolume:
fn::invoke:
function: aws:ebs:getVolume
arguments:
mostRecent: true
filters:
- name: volume-type
values:
- gp2
- name: tag:Name
values:
- Example
Using getVolume
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 getVolume(args: GetVolumeArgs, opts?: InvokeOptions): Promise<GetVolumeResult>
function getVolumeOutput(args: GetVolumeOutputArgs, opts?: InvokeOptions): Output<GetVolumeResult>def get_volume(filters: Optional[Sequence[GetVolumeFilter]] = None,
most_recent: Optional[bool] = None,
region: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetVolumeResult
def get_volume_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVolumeFilterArgs]]]] = None,
most_recent: Optional[pulumi.Input[bool]] = None,
region: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVolumeResult]func LookupVolume(ctx *Context, args *LookupVolumeArgs, opts ...InvokeOption) (*LookupVolumeResult, error)
func LookupVolumeOutput(ctx *Context, args *LookupVolumeOutputArgs, opts ...InvokeOption) LookupVolumeResultOutput> Note: This function is named LookupVolume in the Go SDK.
public static class GetVolume
{
public static Task<GetVolumeResult> InvokeAsync(GetVolumeArgs args, InvokeOptions? opts = null)
public static Output<GetVolumeResult> Invoke(GetVolumeInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
public static Output<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
fn::invoke:
function: aws:ebs/getVolume:getVolume
arguments:
# arguments dictionaryThe following arguments are supported:
- Filters
List<Get
Volume 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].
- Most
Recent bool - If more than one result is returned, use the most recent volume.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- Map of tags for the resource.
- Filters
[]Get
Volume 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].
- Most
Recent bool - If more than one result is returned, use the most recent volume.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- Map of tags for the resource.
- filters
List<Get
Volume 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].
- most
Recent Boolean - If more than one result is returned, use the most recent volume.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- Map of tags for the resource.
- filters
Get
Volume 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].
- most
Recent boolean - If more than one result is returned, use the most recent volume.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- Map of tags for the resource.
- filters
Sequence[Get
Volume 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].
- most_
recent bool - If more than one result is returned, use the most recent volume.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- Map of tags for the resource.
- 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].
- most
Recent Boolean - If more than one result is returned, use the most recent volume.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- Map of tags for the resource.
getVolume Result
The following output properties are available:
- Arn string
- Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
- Availability
Zone string - Availability zone where the EBS volume exists.
- Create
Time string - Timestamp when volume creation was initiated.
- Encrypted bool
- Whether the disk is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Iops int
- Amount of IOPS for the disk.
- Kms
Key stringId - ARN for the KMS encryption key.
- Multi
Attach boolEnabled - (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- Outpost
Arn string - ARN of the Outpost.
- Region string
- Size int
- Size of the drive in GiBs.
- Snapshot
Id string - Snapshot_id the EBS volume is based off.
- Dictionary<string, string>
- Map of tags for the resource.
- Throughput int
- Throughput that the volume supports, in MiB/s.
- Volume
Id string - Volume ID (e.g., vol-59fcb34e).
- Volume
Initialization intRate - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
- Volume
Type string - Type of EBS volume.
- Filters
List<Get
Volume Filter> - Most
Recent bool
- Arn string
- Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
- Availability
Zone string - Availability zone where the EBS volume exists.
- Create
Time string - Timestamp when volume creation was initiated.
- Encrypted bool
- Whether the disk is encrypted.
- Id string
- The provider-assigned unique ID for this managed resource.
- Iops int
- Amount of IOPS for the disk.
- Kms
Key stringId - ARN for the KMS encryption key.
- Multi
Attach boolEnabled - (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- Outpost
Arn string - ARN of the Outpost.
- Region string
- Size int
- Size of the drive in GiBs.
- Snapshot
Id string - Snapshot_id the EBS volume is based off.
- map[string]string
- Map of tags for the resource.
- Throughput int
- Throughput that the volume supports, in MiB/s.
- Volume
Id string - Volume ID (e.g., vol-59fcb34e).
- Volume
Initialization intRate - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
- Volume
Type string - Type of EBS volume.
- Filters
[]Get
Volume Filter - Most
Recent bool
- arn String
- Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
- availability
Zone String - Availability zone where the EBS volume exists.
- create
Time String - Timestamp when volume creation was initiated.
- encrypted Boolean
- Whether the disk is encrypted.
- id String
- The provider-assigned unique ID for this managed resource.
- iops Integer
- Amount of IOPS for the disk.
- kms
Key StringId - ARN for the KMS encryption key.
- multi
Attach BooleanEnabled - (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- outpost
Arn String - ARN of the Outpost.
- region String
- size Integer
- Size of the drive in GiBs.
- snapshot
Id String - Snapshot_id the EBS volume is based off.
- Map<String,String>
- Map of tags for the resource.
- throughput Integer
- Throughput that the volume supports, in MiB/s.
- volume
Id String - Volume ID (e.g., vol-59fcb34e).
- volume
Initialization IntegerRate - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
- volume
Type String - Type of EBS volume.
- filters
List<Get
Volume Filter> - most
Recent Boolean
- arn string
- Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
- availability
Zone string - Availability zone where the EBS volume exists.
- create
Time string - Timestamp when volume creation was initiated.
- encrypted boolean
- Whether the disk is encrypted.
- id string
- The provider-assigned unique ID for this managed resource.
- iops number
- Amount of IOPS for the disk.
- kms
Key stringId - ARN for the KMS encryption key.
- multi
Attach booleanEnabled - (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- outpost
Arn string - ARN of the Outpost.
- region string
- size number
- Size of the drive in GiBs.
- snapshot
Id string - Snapshot_id the EBS volume is based off.
- {[key: string]: string}
- Map of tags for the resource.
- throughput number
- Throughput that the volume supports, in MiB/s.
- volume
Id string - Volume ID (e.g., vol-59fcb34e).
- volume
Initialization numberRate - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
- volume
Type string - Type of EBS volume.
- filters
Get
Volume Filter[] - most
Recent boolean
- arn str
- Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
- availability_
zone str - Availability zone where the EBS volume exists.
- create_
time str - Timestamp when volume creation was initiated.
- encrypted bool
- Whether the disk is encrypted.
- id str
- The provider-assigned unique ID for this managed resource.
- iops int
- Amount of IOPS for the disk.
- kms_
key_ strid - ARN for the KMS encryption key.
- multi_
attach_ boolenabled - (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- outpost_
arn str - ARN of the Outpost.
- region str
- size int
- Size of the drive in GiBs.
- snapshot_
id str - Snapshot_id the EBS volume is based off.
- Mapping[str, str]
- Map of tags for the resource.
- throughput int
- Throughput that the volume supports, in MiB/s.
- volume_
id str - Volume ID (e.g., vol-59fcb34e).
- volume_
initialization_ intrate - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
- volume_
type str - Type of EBS volume.
- filters
Sequence[Get
Volume Filter] - most_
recent bool
- arn String
- Volume ARN (e.g., arn:aws:ec2:us-east-1:123456789012:volume/vol-59fcb34e).
- availability
Zone String - Availability zone where the EBS volume exists.
- create
Time String - Timestamp when volume creation was initiated.
- encrypted Boolean
- Whether the disk is encrypted.
- id String
- The provider-assigned unique ID for this managed resource.
- iops Number
- Amount of IOPS for the disk.
- kms
Key StringId - ARN for the KMS encryption key.
- multi
Attach BooleanEnabled - (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- outpost
Arn String - ARN of the Outpost.
- region String
- size Number
- Size of the drive in GiBs.
- snapshot
Id String - Snapshot_id the EBS volume is based off.
- Map<String>
- Map of tags for the resource.
- throughput Number
- Throughput that the volume supports, in MiB/s.
- volume
Id String - Volume ID (e.g., vol-59fcb34e).
- volume
Initialization NumberRate - EBS provisioned rate for volume initialization, in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
- volume
Type String - Type of EBS volume.
- filters List<Property Map>
- most
Recent Boolean
Supporting Types
GetVolumeFilter
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
