UNPKG

@pulumi/nomad

Version:

A Pulumi package for creating and managing nomad cloud resources.

63 lines (62 loc) 2.01 kB
import * as pulumi from "@pulumi/pulumi"; /** * Retrieve a list of regions available in Nomad. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * function notImplemented(message: string) { * throw new Error(message); * } * * const myRegions = nomad.getRegions({}); * const jobs = notImplemented("The template_file data resource is not yet supported."); * const app: nomad.Job[] = []; * myRegions.then(myRegions => myRegions.regions).length.apply(rangeBody => { * for (const range = {value: 0}; range.value < rangeBody; range.value++) { * app.push(new nomad.Job(`app-${range.value}`, {jobspec: jobs[range.value].rendered})); * } * }); * ``` */ export declare function getRegions(opts?: pulumi.InvokeOptions): Promise<GetRegionsResult>; /** * A collection of values returned by getRegions. */ export interface GetRegionsResult { /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * `(list of strings)` - a list of regions available in the cluster. */ readonly regions: string[]; } /** * Retrieve a list of regions available in Nomad. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * function notImplemented(message: string) { * throw new Error(message); * } * * const myRegions = nomad.getRegions({}); * const jobs = notImplemented("The template_file data resource is not yet supported."); * const app: nomad.Job[] = []; * myRegions.then(myRegions => myRegions.regions).length.apply(rangeBody => { * for (const range = {value: 0}; range.value < rangeBody; range.value++) { * app.push(new nomad.Job(`app-${range.value}`, {jobspec: jobs[range.value].rendered})); * } * }); * ``` */ export declare function getRegionsOutput(opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetRegionsResult>;