1. Packages
  2. Linode Provider
  3. API Docs
  4. getLkeClusters
Linode v4.38.0 published on Thursday, Apr 24, 2025 by Pulumi

linode.getLkeClusters

Explore with Pulumi AI

Provides information about a list of current Linode Kubernetes (LKE) clusters on your account that match a set of filters. For more information, see the Linode APIv4 docs.

Example Usage

Get information about all LKE clusters with a specific tag:

import * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";

const specific = linode.getLkeClusters({
    filters: [{
        name: "tags",
        values: ["test-tag"],
    }],
});
export const lkeCluster = specific.then(specific => specific.lkeClusters?.[0]?.id);
Copy
import pulumi
import pulumi_linode as linode

specific = linode.get_lke_clusters(filters=[{
    "name": "tags",
    "values": ["test-tag"],
}])
pulumi.export("lkeCluster", specific.lke_clusters[0].id)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		specific, err := linode.GetLkeClusters(ctx, &linode.GetLkeClustersArgs{
			Filters: []linode.GetLkeClustersFilter{
				{
					Name: "tags",
					Values: []string{
						"test-tag",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("lkeCluster", specific.LkeClusters[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Linode = Pulumi.Linode;

return await Deployment.RunAsync(() => 
{
    var specific = Linode.GetLkeClusters.Invoke(new()
    {
        Filters = new[]
        {
            new Linode.Inputs.GetLkeClustersFilterInputArgs
            {
                Name = "tags",
                Values = new[]
                {
                    "test-tag",
                },
            },
        },
    });

    return new Dictionary<string, object?>
    {
        ["lkeCluster"] = specific.Apply(getLkeClustersResult => getLkeClustersResult.LkeClusters[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.linode.LinodeFunctions;
import com.pulumi.linode.inputs.GetLkeClustersArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var specific = LinodeFunctions.getLkeClusters(GetLkeClustersArgs.builder()
            .filters(GetLkeClustersFilterArgs.builder()
                .name("tags")
                .values("test-tag")
                .build())
            .build());

        ctx.export("lkeCluster", specific.lkeClusters()[0].id());
    }
}
Copy
variables:
  specific:
    fn::invoke:
      function: linode:getLkeClusters
      arguments:
        filters:
          - name: tags
            values:
              - test-tag
outputs:
  lkeCluster: ${specific.lkeClusters[0].id}
Copy

Filterable Fields

  • k8s_version

  • label

  • region

  • tags

  • status

  • created

  • updated

Using getLkeClusters

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 getLkeClusters(args: GetLkeClustersArgs, opts?: InvokeOptions): Promise<GetLkeClustersResult>
function getLkeClustersOutput(args: GetLkeClustersOutputArgs, opts?: InvokeOptions): Output<GetLkeClustersResult>
Copy
def get_lke_clusters(filters: Optional[Sequence[GetLkeClustersFilter]] = None,
                     lke_clusters: Optional[Sequence[GetLkeClustersLkeCluster]] = None,
                     order: Optional[str] = None,
                     order_by: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLkeClustersResult
def get_lke_clusters_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLkeClustersFilterArgs]]]] = None,
                     lke_clusters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLkeClustersLkeClusterArgs]]]] = None,
                     order: Optional[pulumi.Input[str]] = None,
                     order_by: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetLkeClustersResult]
Copy
func GetLkeClusters(ctx *Context, args *GetLkeClustersArgs, opts ...InvokeOption) (*GetLkeClustersResult, error)
func GetLkeClustersOutput(ctx *Context, args *GetLkeClustersOutputArgs, opts ...InvokeOption) GetLkeClustersResultOutput
Copy

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

public static class GetLkeClusters 
{
    public static Task<GetLkeClustersResult> InvokeAsync(GetLkeClustersArgs args, InvokeOptions? opts = null)
    public static Output<GetLkeClustersResult> Invoke(GetLkeClustersInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLkeClustersResult> getLkeClusters(GetLkeClustersArgs args, InvokeOptions options)
public static Output<GetLkeClustersResult> getLkeClusters(GetLkeClustersArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: linode:index/getLkeClusters:getLkeClusters
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetLkeClustersFilter>
LkeClusters List<GetLkeClustersLkeCluster>
Order string
The order in which results should be returned. (asc, desc; default asc)
OrderBy string
The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
Filters []GetLkeClustersFilter
LkeClusters []GetLkeClustersLkeCluster
Order string
The order in which results should be returned. (asc, desc; default asc)
OrderBy string
The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
filters List<GetLkeClustersFilter>
lkeClusters List<GetLkeClustersLkeCluster>
order String
The order in which results should be returned. (asc, desc; default asc)
orderBy String
The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
filters GetLkeClustersFilter[]
lkeClusters GetLkeClustersLkeCluster[]
order string
The order in which results should be returned. (asc, desc; default asc)
orderBy string
The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
filters Sequence[GetLkeClustersFilter]
lke_clusters Sequence[GetLkeClustersLkeCluster]
order str
The order in which results should be returned. (asc, desc; default asc)
order_by str
The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
filters List<Property Map>
lkeClusters List<Property Map>
order String
The order in which results should be returned. (asc, desc; default asc)
orderBy String
The attribute to order the results by. See the Filterable Fields section for a list of valid fields.

getLkeClusters Result

The following output properties are available:

Supporting Types

GetLkeClustersFilter

Name This property is required. string
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
Values This property is required. List<string>
A list of values for the filter to allow. These values should all be in string form.
MatchBy string
The method to match the field by. (exact, regex, substring; default exact)
Name This property is required. string
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
Values This property is required. []string
A list of values for the filter to allow. These values should all be in string form.
MatchBy string
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. String
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. List<String>
A list of values for the filter to allow. These values should all be in string form.
matchBy String
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. string
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. string[]
A list of values for the filter to allow. These values should all be in string form.
matchBy string
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. str
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. Sequence[str]
A list of values for the filter to allow. These values should all be in string form.
match_by str
The method to match the field by. (exact, regex, substring; default exact)
name This property is required. String
The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
values This property is required. List<String>
A list of values for the filter to allow. These values should all be in string form.
matchBy String
The method to match the field by. (exact, regex, substring; default exact)

GetLkeClustersLkeCluster

AplEnabled This property is required. bool
Enables the App Platform Layer for this cluster. Note: v4beta only and may not currently be available to all users.
Created This property is required. string
When this Kubernetes cluster was created.
Id This property is required. int
The LKE Cluster's ID.
K8sVersion This property is required. string
The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
Label This property is required. string
The unique label for the cluster.
Region This property is required. string
This Kubernetes cluster's location.
Status This property is required. string
The status of the cluster.
Tags This property is required. List<string>
An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
Tier This property is required. string
The desired Kubernetes tier. (Note: v4beta only and may not currently be available to all users.)
Updated This property is required. string
When this Kubernetes cluster was updated.
ControlPlane GetLkeClustersLkeClusterControlPlane
Defines settings for the Kubernetes Control Plane.
AplEnabled This property is required. bool
Enables the App Platform Layer for this cluster. Note: v4beta only and may not currently be available to all users.
Created This property is required. string
When this Kubernetes cluster was created.
Id This property is required. int
The LKE Cluster's ID.
K8sVersion This property is required. string
The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
Label This property is required. string
The unique label for the cluster.
Region This property is required. string
This Kubernetes cluster's location.
Status This property is required. string
The status of the cluster.
Tags This property is required. []string
An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
Tier This property is required. string
The desired Kubernetes tier. (Note: v4beta only and may not currently be available to all users.)
Updated This property is required. string
When this Kubernetes cluster was updated.
ControlPlane GetLkeClustersLkeClusterControlPlane
Defines settings for the Kubernetes Control Plane.
aplEnabled This property is required. Boolean
Enables the App Platform Layer for this cluster. Note: v4beta only and may not currently be available to all users.
created This property is required. String
When this Kubernetes cluster was created.
id This property is required. Integer
The LKE Cluster's ID.
k8sVersion This property is required. String
The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
label This property is required. String
The unique label for the cluster.
region This property is required. String
This Kubernetes cluster's location.
status This property is required. String
The status of the cluster.
tags This property is required. List<String>
An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
tier This property is required. String
The desired Kubernetes tier. (Note: v4beta only and may not currently be available to all users.)
updated This property is required. String
When this Kubernetes cluster was updated.
controlPlane GetLkeClustersLkeClusterControlPlane
Defines settings for the Kubernetes Control Plane.
aplEnabled This property is required. boolean
Enables the App Platform Layer for this cluster. Note: v4beta only and may not currently be available to all users.
created This property is required. string
When this Kubernetes cluster was created.
id This property is required. number
The LKE Cluster's ID.
k8sVersion This property is required. string
The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
label This property is required. string
The unique label for the cluster.
region This property is required. string
This Kubernetes cluster's location.
status This property is required. string
The status of the cluster.
tags This property is required. string[]
An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
tier This property is required. string
The desired Kubernetes tier. (Note: v4beta only and may not currently be available to all users.)
updated This property is required. string
When this Kubernetes cluster was updated.
controlPlane GetLkeClustersLkeClusterControlPlane
Defines settings for the Kubernetes Control Plane.
apl_enabled This property is required. bool
Enables the App Platform Layer for this cluster. Note: v4beta only and may not currently be available to all users.
created This property is required. str
When this Kubernetes cluster was created.
id This property is required. int
The LKE Cluster's ID.
k8s_version This property is required. str
The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
label This property is required. str
The unique label for the cluster.
region This property is required. str
This Kubernetes cluster's location.
status This property is required. str
The status of the cluster.
tags This property is required. Sequence[str]
An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
tier This property is required. str
The desired Kubernetes tier. (Note: v4beta only and may not currently be available to all users.)
updated This property is required. str
When this Kubernetes cluster was updated.
control_plane GetLkeClustersLkeClusterControlPlane
Defines settings for the Kubernetes Control Plane.
aplEnabled This property is required. Boolean
Enables the App Platform Layer for this cluster. Note: v4beta only and may not currently be available to all users.
created This property is required. String
When this Kubernetes cluster was created.
id This property is required. Number
The LKE Cluster's ID.
k8sVersion This property is required. String
The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
label This property is required. String
The unique label for the cluster.
region This property is required. String
This Kubernetes cluster's location.
status This property is required. String
The status of the cluster.
tags This property is required. List<String>
An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
tier This property is required. String
The desired Kubernetes tier. (Note: v4beta only and may not currently be available to all users.)
updated This property is required. String
When this Kubernetes cluster was updated.
controlPlane Property Map
Defines settings for the Kubernetes Control Plane.

GetLkeClustersLkeClusterControlPlane

HighAvailability This property is required. bool
Whether High Availability is enabled for the cluster Control Plane.
HighAvailability This property is required. bool
Whether High Availability is enabled for the cluster Control Plane.
highAvailability This property is required. Boolean
Whether High Availability is enabled for the cluster Control Plane.
highAvailability This property is required. boolean
Whether High Availability is enabled for the cluster Control Plane.
high_availability This property is required. bool
Whether High Availability is enabled for the cluster Control Plane.
highAvailability This property is required. Boolean
Whether High Availability is enabled for the cluster Control Plane.

Package Details

Repository
Linode pulumi/pulumi-linode
License
Apache-2.0
Notes
This Pulumi package is based on the linode Terraform Provider.