ionoscloud.getK8sCluster
Explore with Pulumi AI
The k8s Cluster data source can be used to search for and return existing k8s clusters. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getK8sCluster({
id: "cluster_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_k8s_cluster(id="cluster_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupK8sCluster(ctx, &ionoscloud.LookupK8sClusterArgs{
Id: pulumi.StringRef("cluster_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetK8sCluster.Invoke(new()
{
Id = "cluster_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetK8sClusterArgs;
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 example = IonoscloudFunctions.getK8sCluster(GetK8sClusterArgs.builder()
.id("cluster_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getK8sCluster
arguments:
id: cluster_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getK8sCluster({
name: "K8s Cluster Example",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_k8s_cluster(name="K8s Cluster Example")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupK8sCluster(ctx, &ionoscloud.LookupK8sClusterArgs{
Name: pulumi.StringRef("K8s Cluster Example"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetK8sCluster.Invoke(new()
{
Name = "K8s Cluster Example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetK8sClusterArgs;
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 example = IonoscloudFunctions.getK8sCluster(GetK8sClusterArgs.builder()
.name("K8s Cluster Example")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getK8sCluster
arguments:
name: K8s Cluster Example
Using getK8sCluster
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 getK8sCluster(args: GetK8sClusterArgs, opts?: InvokeOptions): Promise<GetK8sClusterResult>
function getK8sClusterOutput(args: GetK8sClusterOutputArgs, opts?: InvokeOptions): Output<GetK8sClusterResult>
def get_k8s_cluster(id: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[GetK8sClusterTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetK8sClusterResult
def get_k8s_cluster_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetK8sClusterTimeoutsArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetK8sClusterResult]
func LookupK8sCluster(ctx *Context, args *LookupK8sClusterArgs, opts ...InvokeOption) (*LookupK8sClusterResult, error)
func LookupK8sClusterOutput(ctx *Context, args *LookupK8sClusterOutputArgs, opts ...InvokeOption) LookupK8sClusterResultOutput
> Note: This function is named LookupK8sCluster
in the Go SDK.
public static class GetK8sCluster
{
public static Task<GetK8sClusterResult> InvokeAsync(GetK8sClusterArgs args, InvokeOptions? opts = null)
public static Output<GetK8sClusterResult> Invoke(GetK8sClusterInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetK8sClusterResult> getK8sCluster(GetK8sClusterArgs args, InvokeOptions options)
public static Output<GetK8sClusterResult> getK8sCluster(GetK8sClusterArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getK8sCluster:getK8sCluster
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
ID of the cluster you want to search for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- Name string
- Name of an existing cluster that you want to search for.
- Timeouts
Get
K8s Cluster Timeouts
- Id string
ID of the cluster you want to search for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- Name string
- Name of an existing cluster that you want to search for.
- Timeouts
Get
K8s Cluster Timeouts
- id String
ID of the cluster you want to search for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- name String
- Name of an existing cluster that you want to search for.
- timeouts
Get
K8s Cluster Timeouts
- id string
ID of the cluster you want to search for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- name string
- Name of an existing cluster that you want to search for.
- timeouts
Get
K8s Cluster Timeouts
- id str
ID of the cluster you want to search for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- name str
- Name of an existing cluster that you want to search for.
- timeouts
Get
K8s Cluster Timeouts
- id String
ID of the cluster you want to search for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error.- name String
- Name of an existing cluster that you want to search for.
- timeouts Property Map
getK8sCluster Result
The following output properties are available:
- Api
Subnet List<string>Allow Lists - access to the K8s API server is restricted to these CIDRs
- Available
Upgrade List<string>Versions - A list of available versions for upgrading the cluster
- Ca
Crt string - base64 decoded cluster certificate authority data (provided as an attribute for direct use)
- Configs
List<Get
K8s Cluster Config> - structured kubernetes config consisting of a list with 1 item with the following fields:
- api_version - Kubernetes API Version
- kind - "Config"
- current-context - string
- clusters - list of
- name - name of cluster
- cluster - map of
- certificate-authority-data - base64 decoded cluster CA data
- server - server address in the form
https://host:port
- contexts - list of
- name - context name
- context - map of
- cluster - cluster name
- user - cluster user
- users - list of
- name - user name
- user - map of
- token - user token used for authentication
- Id string
- id of the cluster
- K8s
Version string - Kubernetes version
- Kube
Config string - Kubernetes configuration
- Location string
- this attribute is mandatory if the cluster is private.
- Maintenance
Windows List<GetK8s Cluster Maintenance Window> - A maintenance window comprise of a day of the week and a time for maintenance to be allowed
- Name string
- name of the cluster
- Nat
Gateway stringIp - the NAT gateway IP of the cluster if the cluster is private.
- Node
Pools List<string> - list of the IDs of the node pools in this cluster
- Node
Subnet string - the node subnet of the cluster, if the cluster is private.
- Public bool
- indicates if the cluster is public or private.
- S3Buckets
List<Get
K8s Cluster S3Bucket> - list of IONOS Object Storage bucket configured for K8s usage
- Server string
- cluster server (same as
config[0].clusters[0].cluster.server
but provided as an attribute for ease of use) - State string
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
- User
Tokens Dictionary<string, string> - a convenience map to be search the token of a specific user
- key - is the user name
- value - is the token
- Viable
Node List<string>Pool Versions - A list of versions that may be used for node pools under this cluster
- Timeouts
Get
K8s Cluster Timeouts
- Api
Subnet []stringAllow Lists - access to the K8s API server is restricted to these CIDRs
- Available
Upgrade []stringVersions - A list of available versions for upgrading the cluster
- Ca
Crt string - base64 decoded cluster certificate authority data (provided as an attribute for direct use)
- Configs
[]Get
K8s Cluster Config - structured kubernetes config consisting of a list with 1 item with the following fields:
- api_version - Kubernetes API Version
- kind - "Config"
- current-context - string
- clusters - list of
- name - name of cluster
- cluster - map of
- certificate-authority-data - base64 decoded cluster CA data
- server - server address in the form
https://host:port
- contexts - list of
- name - context name
- context - map of
- cluster - cluster name
- user - cluster user
- users - list of
- name - user name
- user - map of
- token - user token used for authentication
- Id string
- id of the cluster
- K8s
Version string - Kubernetes version
- Kube
Config string - Kubernetes configuration
- Location string
- this attribute is mandatory if the cluster is private.
- Maintenance
Windows []GetK8s Cluster Maintenance Window - A maintenance window comprise of a day of the week and a time for maintenance to be allowed
- Name string
- name of the cluster
- Nat
Gateway stringIp - the NAT gateway IP of the cluster if the cluster is private.
- Node
Pools []string - list of the IDs of the node pools in this cluster
- Node
Subnet string - the node subnet of the cluster, if the cluster is private.
- Public bool
- indicates if the cluster is public or private.
- S3Buckets
[]Get
K8s Cluster S3Bucket - list of IONOS Object Storage bucket configured for K8s usage
- Server string
- cluster server (same as
config[0].clusters[0].cluster.server
but provided as an attribute for ease of use) - State string
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
- User
Tokens map[string]string - a convenience map to be search the token of a specific user
- key - is the user name
- value - is the token
- Viable
Node []stringPool Versions - A list of versions that may be used for node pools under this cluster
- Timeouts
Get
K8s Cluster Timeouts
- api
Subnet List<String>Allow Lists - access to the K8s API server is restricted to these CIDRs
- available
Upgrade List<String>Versions - A list of available versions for upgrading the cluster
- ca
Crt String - base64 decoded cluster certificate authority data (provided as an attribute for direct use)
- configs
List<Get
K8s Cluster Config> - structured kubernetes config consisting of a list with 1 item with the following fields:
- api_version - Kubernetes API Version
- kind - "Config"
- current-context - string
- clusters - list of
- name - name of cluster
- cluster - map of
- certificate-authority-data - base64 decoded cluster CA data
- server - server address in the form
https://host:port
- contexts - list of
- name - context name
- context - map of
- cluster - cluster name
- user - cluster user
- users - list of
- name - user name
- user - map of
- token - user token used for authentication
- id String
- id of the cluster
- k8s
Version String - Kubernetes version
- kube
Config String - Kubernetes configuration
- location String
- this attribute is mandatory if the cluster is private.
- maintenance
Windows List<GetK8s Cluster Maintenance Window> - A maintenance window comprise of a day of the week and a time for maintenance to be allowed
- name String
- name of the cluster
- nat
Gateway StringIp - the NAT gateway IP of the cluster if the cluster is private.
- node
Pools List<String> - list of the IDs of the node pools in this cluster
- node
Subnet String - the node subnet of the cluster, if the cluster is private.
- public_ Boolean
- indicates if the cluster is public or private.
- s3Buckets
List<Get
K8s Cluster S3Bucket> - list of IONOS Object Storage bucket configured for K8s usage
- server String
- cluster server (same as
config[0].clusters[0].cluster.server
but provided as an attribute for ease of use) - state String
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
- user
Tokens Map<String,String> - a convenience map to be search the token of a specific user
- key - is the user name
- value - is the token
- viable
Node List<String>Pool Versions - A list of versions that may be used for node pools under this cluster
- timeouts
Get
K8s Cluster Timeouts
- api
Subnet string[]Allow Lists - access to the K8s API server is restricted to these CIDRs
- available
Upgrade string[]Versions - A list of available versions for upgrading the cluster
- ca
Crt string - base64 decoded cluster certificate authority data (provided as an attribute for direct use)
- configs
Get
K8s Cluster Config[] - structured kubernetes config consisting of a list with 1 item with the following fields:
- api_version - Kubernetes API Version
- kind - "Config"
- current-context - string
- clusters - list of
- name - name of cluster
- cluster - map of
- certificate-authority-data - base64 decoded cluster CA data
- server - server address in the form
https://host:port
- contexts - list of
- name - context name
- context - map of
- cluster - cluster name
- user - cluster user
- users - list of
- name - user name
- user - map of
- token - user token used for authentication
- id string
- id of the cluster
- k8s
Version string - Kubernetes version
- kube
Config string - Kubernetes configuration
- location string
- this attribute is mandatory if the cluster is private.
- maintenance
Windows GetK8s Cluster Maintenance Window[] - A maintenance window comprise of a day of the week and a time for maintenance to be allowed
- name string
- name of the cluster
- nat
Gateway stringIp - the NAT gateway IP of the cluster if the cluster is private.
- node
Pools string[] - list of the IDs of the node pools in this cluster
- node
Subnet string - the node subnet of the cluster, if the cluster is private.
- public boolean
- indicates if the cluster is public or private.
- s3Buckets
Get
K8s Cluster S3Bucket[] - list of IONOS Object Storage bucket configured for K8s usage
- server string
- cluster server (same as
config[0].clusters[0].cluster.server
but provided as an attribute for ease of use) - state string
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
- user
Tokens {[key: string]: string} - a convenience map to be search the token of a specific user
- key - is the user name
- value - is the token
- viable
Node string[]Pool Versions - A list of versions that may be used for node pools under this cluster
- timeouts
Get
K8s Cluster Timeouts
- api_
subnet_ Sequence[str]allow_ lists - access to the K8s API server is restricted to these CIDRs
- available_
upgrade_ Sequence[str]versions - A list of available versions for upgrading the cluster
- ca_
crt str - base64 decoded cluster certificate authority data (provided as an attribute for direct use)
- configs
Sequence[Get
K8s Cluster Config] - structured kubernetes config consisting of a list with 1 item with the following fields:
- api_version - Kubernetes API Version
- kind - "Config"
- current-context - string
- clusters - list of
- name - name of cluster
- cluster - map of
- certificate-authority-data - base64 decoded cluster CA data
- server - server address in the form
https://host:port
- contexts - list of
- name - context name
- context - map of
- cluster - cluster name
- user - cluster user
- users - list of
- name - user name
- user - map of
- token - user token used for authentication
- id str
- id of the cluster
- k8s_
version str - Kubernetes version
- kube_
config str - Kubernetes configuration
- location str
- this attribute is mandatory if the cluster is private.
- maintenance_
windows Sequence[GetK8s Cluster Maintenance Window] - A maintenance window comprise of a day of the week and a time for maintenance to be allowed
- name str
- name of the cluster
- nat_
gateway_ strip - the NAT gateway IP of the cluster if the cluster is private.
- node_
pools Sequence[str] - list of the IDs of the node pools in this cluster
- node_
subnet str - the node subnet of the cluster, if the cluster is private.
- public bool
- indicates if the cluster is public or private.
- s3_
buckets Sequence[GetK8s Cluster S3Bucket] - list of IONOS Object Storage bucket configured for K8s usage
- server str
- cluster server (same as
config[0].clusters[0].cluster.server
but provided as an attribute for ease of use) - state str
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
- user_
tokens Mapping[str, str] - a convenience map to be search the token of a specific user
- key - is the user name
- value - is the token
- viable_
node_ Sequence[str]pool_ versions - A list of versions that may be used for node pools under this cluster
- timeouts
Get
K8s Cluster Timeouts
- api
Subnet List<String>Allow Lists - access to the K8s API server is restricted to these CIDRs
- available
Upgrade List<String>Versions - A list of available versions for upgrading the cluster
- ca
Crt String - base64 decoded cluster certificate authority data (provided as an attribute for direct use)
- configs List<Property Map>
- structured kubernetes config consisting of a list with 1 item with the following fields:
- api_version - Kubernetes API Version
- kind - "Config"
- current-context - string
- clusters - list of
- name - name of cluster
- cluster - map of
- certificate-authority-data - base64 decoded cluster CA data
- server - server address in the form
https://host:port
- contexts - list of
- name - context name
- context - map of
- cluster - cluster name
- user - cluster user
- users - list of
- name - user name
- user - map of
- token - user token used for authentication
- id String
- id of the cluster
- k8s
Version String - Kubernetes version
- kube
Config String - Kubernetes configuration
- location String
- this attribute is mandatory if the cluster is private.
- maintenance
Windows List<Property Map> - A maintenance window comprise of a day of the week and a time for maintenance to be allowed
- name String
- name of the cluster
- nat
Gateway StringIp - the NAT gateway IP of the cluster if the cluster is private.
- node
Pools List<String> - list of the IDs of the node pools in this cluster
- node
Subnet String - the node subnet of the cluster, if the cluster is private.
- public Boolean
- indicates if the cluster is public or private.
- s3Buckets List<Property Map>
- list of IONOS Object Storage bucket configured for K8s usage
- server String
- cluster server (same as
config[0].clusters[0].cluster.server
but provided as an attribute for ease of use) - state String
- one of "AVAILABLE", "INACTIVE", "BUSY", "DEPLOYING", "ACTIVE", "FAILED", "SUSPENDED", "FAILED_SUSPENDED", "UPDATING", "FAILED_UPDATING", "DESTROYING", "FAILED_DESTROYING", "TERMINATED"
- user
Tokens Map<String> - a convenience map to be search the token of a specific user
- key - is the user name
- value - is the token
- viable
Node List<String>Pool Versions - A list of versions that may be used for node pools under this cluster
- timeouts Property Map
Supporting Types
GetK8sClusterConfig
GetK8sClusterConfigCluster
GetK8sClusterConfigContext
GetK8sClusterConfigUser
GetK8sClusterMaintenanceWindow
- Day
Of stringThe Week - Day of the week when maintenance is allowed
- Time string
- A clock time in the day when maintenance is allowed
- Day
Of stringThe Week - Day of the week when maintenance is allowed
- Time string
- A clock time in the day when maintenance is allowed
- day
Of StringThe Week - Day of the week when maintenance is allowed
- time String
- A clock time in the day when maintenance is allowed
- day
Of stringThe Week - Day of the week when maintenance is allowed
- time string
- A clock time in the day when maintenance is allowed
- day_
of_ strthe_ week - Day of the week when maintenance is allowed
- time str
- A clock time in the day when maintenance is allowed
- day
Of StringThe Week - Day of the week when maintenance is allowed
- time String
- A clock time in the day when maintenance is allowed
GetK8sClusterS3Bucket
- Name string
- Name of an existing cluster that you want to search for.
- Name string
- Name of an existing cluster that you want to search for.
- name String
- Name of an existing cluster that you want to search for.
- name string
- Name of an existing cluster that you want to search for.
- name str
- Name of an existing cluster that you want to search for.
- name String
- Name of an existing cluster that you want to search for.
GetK8sClusterTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.