GetVolume
Use this data source to get information about an EBS volume for use in other resources.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var ebsVolume = Output.Create(Aws.Ebs.GetVolume.InvokeAsync(new Aws.Ebs.GetVolumeArgs
{
Filters =
{
new Aws.Ebs.Inputs.GetVolumeFilterArgs
{
Name = "volume-type",
Values =
{
"gp2",
},
},
new Aws.Ebs.Inputs.GetVolumeFilterArgs
{
Name = "tag:Name",
Values =
{
"Example",
},
},
},
MostRecent = true,
}));
}
}
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 {
opt0 := true
_, err := ebs.LookupVolume(ctx, &ebs.LookupVolumeArgs{
Filters: []ebs.GetVolumeFilter{
ebs.GetVolumeFilter{
Name: "volume-type",
Values: []string{
"gp2",
},
},
ebs.GetVolumeFilter{
Name: "tag:Name",
Values: []string{
"Example",
},
},
},
MostRecent: &opt0,
}, nil)
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
ebs_volume = aws.ebs.get_volume(filters=[
{
"name": "volume-type",
"values": ["gp2"],
},
{
"name": "tag:Name",
"values": ["Example"],
},
],
most_recent=True)import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ebsVolume = pulumi.output(aws.ebs.getVolume({
filters: [
{
name: "volume-type",
values: ["gp2"],
},
{
name: "tag:Name",
values: ["Example"],
},
],
mostRecent: true,
}, { async: true }));Using GetVolume
function getVolume(args: GetVolumeArgs, opts?: InvokeOptions): Promise<GetVolumeResult>function get_volume(filters=None, most_recent=None, tags=None, opts=None)func LookupVolume(ctx *Context, args *LookupVolumeArgs, opts ...InvokeOption) (*LookupVolumeResult, error)Note: This function is named
LookupVolumein the Go SDK.
public static class GetVolume {
public static Task<GetVolumeResult> InvokeAsync(GetVolumeArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Filters
List<Get
Volume 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].
- Most
Recent bool If more than one result is returned, use the most recent Volume.
- Dictionary<string, string>
A 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
A 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}
A 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 bool If more than one result is returned, use the most recent Volume.
- Dict[str, str]
A map of tags for the resource.
GetVolume Result
The following output properties are available:
- Arn string
The volume ARN (e.g. arn:aws:ec2:us-east-1:0123456789012:volume/vol-59fcb34e).
- Availability
Zone string The 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
The amount of IOPS for the disk.
- Kms
Key stringId The ARN for the KMS encryption key.
- Multi
Attach boolEnabled (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- Outpost
Arn string The Amazon Resource Name (ARN) of the Outpost.
- Size int
The size of the drive in GiBs.
- Snapshot
Id string The snapshot_id the EBS volume is based off.
- Dictionary<string, string>
A map of tags for the resource.
- Volume
Id string The volume ID (e.g. vol-59fcb34e).
- Volume
Type string The type of EBS volume.
- Filters
List<Get
Volume Filter> - Most
Recent bool
- Arn string
The volume ARN (e.g. arn:aws:ec2:us-east-1:0123456789012:volume/vol-59fcb34e).
- Availability
Zone string The 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
The amount of IOPS for the disk.
- Kms
Key stringId The ARN for the KMS encryption key.
- Multi
Attach boolEnabled (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- Outpost
Arn string The Amazon Resource Name (ARN) of the Outpost.
- Size int
The size of the drive in GiBs.
- Snapshot
Id string The snapshot_id the EBS volume is based off.
- map[string]string
A map of tags for the resource.
- Volume
Id string The volume ID (e.g. vol-59fcb34e).
- Volume
Type string The type of EBS volume.
- Filters
[]Get
Volume Filter - Most
Recent bool
- arn string
The volume ARN (e.g. arn:aws:ec2:us-east-1:0123456789012:volume/vol-59fcb34e).
- availability
Zone string The 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
The amount of IOPS for the disk.
- kms
Key stringId The ARN for the KMS encryption key.
- multi
Attach booleanEnabled (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- outpost
Arn string The Amazon Resource Name (ARN) of the Outpost.
- size number
The size of the drive in GiBs.
- snapshot
Id string The snapshot_id the EBS volume is based off.
- {[key: string]: string}
A map of tags for the resource.
- volume
Id string The volume ID (e.g. vol-59fcb34e).
- volume
Type string The type of EBS volume.
- filters
Get
Volume Filter[] - most
Recent boolean
- arn str
The volume ARN (e.g. arn:aws:ec2:us-east-1:0123456789012:volume/vol-59fcb34e).
- availability_
zone str The 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 float
The amount of IOPS for the disk.
- kms_
key_ strid The ARN for the KMS encryption key.
- multi_
attach_ boolenabled (Optional) Specifies whether Amazon EBS Multi-Attach is enabled.
- outpost_
arn str The Amazon Resource Name (ARN) of the Outpost.
- size float
The size of the drive in GiBs.
- snapshot_
id str The snapshot_id the EBS volume is based off.
- Dict[str, str]
A map of tags for the resource.
- volume_
id str The volume ID (e.g. vol-59fcb34e).
- volume_
type str The type of EBS volume.
- filters
List[Get
Volume Filter] - most_
recent bool
Supporting Types
GetVolumeFilter
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.