@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
158 lines (157 loc) • 4.87 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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,
* },
* });
* ```
*/
export declare function getKubernetesVersions(args?: GetKubernetesVersionsArgs, opts?: pulumi.InvokeOptions): Promise<GetKubernetesVersionsResult>;
/**
* A collection of arguments for invoking getKubernetesVersions.
*/
export interface GetKubernetesVersionsArgs {
/**
* If provided, the provider will only return versions that match the string prefix. For example, `1.15.` will match all 1.15.x series releases.
*/
versionPrefix?: string;
}
/**
* A collection of values returned by getKubernetesVersions.
*/
export interface GetKubernetesVersionsResult {
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* The most recent version available.
*/
readonly latestVersion: string;
/**
* A list of available versions.
*/
readonly validVersions: string[];
readonly versionPrefix?: string;
}
/**
* 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,
* },
* });
* ```
*/
export declare function getKubernetesVersionsOutput(args?: GetKubernetesVersionsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetKubernetesVersionsResult>;
/**
* A collection of arguments for invoking getKubernetesVersions.
*/
export interface GetKubernetesVersionsOutputArgs {
/**
* If provided, the provider will only return versions that match the string prefix. For example, `1.15.` will match all 1.15.x series releases.
*/
versionPrefix?: pulumi.Input<string>;
}