@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
102 lines • 3.89 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides access to available Google Compute zones in a region for a given project.
* See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/regions-zones) in the upstream docs.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const available = gcp.compute.getZones({});
* const foo: gcp.compute.InstanceGroupManager[] = [];
* available.then(available => available.names).length.apply(rangeBody => {
* for (const range = {value: 0}; range.value < rangeBody; range.value++) {
* foo.push(new gcp.compute.InstanceGroupManager(`foo-${range.value}`, {
* name: `test-${range.value}`,
* instanceTemplate: foobar.selfLink,
* baseInstanceName: `foobar-${range.value}`,
* zone: available.then(available => available.names[range.value]),
* targetSize: 1,
* }));
* }
* });
* ```
*/
export declare function getZones(args?: GetZonesArgs, opts?: pulumi.InvokeOptions): Promise<GetZonesResult>;
/**
* A collection of arguments for invoking getZones.
*/
export interface GetZonesArgs {
/**
* Project from which to list available zones. Defaults to project declared in the provider.
*/
project?: string;
/**
* Region from which to list available zones. Defaults to region declared in the provider.
*/
region?: string;
/**
* Allows to filter list of zones based on their current status. Status can be either `UP` or `DOWN`.
* Defaults to no filtering (all available zones - both `UP` and `DOWN`).
*/
status?: string;
}
/**
* A collection of values returned by getZones.
*/
export interface GetZonesResult {
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* A list of zones available in the given region
*/
readonly names: string[];
readonly project: string;
readonly region?: string;
readonly status?: string;
}
/**
* Provides access to available Google Compute zones in a region for a given project.
* See more about [regions and zones](https://cloud.google.com/compute/docs/regions-zones/regions-zones) in the upstream docs.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const available = gcp.compute.getZones({});
* const foo: gcp.compute.InstanceGroupManager[] = [];
* available.then(available => available.names).length.apply(rangeBody => {
* for (const range = {value: 0}; range.value < rangeBody; range.value++) {
* foo.push(new gcp.compute.InstanceGroupManager(`foo-${range.value}`, {
* name: `test-${range.value}`,
* instanceTemplate: foobar.selfLink,
* baseInstanceName: `foobar-${range.value}`,
* zone: available.then(available => available.names[range.value]),
* targetSize: 1,
* }));
* }
* });
* ```
*/
export declare function getZonesOutput(args?: GetZonesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetZonesResult>;
/**
* A collection of arguments for invoking getZones.
*/
export interface GetZonesOutputArgs {
/**
* Project from which to list available zones. Defaults to project declared in the provider.
*/
project?: pulumi.Input<string | undefined>;
/**
* Region from which to list available zones. Defaults to region declared in the provider.
*/
region?: pulumi.Input<string | undefined>;
/**
* Allows to filter list of zones based on their current status. Status can be either `UP` or `DOWN`.
* Defaults to no filtering (all available zones - both `UP` and `DOWN`).
*/
status?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=getZones.d.ts.map