@pulumi/hcloud
Version:
A Pulumi package for creating and managing hcloud cloud resources.
83 lines • 3.09 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "./types/output";
/**
* Provides a list of available Hetzner Cloud Datacenters.
*
* This resource may be useful to create highly available infrastructure, distributed across several Datacenters.
*
* > The `hcloud.getDatacenters` data source is deprecated, and will be removed after 1 Oct. 2026.
* After this date, requests to the datacenters API endpoints will return `HTTP 410 Gone`.
* Please use the `hcloud.getLocations` data source instead.
* See the [changelog](https://docs.hetzner.cloud/changelog#2026-06-02-datacenters-deprecated) for more details.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const all = hcloud.getDatacenters({});
* 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",
* datacenter: all.then(all => all.datacenters)[range.value].name,
* }));
* }
* ```
*/
export declare function getDatacenters(opts?: pulumi.InvokeOptions): Promise<GetDatacentersResult>;
/**
* A collection of values returned by getDatacenters.
*/
export interface GetDatacentersResult {
/**
* @deprecated Use datacenters list instead
*/
readonly datacenterIds: string[];
readonly datacenters: outputs.GetDatacentersDatacenter[];
/**
* @deprecated Use datacenters list instead
*/
readonly descriptions: string[];
/**
* The ID of this resource.
*/
readonly id: string;
/**
* @deprecated Use datacenters list instead
*/
readonly names: string[];
}
/**
* Provides a list of available Hetzner Cloud Datacenters.
*
* This resource may be useful to create highly available infrastructure, distributed across several Datacenters.
*
* > The `hcloud.getDatacenters` data source is deprecated, and will be removed after 1 Oct. 2026.
* After this date, requests to the datacenters API endpoints will return `HTTP 410 Gone`.
* Please use the `hcloud.getLocations` data source instead.
* See the [changelog](https://docs.hetzner.cloud/changelog#2026-06-02-datacenters-deprecated) for more details.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const all = hcloud.getDatacenters({});
* 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",
* datacenter: all.then(all => all.datacenters)[range.value].name,
* }));
* }
* ```
*/
export declare function getDatacentersOutput(opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetDatacentersResult>;
//# sourceMappingURL=getDatacenters.d.ts.map