oci logo
Oracle Cloud Infrastructure v0.13.0, Mar 28 23

oci.ContainerEngine.getClusterKubeConfig

This data source provides details about a specific Cluster Kube Config resource in Oracle Cloud Infrastructure Container Engine service.

Create the Kubeconfig YAML for a cluster.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testClusterKubeConfig = Oci.ContainerEngine.GetClusterKubeConfig.Invoke(new()
    {
        ClusterId = oci_containerengine_cluster.Test_cluster.Id,
        Endpoint = @var.Cluster_kube_config_endpoint,
        Expiration = @var.Cluster_kube_config_expiration,
        TokenVersion = @var.Cluster_kube_config_token_version,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ContainerEngine.GetClusterKubeConfig(ctx, &containerengine.GetClusterKubeConfigArgs{
			ClusterId:    oci_containerengine_cluster.Test_cluster.Id,
			Endpoint:     pulumi.StringRef(_var.Cluster_kube_config_endpoint),
			Expiration:   pulumi.IntRef(_var.Cluster_kube_config_expiration),
			TokenVersion: pulumi.StringRef(_var.Cluster_kube_config_token_version),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.ContainerEngine.ContainerEngineFunctions;
import com.pulumi.oci.ContainerEngine.inputs.GetClusterKubeConfigArgs;
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 testClusterKubeConfig = ContainerEngineFunctions.getClusterKubeConfig(GetClusterKubeConfigArgs.builder()
            .clusterId(oci_containerengine_cluster.test_cluster().id())
            .endpoint(var_.cluster_kube_config_endpoint())
            .expiration(var_.cluster_kube_config_expiration())
            .tokenVersion(var_.cluster_kube_config_token_version())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_cluster_kube_config = oci.ContainerEngine.get_cluster_kube_config(cluster_id=oci_containerengine_cluster["test_cluster"]["id"],
    endpoint=var["cluster_kube_config_endpoint"],
    expiration=var["cluster_kube_config_expiration"],
    token_version=var["cluster_kube_config_token_version"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testClusterKubeConfig = oci.ContainerEngine.getClusterKubeConfig({
    clusterId: oci_containerengine_cluster.test_cluster.id,
    endpoint: _var.cluster_kube_config_endpoint,
    expiration: _var.cluster_kube_config_expiration,
    tokenVersion: _var.cluster_kube_config_token_version,
});
variables:
  testClusterKubeConfig:
    fn::invoke:
      Function: oci:ContainerEngine:getClusterKubeConfig
      Arguments:
        clusterId: ${oci_containerengine_cluster.test_cluster.id}
        endpoint: ${var.cluster_kube_config_endpoint}
        expiration: ${var.cluster_kube_config_expiration}
        tokenVersion: ${var.cluster_kube_config_token_version}

Using getClusterKubeConfig

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 getClusterKubeConfig(args: GetClusterKubeConfigArgs, opts?: InvokeOptions): Promise<GetClusterKubeConfigResult>
function getClusterKubeConfigOutput(args: GetClusterKubeConfigOutputArgs, opts?: InvokeOptions): Output<GetClusterKubeConfigResult>
def get_cluster_kube_config(cluster_id: Optional[str] = None,
                            endpoint: Optional[str] = None,
                            expiration: Optional[int] = None,
                            token_version: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetClusterKubeConfigResult
def get_cluster_kube_config_output(cluster_id: Optional[pulumi.Input[str]] = None,
                            endpoint: Optional[pulumi.Input[str]] = None,
                            expiration: Optional[pulumi.Input[int]] = None,
                            token_version: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetClusterKubeConfigResult]
func GetClusterKubeConfig(ctx *Context, args *GetClusterKubeConfigArgs, opts ...InvokeOption) (*GetClusterKubeConfigResult, error)
func GetClusterKubeConfigOutput(ctx *Context, args *GetClusterKubeConfigOutputArgs, opts ...InvokeOption) GetClusterKubeConfigResultOutput

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

public static class GetClusterKubeConfig 
{
    public static Task<GetClusterKubeConfigResult> InvokeAsync(GetClusterKubeConfigArgs args, InvokeOptions? opts = null)
    public static Output<GetClusterKubeConfigResult> Invoke(GetClusterKubeConfigInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetClusterKubeConfigResult> getClusterKubeConfig(GetClusterKubeConfigArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: oci:ContainerEngine/getClusterKubeConfig:getClusterKubeConfig
  arguments:
    # arguments dictionary

The following arguments are supported:

ClusterId string

The OCID of the cluster.

Endpoint string

The endpoint to target. A cluster may have multiple endpoints exposed but the kubeconfig can only target one at a time.

Expiration int

Deprecated. This field is no longer used.

TokenVersion string

The version of the kubeconfig token. Supported value 2.0.0

ClusterId string

The OCID of the cluster.

Endpoint string

The endpoint to target. A cluster may have multiple endpoints exposed but the kubeconfig can only target one at a time.

Expiration int

Deprecated. This field is no longer used.

TokenVersion string

The version of the kubeconfig token. Supported value 2.0.0

clusterId String

The OCID of the cluster.

endpoint String

The endpoint to target. A cluster may have multiple endpoints exposed but the kubeconfig can only target one at a time.

expiration Integer

Deprecated. This field is no longer used.

tokenVersion String

The version of the kubeconfig token. Supported value 2.0.0

clusterId string

The OCID of the cluster.

endpoint string

The endpoint to target. A cluster may have multiple endpoints exposed but the kubeconfig can only target one at a time.

expiration number

Deprecated. This field is no longer used.

tokenVersion string

The version of the kubeconfig token. Supported value 2.0.0

cluster_id str

The OCID of the cluster.

endpoint str

The endpoint to target. A cluster may have multiple endpoints exposed but the kubeconfig can only target one at a time.

expiration int

Deprecated. This field is no longer used.

token_version str

The version of the kubeconfig token. Supported value 2.0.0

clusterId String

The OCID of the cluster.

endpoint String

The endpoint to target. A cluster may have multiple endpoints exposed but the kubeconfig can only target one at a time.

expiration Number

Deprecated. This field is no longer used.

tokenVersion String

The version of the kubeconfig token. Supported value 2.0.0

getClusterKubeConfig Result

The following output properties are available:

ClusterId string
Content string

content of the Kubeconfig YAML for the cluster.

Id string

The provider-assigned unique ID for this managed resource.

Endpoint string
Expiration int
TokenVersion string
ClusterId string
Content string

content of the Kubeconfig YAML for the cluster.

Id string

The provider-assigned unique ID for this managed resource.

Endpoint string
Expiration int
TokenVersion string
clusterId String
content String

content of the Kubeconfig YAML for the cluster.

id String

The provider-assigned unique ID for this managed resource.

endpoint String
expiration Integer
tokenVersion String
clusterId string
content string

content of the Kubeconfig YAML for the cluster.

id string

The provider-assigned unique ID for this managed resource.

endpoint string
expiration number
tokenVersion string
cluster_id str
content str

content of the Kubeconfig YAML for the cluster.

id str

The provider-assigned unique ID for this managed resource.

endpoint str
expiration int
token_version str
clusterId String
content String

content of the Kubeconfig YAML for the cluster.

id String

The provider-assigned unique ID for this managed resource.

endpoint String
expiration Number
tokenVersion String

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.