UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

82 lines 3.17 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getEbsVolumesOutput = exports.getEbsVolumes = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * `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. * * ```typescript * 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 }))); * ``` */ function getEbsVolumes(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:ebs/getEbsVolumes:getEbsVolumes", { "filters": args.filters, "region": args.region, "tags": args.tags, }, opts); } exports.getEbsVolumes = getEbsVolumes; /** * `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. * * ```typescript * 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 }))); * ``` */ function getEbsVolumesOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:ebs/getEbsVolumes:getEbsVolumes", { "filters": args.filters, "region": args.region, "tags": args.tags, }, opts); } exports.getEbsVolumesOutput = getEbsVolumesOutput; //# sourceMappingURL=getEbsVolumes.js.map