1. Packages
  2. Civo
  3. API Docs
  4. getKubernetesVersion
Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi

civo.getKubernetesVersion

Explore with Pulumi AI

civo logo
Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as civo from "@pulumi/civo";
    
    const talos = civo.getKubernetesVersion({
        filters: [{
            key: "type",
            values: ["talos"],
        }],
    });
    const k3s = civo.getKubernetesVersion({
        filters: [{
            key: "type",
            values: ["k3s"],
        }],
    });
    
    import pulumi
    import pulumi_civo as civo
    
    talos = civo.get_kubernetes_version(filters=[civo.GetKubernetesVersionFilterArgs(
        key="type",
        values=["talos"],
    )])
    k3s = civo.get_kubernetes_version(filters=[civo.GetKubernetesVersionFilterArgs(
        key="type",
        values=["k3s"],
    )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-civo/sdk/v2/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{
    				{
    					Key: "type",
    					Values: []string{
    						"talos",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = civo.GetKubernetesVersion(ctx, &civo.GetKubernetesVersionArgs{
    			Filters: []civo.GetKubernetesVersionFilter{
    				{
    					Key: "type",
    					Values: []string{
    						"k3s",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Civo = Pulumi.Civo;
    
    return await Deployment.RunAsync(() => 
    {
        var talos = Civo.GetKubernetesVersion.Invoke(new()
        {
            Filters = new[]
            {
                new Civo.Inputs.GetKubernetesVersionFilterInputArgs
                {
                    Key = "type",
                    Values = new[]
                    {
                        "talos",
                    },
                },
            },
        });
    
        var k3s = Civo.GetKubernetesVersion.Invoke(new()
        {
            Filters = new[]
            {
                new Civo.Inputs.GetKubernetesVersionFilterInputArgs
                {
                    Key = "type",
                    Values = new[]
                    {
                        "k3s",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.civo.CivoFunctions;
    import com.pulumi.civo.inputs.GetKubernetesVersionArgs;
    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 talos = CivoFunctions.getKubernetesVersion(GetKubernetesVersionArgs.builder()
                .filters(GetKubernetesVersionFilterArgs.builder()
                    .key("type")
                    .values("talos")
                    .build())
                .build());
    
            final var k3s = CivoFunctions.getKubernetesVersion(GetKubernetesVersionArgs.builder()
                .filters(GetKubernetesVersionFilterArgs.builder()
                    .key("type")
                    .values("k3s")
                    .build())
                .build());
    
        }
    }
    
    variables:
      talos:
        fn::invoke:
          Function: civo:getKubernetesVersion
          Arguments:
            filters:
              - key: type
                values:
                  - talos
      k3s:
        fn::invoke:
          Function: civo:getKubernetesVersion
          Arguments:
            filters:
              - key: type
                values:
                  - k3s
    

    Using getKubernetesVersion

    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 getKubernetesVersion(args: GetKubernetesVersionArgs, opts?: InvokeOptions): Promise<GetKubernetesVersionResult>
    function getKubernetesVersionOutput(args: GetKubernetesVersionOutputArgs, opts?: InvokeOptions): Output<GetKubernetesVersionResult>
    def get_kubernetes_version(filters: Optional[Sequence[GetKubernetesVersionFilter]] = None,
                               sorts: Optional[Sequence[GetKubernetesVersionSort]] = None,
                               opts: Optional[InvokeOptions] = None) -> GetKubernetesVersionResult
    def get_kubernetes_version_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetKubernetesVersionFilterArgs]]]] = None,
                               sorts: Optional[pulumi.Input[Sequence[pulumi.Input[GetKubernetesVersionSortArgs]]]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetKubernetesVersionResult]
    func GetKubernetesVersion(ctx *Context, args *GetKubernetesVersionArgs, opts ...InvokeOption) (*GetKubernetesVersionResult, error)
    func GetKubernetesVersionOutput(ctx *Context, args *GetKubernetesVersionOutputArgs, opts ...InvokeOption) GetKubernetesVersionResultOutput

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

    public static class GetKubernetesVersion 
    {
        public static Task<GetKubernetesVersionResult> InvokeAsync(GetKubernetesVersionArgs args, InvokeOptions? opts = null)
        public static Output<GetKubernetesVersionResult> Invoke(GetKubernetesVersionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKubernetesVersionResult> getKubernetesVersion(GetKubernetesVersionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: civo:index/getKubernetesVersion:getKubernetesVersion
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetKubernetesVersionFilter>
    One or more key/value pairs on which to filter results
    Sorts List<GetKubernetesVersionSort>
    One or more key/direction pairs on which to sort results
    Filters []GetKubernetesVersionFilter
    One or more key/value pairs on which to filter results
    Sorts []GetKubernetesVersionSort
    One or more key/direction pairs on which to sort results
    filters List<GetKubernetesVersionFilter>
    One or more key/value pairs on which to filter results
    sorts List<GetKubernetesVersionSort>
    One or more key/direction pairs on which to sort results
    filters GetKubernetesVersionFilter[]
    One or more key/value pairs on which to filter results
    sorts GetKubernetesVersionSort[]
    One or more key/direction pairs on which to sort results
    filters Sequence[GetKubernetesVersionFilter]
    One or more key/value pairs on which to filter results
    sorts Sequence[GetKubernetesVersionSort]
    One or more key/direction pairs on which to sort results
    filters List<Property Map>
    One or more key/value pairs on which to filter results
    sorts List<Property Map>
    One or more key/direction pairs on which to sort results

    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>
    One or more key/value pairs on which to filter results
    Sorts List<GetKubernetesVersionSort>
    One or more key/direction pairs on which to sort results
    Id string
    The provider-assigned unique ID for this managed resource.
    Versions []GetKubernetesVersionVersion
    Filters []GetKubernetesVersionFilter
    One or more key/value pairs on which to filter results
    Sorts []GetKubernetesVersionSort
    One or more key/direction pairs on which to sort results
    id String
    The provider-assigned unique ID for this managed resource.
    versions List<GetKubernetesVersionVersion>
    filters List<GetKubernetesVersionFilter>
    One or more key/value pairs on which to filter results
    sorts List<GetKubernetesVersionSort>
    One or more key/direction pairs on which to sort results
    id string
    The provider-assigned unique ID for this managed resource.
    versions GetKubernetesVersionVersion[]
    filters GetKubernetesVersionFilter[]
    One or more key/value pairs on which to filter results
    sorts GetKubernetesVersionSort[]
    One or more key/direction pairs on which to sort results
    id str
    The provider-assigned unique ID for this managed resource.
    versions Sequence[GetKubernetesVersionVersion]
    filters Sequence[GetKubernetesVersionFilter]
    One or more key/value pairs on which to filter results
    sorts Sequence[GetKubernetesVersionSort]
    One or more key/direction pairs on which to sort results
    id String
    The provider-assigned unique ID for this managed resource.
    versions List<Property Map>
    filters List<Property Map>
    One or more key/value pairs on which to filter results
    sorts List<Property Map>
    One or more key/direction pairs on which to sort results

    Supporting Types

    GetKubernetesVersionFilter

    Key string
    Filter versions by this key. This may be one of default, label, type, version.
    Values List<string>
    Only retrieves versions which keys has value that matches one of the values provided here
    All bool
    Set to true to require that a field match all of the values instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the values are present in the list or set.
    MatchBy string
    One of exact (default), re, or substring. For string-typed fields, specify re to match by using the values as regular expressions, or specify substring to match by treating the values as substrings to find within the string field.
    Key string
    Filter versions by this key. This may be one of default, label, type, version.
    Values []string
    Only retrieves versions which keys has value that matches one of the values provided here
    All bool
    Set to true to require that a field match all of the values instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the values are present in the list or set.
    MatchBy string
    One of exact (default), re, or substring. For string-typed fields, specify re to match by using the values as regular expressions, or specify substring to match by treating the values as substrings to find within the string field.
    key String
    Filter versions by this key. This may be one of default, label, type, version.
    values List<String>
    Only retrieves versions which keys has value that matches one of the values provided here
    all Boolean
    Set to true to require that a field match all of the values instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the values are present in the list or set.
    matchBy String
    One of exact (default), re, or substring. For string-typed fields, specify re to match by using the values as regular expressions, or specify substring to match by treating the values as substrings to find within the string field.
    key string
    Filter versions by this key. This may be one of default, label, type, version.
    values string[]
    Only retrieves versions which keys has value that matches one of the values provided here
    all boolean
    Set to true to require that a field match all of the values instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the values are present in the list or set.
    matchBy string
    One of exact (default), re, or substring. For string-typed fields, specify re to match by using the values as regular expressions, or specify substring to match by treating the values as substrings to find within the string field.
    key str
    Filter versions by this key. This may be one of default, label, type, version.
    values Sequence[str]
    Only retrieves versions which keys has value that matches one of the values provided here
    all bool
    Set to true to require that a field match all of the values instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the values are present in the list or set.
    match_by str
    One of exact (default), re, or substring. For string-typed fields, specify re to match by using the values as regular expressions, or specify substring to match by treating the values as substrings to find within the string field.
    key String
    Filter versions by this key. This may be one of default, label, type, version.
    values List<String>
    Only retrieves versions which keys has value that matches one of the values provided here
    all Boolean
    Set to true to require that a field match all of the values instead of just one or more of them. This is useful when matching against multi-valued fields such as lists or sets where you want to ensure that all of the values are present in the list or set.
    matchBy String
    One of exact (default), re, or substring. For string-typed fields, specify re to match by using the values as regular expressions, or specify substring to match by treating the values as substrings to find within the string field.

    GetKubernetesVersionSort

    Key string
    Sort versions by this key. This may be one of default, label, type, version.
    Direction string
    The sort direction. This may be either asc or desc.
    Key string
    Sort versions by this key. This may be one of default, label, type, version.
    Direction string
    The sort direction. This may be either asc or desc.
    key String
    Sort versions by this key. This may be one of default, label, type, version.
    direction String
    The sort direction. This may be either asc or desc.
    key string
    Sort versions by this key. This may be one of default, label, type, version.
    direction string
    The sort direction. This may be either asc or desc.
    key str
    Sort versions by this key. This may be one of default, label, type, version.
    direction str
    The sort direction. This may be either asc or desc.
    key String
    Sort versions by this key. This may be one of default, label, type, version.
    direction String
    The sort direction. This may be either asc or desc.

    GetKubernetesVersionVersion

    Default bool
    If is the default version used in all cluster, this will return true
    Label string
    The label of this version
    Type string
    The type of the cluster, can be talos or k3s
    Version string
    A version of the Kubernetes
    Default bool
    If is the default version used in all cluster, this will return true
    Label string
    The label of this version
    Type string
    The type of the cluster, can be talos or k3s
    Version string
    A version of the Kubernetes
    default_ Boolean
    If is the default version used in all cluster, this will return true
    label String
    The label of this version
    type String
    The type of the cluster, can be talos or k3s
    version String
    A version of the Kubernetes
    default boolean
    If is the default version used in all cluster, this will return true
    label string
    The label of this version
    type string
    The type of the cluster, can be talos or k3s
    version string
    A version of the Kubernetes
    default bool
    If is the default version used in all cluster, this will return true
    label str
    The label of this version
    type str
    The type of the cluster, can be talos or k3s
    version str
    A version of the Kubernetes
    default Boolean
    If is the default version used in all cluster, this will return true
    label String
    The label of this version
    type String
    The type of the cluster, can be talos or k3s
    version String
    A version of the Kubernetes

    Package Details

    Repository
    Civo pulumi/pulumi-civo
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the civo Terraform Provider.
    civo logo
    Civo v2.3.14 published on Thursday, Mar 21, 2024 by Pulumi