@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
70 lines • 2.76 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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 access to available Google Compute regions for a given project.
* See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/) in the upstream docs.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* export = async () => {
* const available = await gcp.compute.getRegions({});
* const cluster: gcp.compute.Subnetwork[] = [];
* for (const range = {value: 0}; range.value < available.names.length; range.value++) {
* cluster.push(new gcp.compute.Subnetwork(`cluster-${range.value}`, {
* name: "my-network",
* ipCidrRange: `10.36.${range.value}.0/24`,
* network: "my-network",
* region: available.names[range.value],
* }));
* }
* }
* ```
*/
function getRegions(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("gcp:compute/getRegions:getRegions", {
"project": args.project,
"status": args.status,
}, opts);
}
exports.getRegions = getRegions;
/**
* Provides access to available Google Compute regions for a given project.
* See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/) in the upstream docs.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* export = async () => {
* const available = await gcp.compute.getRegions({});
* const cluster: gcp.compute.Subnetwork[] = [];
* for (const range = {value: 0}; range.value < available.names.length; range.value++) {
* cluster.push(new gcp.compute.Subnetwork(`cluster-${range.value}`, {
* name: "my-network",
* ipCidrRange: `10.36.${range.value}.0/24`,
* network: "my-network",
* region: available.names[range.value],
* }));
* }
* }
* ```
*/
function getRegionsOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("gcp:compute/getRegions:getRegions", {
"project": args.project,
"status": args.status,
}, opts);
}
exports.getRegionsOutput = getRegionsOutput;
//# sourceMappingURL=getRegions.js.map