AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.ebs.getVolume
Explore with Pulumi AI
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/v6/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,
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,
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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:ebs/getVolume:getVolume
arguments:
# arguments dictionary
The 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.
- 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.
- 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.
- 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.
- {[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.
- 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.
- 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 - AZ where the EBS volume exists.
- 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.
- 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
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 - AZ where the EBS volume exists.
- 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.
- 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
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 - AZ where the EBS volume exists.
- 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.
- 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
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 - AZ where the EBS volume exists.
- 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.
- 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
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 - AZ where the EBS volume exists.
- 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.
- 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_
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 - AZ where the EBS volume exists.
- 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.
- 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
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
aws
Terraform Provider.