getKubernetesVersion

Provides access to the available Civo Kubernetes Service versions, with the ability to filter the results.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var stable = Output.Create(Civo.GetKubernetesVersion.InvokeAsync(new Civo.GetKubernetesVersionArgs
        {
            Filters = 
            {
                new Civo.Inputs.GetKubernetesVersionFilterArgs
                {
                    Key = "type",
                    Values = 
                    {
                        "stable",
                    },
                },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := civo.GetKubernetesVersion(ctx, &civo.GetKubernetesVersionArgs{
			Filters: []civo.GetKubernetesVersionFilter{
				civo.GetKubernetesVersionFilter{
					Key: "type",
					Values: []string{
						"stable",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_civo as civo

stable = civo.get_kubernetes_version(filters=[civo.GetKubernetesVersionFilterArgs(
    key="type",
    values=["stable"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const stable = pulumi.output(civo.getKubernetesVersion({
    filters: [{
        key: "type",
        values: ["stable"],
    }],
}, { async: true }));

Pin a Kubernetes cluster to a specific minor version

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var minorVersion = Output.Create(Civo.GetKubernetesVersion.InvokeAsync(new Civo.GetKubernetesVersionArgs
        {
            Filters = 
            {
                new Civo.Inputs.GetKubernetesVersionFilterArgs
                {
                    Key = "version",
                    Values = 
                    {
                        "0.9.1",
                    },
                },
            },
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := civo.GetKubernetesVersion(ctx, &civo.GetKubernetesVersionArgs{
			Filters: []civo.GetKubernetesVersionFilter{
				civo.GetKubernetesVersionFilter{
					Key: "version",
					Values: []string{
						"0.9.1",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_civo as civo

minor_version = civo.get_kubernetes_version(filters=[civo.GetKubernetesVersionFilterArgs(
    key="version",
    values=["0.9.1"],
)])
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const minorVersion = pulumi.output(civo.getKubernetesVersion({
    filters: [{
        key: "version",
        values: ["0.9.1"],
    }],
}, { async: true }));

Using getKubernetesVersion

function getKubernetesVersion(args: GetKubernetesVersionArgs, opts?: InvokeOptions): Promise<GetKubernetesVersionResult>
def get_kubernetes_version(filters: Optional[Sequence[GetKubernetesVersionFilter]] = None,
                           sorts: Optional[Sequence[GetKubernetesVersionSort]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetKubernetesVersionResult
func GetKubernetesVersion(ctx *Context, args *GetKubernetesVersionArgs, opts ...InvokeOption) (*GetKubernetesVersionResult, error)

Note: This function is named GetKubernetesVersion in the Go SDK.

public static class GetKubernetesVersion {
    public static Task<GetKubernetesVersionResult> InvokeAsync(GetKubernetesVersionArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Filters List<GetKubernetesVersionFilter>
Filter the results. The filter block is documented below.
Sorts List<GetKubernetesVersionSort>
Sort the results. The sort block is documented below.
Filters []GetKubernetesVersionFilter
Filter the results. The filter block is documented below.
Sorts []GetKubernetesVersionSort
Sort the results. The sort block is documented below.
filters GetKubernetesVersionFilter[]
Filter the results. The filter block is documented below.
sorts GetKubernetesVersionSort[]
Sort the results. The sort block is documented below.
filters Sequence[GetKubernetesVersionFilter]
Filter the results. The filter block is documented below.
sorts Sequence[GetKubernetesVersionSort]
Sort the results. The sort block is documented below.

getKubernetesVersion Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Versions List<GetKubernetesVersionVersion>
Filters List<GetKubernetesVersionFilter>
Sorts List<GetKubernetesVersionSort>
Id string
The provider-assigned unique ID for this managed resource.
Versions []GetKubernetesVersionVersion
Filters []GetKubernetesVersionFilter
Sorts []GetKubernetesVersionSort
id string
The provider-assigned unique ID for this managed resource.
versions GetKubernetesVersionVersion[]
filters GetKubernetesVersionFilter[]
sorts GetKubernetesVersionSort[]
id str
The provider-assigned unique ID for this managed resource.
versions Sequence[GetKubernetesVersionVersion]
filters Sequence[GetKubernetesVersionFilter]
sorts Sequence[GetKubernetesVersionSort]

Supporting Types

GetKubernetesVersionFilter

Key string
Filter the sizes by this key. This may be one of version, label, type, default.
Values List<string>
Only retrieves the version which keys has value that matches one of the values provided here.
All bool
MatchBy string
Key string
Filter the sizes by this key. This may be one of version, label, type, default.
Values []string
Only retrieves the version which keys has value that matches one of the values provided here.
All bool
MatchBy string
key string
Filter the sizes by this key. This may be one of version, label, type, default.
values string[]
Only retrieves the version which keys has value that matches one of the values provided here.
all boolean
matchBy string
key str
Filter the sizes by this key. This may be one of version, label, type, default.
values Sequence[str]
Only retrieves the version which keys has value that matches one of the values provided here.
all bool
match_by str

GetKubernetesVersionSort

Key string
Sort the sizes by this key. This may be one of version.
Direction string
The sort direction. This may be either asc or desc.
Key string
Sort the sizes by this key. This may be one of version.
Direction string
The sort direction. This may be either asc or desc.
key string
Sort the sizes by this key. This may be one of version.
direction string
The sort direction. This may be either asc or desc.
key str
Sort the sizes by this key. This may be one of version.
direction str
The sort direction. This may be either asc or desc.

GetKubernetesVersionVersion

Default bool
If is the default version used in all cluster.
Label string
The label of this version.
Type string
The type of the version can be stable, legacy etc…
Version string
A version of the kubernetes.
Default bool
If is the default version used in all cluster.
Label string
The label of this version.
Type string
The type of the version can be stable, legacy etc…
Version string
A version of the kubernetes.
default boolean
If is the default version used in all cluster.
label string
The label of this version.
type string
The type of the version can be stable, legacy etc…
version string
A version of the kubernetes.
default bool
If is the default version used in all cluster.
label str
The label of this version.
type str
The type of the version can be stable, legacy etc…
version str
A version of the kubernetes.

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.