UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

142 lines 4.61 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getKubernetesVersionsOutput = exports.getKubernetesVersions = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides access to the available DigitalOcean Kubernetes Service versions. * * ## Example Usage * * ### Output a list of all available versions * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * export = async () => { * const example = await digitalocean.getKubernetesVersions({}); * return { * "k8s-versions": example.validVersions, * }; * } * ``` * * ### Create a Kubernetes cluster using the most recent version available * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getKubernetesVersions({}); * const example_cluster = new digitalocean.KubernetesCluster("example-cluster", { * name: "example-cluster", * region: digitalocean.Region.LON1, * version: example.then(example => example.latestVersion), * nodePool: { * name: "default", * size: "s-1vcpu-2gb", * nodeCount: 3, * }, * }); * ``` * * ### Pin a Kubernetes cluster to a specific minor version * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getKubernetesVersions({ * versionPrefix: "1.22.", * }); * const example_cluster = new digitalocean.KubernetesCluster("example-cluster", { * name: "example-cluster", * region: digitalocean.Region.LON1, * version: example.then(example => example.latestVersion), * nodePool: { * name: "default", * size: "s-1vcpu-2gb", * nodeCount: 3, * }, * }); * ``` */ function getKubernetesVersions(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("digitalocean:index/getKubernetesVersions:getKubernetesVersions", { "versionPrefix": args.versionPrefix, }, opts); } exports.getKubernetesVersions = getKubernetesVersions; /** * Provides access to the available DigitalOcean Kubernetes Service versions. * * ## Example Usage * * ### Output a list of all available versions * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * export = async () => { * const example = await digitalocean.getKubernetesVersions({}); * return { * "k8s-versions": example.validVersions, * }; * } * ``` * * ### Create a Kubernetes cluster using the most recent version available * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getKubernetesVersions({}); * const example_cluster = new digitalocean.KubernetesCluster("example-cluster", { * name: "example-cluster", * region: digitalocean.Region.LON1, * version: example.then(example => example.latestVersion), * nodePool: { * name: "default", * size: "s-1vcpu-2gb", * nodeCount: 3, * }, * }); * ``` * * ### Pin a Kubernetes cluster to a specific minor version * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const example = digitalocean.getKubernetesVersions({ * versionPrefix: "1.22.", * }); * const example_cluster = new digitalocean.KubernetesCluster("example-cluster", { * name: "example-cluster", * region: digitalocean.Region.LON1, * version: example.then(example => example.latestVersion), * nodePool: { * name: "default", * size: "s-1vcpu-2gb", * nodeCount: 3, * }, * }); * ``` */ function getKubernetesVersionsOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("digitalocean:index/getKubernetesVersions:getKubernetesVersions", { "versionPrefix": args.versionPrefix, }, opts); } exports.getKubernetesVersionsOutput = getKubernetesVersionsOutput; //# sourceMappingURL=getKubernetesVersions.js.map