UNPKG

@pulumi/aws

Version:

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

108 lines 3.42 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.getRegionsOutput = exports.getRegions = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides information about AWS Regions. Can be used to filter regions i.e., by Opt-In status or only regions enabled for current account. To get details like endpoint and description of each region the data source can be combined with the `aws.getRegion` data source. * * ## Example Usage * * Enabled AWS Regions: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegions({}); * ``` * * All the regions regardless of the availability * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegions({ * allRegions: true, * }); * ``` * * To see regions that are filtered by `"not-opted-in"`, the `allRegions` argument needs to be set to `true` or no results will be returned. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegions({ * allRegions: true, * filters: [{ * name: "opt-in-status", * values: ["not-opted-in"], * }], * }); * ``` */ function getRegions(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:index/getRegions:getRegions", { "allRegions": args.allRegions, "filters": args.filters, "id": args.id, }, opts); } exports.getRegions = getRegions; /** * Provides information about AWS Regions. Can be used to filter regions i.e., by Opt-In status or only regions enabled for current account. To get details like endpoint and description of each region the data source can be combined with the `aws.getRegion` data source. * * ## Example Usage * * Enabled AWS Regions: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegions({}); * ``` * * All the regions regardless of the availability * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegions({ * allRegions: true, * }); * ``` * * To see regions that are filtered by `"not-opted-in"`, the `allRegions` argument needs to be set to `true` or no results will be returned. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegions({ * allRegions: true, * filters: [{ * name: "opt-in-status", * values: ["not-opted-in"], * }], * }); * ``` */ function getRegionsOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:index/getRegions:getRegions", { "allRegions": args.allRegions, "filters": args.filters, "id": args.id, }, opts); } exports.getRegionsOutput = getRegionsOutput; //# sourceMappingURL=getRegions.js.map