@pulumi/hcloud
Version:
A Pulumi package for creating and managing hcloud cloud resources.
73 lines • 2.31 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "./types/output";
/**
* Provides a list of available Hetzner Cloud Locations.
*
* This resource may be useful to create highly available infrastructure, distributed across several locations.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const all = hcloud.getLocations({});
* const workers: hcloud.Server[] = [];
* for (const range = {value: 0}; range.value < 5; range.value++) {
* workers.push(new hcloud.Server(`workers-${range.value}`, {
* name: `node${range.value}`,
* image: "debian-12",
* serverType: "cx23",
* location: all.then(all => all.locations)[range.value].name,
* }));
* }
* ```
*/
export declare function getLocations(opts?: pulumi.InvokeOptions): Promise<GetLocationsResult>;
/**
* A collection of values returned by getLocations.
*/
export interface GetLocationsResult {
/**
* @deprecated Use locations list instead
*/
readonly descriptions: string[];
/**
* The ID of this resource.
*/
readonly id: string;
/**
* @deprecated Use locations list instead
*/
readonly locationIds: string[];
readonly locations: outputs.GetLocationsLocation[];
/**
* @deprecated Use locations list instead
*/
readonly names: string[];
}
/**
* Provides a list of available Hetzner Cloud Locations.
*
* This resource may be useful to create highly available infrastructure, distributed across several locations.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const all = hcloud.getLocations({});
* const workers: hcloud.Server[] = [];
* for (const range = {value: 0}; range.value < 5; range.value++) {
* workers.push(new hcloud.Server(`workers-${range.value}`, {
* name: `node${range.value}`,
* image: "debian-12",
* serverType: "cx23",
* location: all.then(all => all.locations)[range.value].name,
* }));
* }
* ```
*/
export declare function getLocationsOutput(opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetLocationsResult>;
//# sourceMappingURL=getLocations.d.ts.map