1. Packages
  2. Linode
  3. API Docs
  4. getLkeClusters
Linode v4.22.1 published on Wednesday, Jul 3, 2024 by Pulumi

linode.getLkeClusters

Explore with Pulumi AI

linode logo
Linode v4.22.1 published on Wednesday, Jul 3, 2024 by Pulumi

    Provides information about a list of current Linode Kubernetes (LKE) clusters on your account that match a set of filters.

    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);
    
    import pulumi
    import pulumi_linode as linode
    
    specific = linode.get_lke_clusters(filters=[linode.GetLkeClustersFilterArgs(
        name="tags",
        values=["test-tag"],
    )])
    pulumi.export("lkeCluster", specific.lke_clusters[0].id)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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.applyValue(getLkeClustersResult -> getLkeClustersResult.lkeClusters()[0].id()));
        }
    }
    
    variables:
      specific:
        fn::invoke:
          Function: linode:getLkeClusters
          Arguments:
            filters:
              - name: tags
                values:
                  - test-tag
    outputs:
      lkeCluster: ${specific.lkeClusters[0].id}
    

    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>
    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]
    func GetLkeClusters(ctx *Context, args *GetLkeClustersArgs, opts ...InvokeOption) (*GetLkeClustersResult, error)
    func GetLkeClustersOutput(ctx *Context, args *GetLkeClustersOutputArgs, opts ...InvokeOption) GetLkeClustersResultOutput

    > 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)
    }
    public static CompletableFuture<GetLkeClustersResult> getLkeClusters(GetLkeClustersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getLkeClusters:getLkeClusters
      arguments:
        # arguments dictionary

    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 string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values 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 string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []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 String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values 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 string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values 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 str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values 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 String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values 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

    Created string
    When this Kubernetes cluster was created.
    Id int
    The LKE Cluster's ID.
    K8sVersion string
    The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
    Label string
    The unique label for the cluster.
    Region string
    This Kubernetes cluster's location.
    Status string
    The status of the cluster.
    Tags List<string>
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    Updated string
    When this Kubernetes cluster was updated.
    ControlPlane GetLkeClustersLkeClusterControlPlane
    Defines settings for the Kubernetes Control Plane.
    Created string
    When this Kubernetes cluster was created.
    Id int
    The LKE Cluster's ID.
    K8sVersion string
    The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
    Label string
    The unique label for the cluster.
    Region string
    This Kubernetes cluster's location.
    Status string
    The status of the cluster.
    Tags []string
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    Updated string
    When this Kubernetes cluster was updated.
    ControlPlane GetLkeClustersLkeClusterControlPlane
    Defines settings for the Kubernetes Control Plane.
    created String
    When this Kubernetes cluster was created.
    id Integer
    The LKE Cluster's ID.
    k8sVersion String
    The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
    label String
    The unique label for the cluster.
    region String
    This Kubernetes cluster's location.
    status String
    The status of the cluster.
    tags List<String>
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated String
    When this Kubernetes cluster was updated.
    controlPlane GetLkeClustersLkeClusterControlPlane
    Defines settings for the Kubernetes Control Plane.
    created string
    When this Kubernetes cluster was created.
    id number
    The LKE Cluster's ID.
    k8sVersion string
    The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
    label string
    The unique label for the cluster.
    region string
    This Kubernetes cluster's location.
    status string
    The status of the cluster.
    tags string[]
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated string
    When this Kubernetes cluster was updated.
    controlPlane GetLkeClustersLkeClusterControlPlane
    Defines settings for the Kubernetes Control Plane.
    created str
    When this Kubernetes cluster was created.
    id int
    The LKE Cluster's ID.
    k8s_version str
    The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
    label str
    The unique label for the cluster.
    region str
    This Kubernetes cluster's location.
    status str
    The status of the cluster.
    tags Sequence[str]
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated str
    When this Kubernetes cluster was updated.
    control_plane GetLkeClustersLkeClusterControlPlane
    Defines settings for the Kubernetes Control Plane.
    created String
    When this Kubernetes cluster was created.
    id Number
    The LKE Cluster's ID.
    k8sVersion String
    The Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.17).
    label String
    The unique label for the cluster.
    region String
    This Kubernetes cluster's location.
    status String
    The status of the cluster.
    tags List<String>
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated String
    When this Kubernetes cluster was updated.
    controlPlane Property Map
    Defines settings for the Kubernetes Control Plane.

    GetLkeClustersLkeClusterControlPlane

    HighAvailability bool
    Whether High Availability is enabled for the cluster Control Plane.
    HighAvailability bool
    Whether High Availability is enabled for the cluster Control Plane.
    highAvailability Boolean
    Whether High Availability is enabled for the cluster Control Plane.
    highAvailability boolean
    Whether High Availability is enabled for the cluster Control Plane.
    high_availability bool
    Whether High Availability is enabled for the cluster Control Plane.
    highAvailability 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.
    linode logo
    Linode v4.22.1 published on Wednesday, Jul 3, 2024 by Pulumi