DigitalOcean

Pulumi Official
Package maintained by Pulumi
v4.12.0 published on Wednesday, Apr 6, 2022 by Pulumi

getKubernetesVersions

Provides access to the available DigitalOcean Kubernetes Service versions.

Example Usage

Output a list of all available versions

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(DigitalOcean.GetKubernetesVersions.InvokeAsync());
        this.K8s_versions = example.Apply(example => example.ValidVersions);
    }

    [Output("k8s-versions")]
    public Output<string> K8s_versions { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := digitalocean.GetKubernetesVersions(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("k8s-versions", example.ValidVersions)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_kubernetes_versions()
pulumi.export("k8s-versions", example.valid_versions)
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getKubernetesVersions({});
export const k8s_versions = example.then(example => example.validVersions);

Coming soon!

Create a Kubernetes cluster using the most recent version available

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(DigitalOcean.GetKubernetesVersions.InvokeAsync());
        var example_cluster = new DigitalOcean.KubernetesCluster("example-cluster", new DigitalOcean.KubernetesClusterArgs
        {
            Region = "lon1",
            Version = example.Apply(example => example.LatestVersion),
            NodePool = new DigitalOcean.Inputs.KubernetesClusterNodePoolArgs
            {
                Name = "default",
                Size = "s-1vcpu-2gb",
                NodeCount = 3,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := digitalocean.GetKubernetesVersions(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = digitalocean.NewKubernetesCluster(ctx, "example-cluster", &digitalocean.KubernetesClusterArgs{
			Region:  pulumi.String("lon1"),
			Version: pulumi.String(example.LatestVersion),
			NodePool: &KubernetesClusterNodePoolArgs{
				Name:      pulumi.String("default"),
				Size:      pulumi.String("s-1vcpu-2gb"),
				NodeCount: pulumi.Int(3),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_kubernetes_versions()
example_cluster = digitalocean.KubernetesCluster("example-cluster",
    region="lon1",
    version=example.latest_version,
    node_pool=digitalocean.KubernetesClusterNodePoolArgs(
        name="default",
        size="s-1vcpu-2gb",
        node_count=3,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getKubernetesVersions({});
const example_cluster = new digitalocean.KubernetesCluster("example-cluster", {
    region: "lon1",
    version: example.then(example => example.latestVersion),
    nodePool: {
        name: "default",
        size: "s-1vcpu-2gb",
        nodeCount: 3,
    },
});

Coming soon!

Pin a Kubernetes cluster to a specific minor version

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(DigitalOcean.GetKubernetesVersions.InvokeAsync(new DigitalOcean.GetKubernetesVersionsArgs
        {
            VersionPrefix = "1.16.",
        }));
        var example_cluster = new DigitalOcean.KubernetesCluster("example-cluster", new DigitalOcean.KubernetesClusterArgs
        {
            Region = "lon1",
            Version = example.Apply(example => example.LatestVersion),
            NodePool = new DigitalOcean.Inputs.KubernetesClusterNodePoolArgs
            {
                Name = "default",
                Size = "s-1vcpu-2gb",
                NodeCount = 3,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := digitalocean.GetKubernetesVersions(ctx, &GetKubernetesVersionsArgs{
			VersionPrefix: pulumi.StringRef("1.16."),
		}, nil)
		if err != nil {
			return err
		}
		_, err = digitalocean.NewKubernetesCluster(ctx, "example-cluster", &digitalocean.KubernetesClusterArgs{
			Region:  pulumi.String("lon1"),
			Version: pulumi.String(example.LatestVersion),
			NodePool: &KubernetesClusterNodePoolArgs{
				Name:      pulumi.String("default"),
				Size:      pulumi.String("s-1vcpu-2gb"),
				NodeCount: pulumi.Int(3),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_kubernetes_versions(version_prefix="1.16.")
example_cluster = digitalocean.KubernetesCluster("example-cluster",
    region="lon1",
    version=example.latest_version,
    node_pool=digitalocean.KubernetesClusterNodePoolArgs(
        name="default",
        size="s-1vcpu-2gb",
        node_count=3,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getKubernetesVersions({
    versionPrefix: "1.16.",
});
const example_cluster = new digitalocean.KubernetesCluster("example-cluster", {
    region: "lon1",
    version: example.then(example => example.latestVersion),
    nodePool: {
        name: "default",
        size: "s-1vcpu-2gb",
        nodeCount: 3,
    },
});

Coming soon!

Using getKubernetesVersions

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getKubernetesVersions(args: GetKubernetesVersionsArgs, opts?: InvokeOptions): Promise<GetKubernetesVersionsResult>
function getKubernetesVersionsOutput(args: GetKubernetesVersionsOutputArgs, opts?: InvokeOptions): Output<GetKubernetesVersionsResult>
def get_kubernetes_versions(version_prefix: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetKubernetesVersionsResult
def get_kubernetes_versions_output(version_prefix: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetKubernetesVersionsResult]
func GetKubernetesVersions(ctx *Context, args *GetKubernetesVersionsArgs, opts ...InvokeOption) (*GetKubernetesVersionsResult, error)
func GetKubernetesVersionsOutput(ctx *Context, args *GetKubernetesVersionsOutputArgs, opts ...InvokeOption) GetKubernetesVersionsResultOutput

> Note: This function is named GetKubernetesVersions in the Go SDK.

public static class GetKubernetesVersions 
{
    public static Task<GetKubernetesVersionsResult> InvokeAsync(GetKubernetesVersionsArgs args, InvokeOptions? opts = null)
    public static Output<GetKubernetesVersionsResult> Invoke(GetKubernetesVersionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetKubernetesVersionsResult> getKubernetesVersions(GetKubernetesVersionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: digitalocean:index/getKubernetesVersions:getKubernetesVersions
  Arguments:
    # Arguments dictionary

The following arguments are supported:

VersionPrefix string

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

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

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

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.

version_prefix str

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

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.

getKubernetesVersions Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

LatestVersion string

The most recent version available.

ValidVersions List<string>

A list of available versions.

VersionPrefix string
Id string

The provider-assigned unique ID for this managed resource.

LatestVersion string

The most recent version available.

ValidVersions []string

A list of available versions.

VersionPrefix string
id String

The provider-assigned unique ID for this managed resource.

latestVersion String

The most recent version available.

validVersions List

A list of available versions.

versionPrefix String
id string

The provider-assigned unique ID for this managed resource.

latestVersion string

The most recent version available.

validVersions string[]

A list of available versions.

versionPrefix string
id str

The provider-assigned unique ID for this managed resource.

latest_version str

The most recent version available.

valid_versions Sequence[str]

A list of available versions.

version_prefix str
id String

The provider-assigned unique ID for this managed resource.

latestVersion String

The most recent version available.

validVersions List

A list of available versions.

versionPrefix String

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes

This Pulumi package is based on the digitalocean Terraform Provider.