Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi
alicloud.cs.getManagedKubernetesClusters
Explore with Pulumi AI
This data source provides a list Container Service Managed Kubernetes Clusters on Alibaba Cloud.
NOTE: Available in v1.35.0+
NOTE: From version 1.177.0+, We supported batch export of clusters’ kube config information by
kube_config_file_prefix
.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Declare the data source
const k8sClusters = alicloud.cs.getManagedKubernetesClusters({
nameRegex: "my-first-k8s",
outputFile: "my-first-k8s-json",
kubeConfigFilePrefix: "~/.kube/managed",
});
export const output = k8sClusters.then(k8sClusters => k8sClusters.clusters);
import pulumi
import pulumi_alicloud as alicloud
# Declare the data source
k8s_clusters = alicloud.cs.get_managed_kubernetes_clusters(name_regex="my-first-k8s",
output_file="my-first-k8s-json",
kube_config_file_prefix="~/.kube/managed")
pulumi.export("output", k8s_clusters.clusters)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Declare the data source
k8sClusters, err := cs.GetManagedKubernetesClusters(ctx, &cs.GetManagedKubernetesClustersArgs{
NameRegex: pulumi.StringRef("my-first-k8s"),
OutputFile: pulumi.StringRef("my-first-k8s-json"),
KubeConfigFilePrefix: pulumi.StringRef("~/.kube/managed"),
}, nil)
if err != nil {
return err
}
ctx.Export("output", k8sClusters.Clusters)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
// Declare the data source
var k8sClusters = AliCloud.CS.GetManagedKubernetesClusters.Invoke(new()
{
NameRegex = "my-first-k8s",
OutputFile = "my-first-k8s-json",
KubeConfigFilePrefix = "~/.kube/managed",
});
return new Dictionary<string, object?>
{
["output"] = k8sClusters.Apply(getManagedKubernetesClustersResult => getManagedKubernetesClustersResult.Clusters),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cs.CsFunctions;
import com.pulumi.alicloud.cs.inputs.GetManagedKubernetesClustersArgs;
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) {
// Declare the data source
final var k8sClusters = CsFunctions.getManagedKubernetesClusters(GetManagedKubernetesClustersArgs.builder()
.nameRegex("my-first-k8s")
.outputFile("my-first-k8s-json")
.kubeConfigFilePrefix("~/.kube/managed")
.build());
ctx.export("output", k8sClusters.applyValue(getManagedKubernetesClustersResult -> getManagedKubernetesClustersResult.clusters()));
}
}
variables:
# Declare the data source
k8sClusters:
fn::invoke:
Function: alicloud:cs:getManagedKubernetesClusters
Arguments:
nameRegex: my-first-k8s
outputFile: my-first-k8s-json
kubeConfigFilePrefix: ~/.kube/managed
outputs:
output: ${k8sClusters.clusters}
Using getManagedKubernetesClusters
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 getManagedKubernetesClusters(args: GetManagedKubernetesClustersArgs, opts?: InvokeOptions): Promise<GetManagedKubernetesClustersResult>
function getManagedKubernetesClustersOutput(args: GetManagedKubernetesClustersOutputArgs, opts?: InvokeOptions): Output<GetManagedKubernetesClustersResult>
def get_managed_kubernetes_clusters(enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
kube_config_file_prefix: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetManagedKubernetesClustersResult
def get_managed_kubernetes_clusters_output(enable_details: Optional[pulumi.Input[bool]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
kube_config_file_prefix: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetManagedKubernetesClustersResult]
func GetManagedKubernetesClusters(ctx *Context, args *GetManagedKubernetesClustersArgs, opts ...InvokeOption) (*GetManagedKubernetesClustersResult, error)
func GetManagedKubernetesClustersOutput(ctx *Context, args *GetManagedKubernetesClustersOutputArgs, opts ...InvokeOption) GetManagedKubernetesClustersResultOutput
> Note: This function is named GetManagedKubernetesClusters
in the Go SDK.
public static class GetManagedKubernetesClusters
{
public static Task<GetManagedKubernetesClustersResult> InvokeAsync(GetManagedKubernetesClustersArgs args, InvokeOptions? opts = null)
public static Output<GetManagedKubernetesClustersResult> Invoke(GetManagedKubernetesClustersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetManagedKubernetesClustersResult> getManagedKubernetesClusters(GetManagedKubernetesClustersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cs/getManagedKubernetesClusters:getManagedKubernetesClusters
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Ids List<string>
- Cluster IDs to filter.
- Kube
Config stringFile Prefix - The path prefix of kube config. You could store kube config in a specified directory by specifying this field, like
~/.kube/managed
, then it will be named with~/.kube/managed-clusterID-kubeconfig
. From version 1.187.0+, kube_config will not export kube_config if this field is not set. - Name
Regex string - A regex string to filter results by cluster name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Enable
Details bool - Ids []string
- Cluster IDs to filter.
- Kube
Config stringFile Prefix - The path prefix of kube config. You could store kube config in a specified directory by specifying this field, like
~/.kube/managed
, then it will be named with~/.kube/managed-clusterID-kubeconfig
. From version 1.187.0+, kube_config will not export kube_config if this field is not set. - Name
Regex string - A regex string to filter results by cluster name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- enable
Details Boolean - ids List<String>
- Cluster IDs to filter.
- kube
Config StringFile Prefix - The path prefix of kube config. You could store kube config in a specified directory by specifying this field, like
~/.kube/managed
, then it will be named with~/.kube/managed-clusterID-kubeconfig
. From version 1.187.0+, kube_config will not export kube_config if this field is not set. - name
Regex String - A regex string to filter results by cluster name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- enable
Details boolean - ids string[]
- Cluster IDs to filter.
- kube
Config stringFile Prefix - The path prefix of kube config. You could store kube config in a specified directory by specifying this field, like
~/.kube/managed
, then it will be named with~/.kube/managed-clusterID-kubeconfig
. From version 1.187.0+, kube_config will not export kube_config if this field is not set. - name
Regex string - A regex string to filter results by cluster name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- enable_
details bool - ids Sequence[str]
- Cluster IDs to filter.
- kube_
config_ strfile_ prefix - The path prefix of kube config. You could store kube config in a specified directory by specifying this field, like
~/.kube/managed
, then it will be named with~/.kube/managed-clusterID-kubeconfig
. From version 1.187.0+, kube_config will not export kube_config if this field is not set. - name_
regex str - A regex string to filter results by cluster name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- enable
Details Boolean - ids List<String>
- Cluster IDs to filter.
- kube
Config StringFile Prefix - The path prefix of kube config. You could store kube config in a specified directory by specifying this field, like
~/.kube/managed
, then it will be named with~/.kube/managed-clusterID-kubeconfig
. From version 1.187.0+, kube_config will not export kube_config if this field is not set. - name
Regex String - A regex string to filter results by cluster name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getManagedKubernetesClusters Result
The following output properties are available:
- Clusters
List<Pulumi.
Ali Cloud. CS. Outputs. Get Managed Kubernetes Clusters Cluster> - A list of matched Kubernetes clusters. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of matched Kubernetes clusters' ids.
- Names List<string>
- A list of matched Kubernetes clusters' names.
- Enable
Details bool - Kube
Config stringFile Prefix - Name
Regex string - Output
File string
- Clusters
[]Get
Managed Kubernetes Clusters Cluster - A list of matched Kubernetes clusters. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of matched Kubernetes clusters' ids.
- Names []string
- A list of matched Kubernetes clusters' names.
- Enable
Details bool - Kube
Config stringFile Prefix - Name
Regex string - Output
File string
- clusters
List<Get
Managed Kubernetes Clusters Cluster> - A list of matched Kubernetes clusters. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of matched Kubernetes clusters' ids.
- names List<String>
- A list of matched Kubernetes clusters' names.
- enable
Details Boolean - kube
Config StringFile Prefix - name
Regex String - output
File String
- clusters
Get
Managed Kubernetes Clusters Cluster[] - A list of matched Kubernetes clusters. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of matched Kubernetes clusters' ids.
- names string[]
- A list of matched Kubernetes clusters' names.
- enable
Details boolean - kube
Config stringFile Prefix - name
Regex string - output
File string
- clusters
Sequence[Get
Managed Kubernetes Clusters Cluster] - A list of matched Kubernetes clusters. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of matched Kubernetes clusters' ids.
- names Sequence[str]
- A list of matched Kubernetes clusters' names.
- enable_
details bool - kube_
config_ strfile_ prefix - name_
regex str - output_
file str
- clusters List<Property Map>
- A list of matched Kubernetes clusters. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of matched Kubernetes clusters' ids.
- names List<String>
- A list of matched Kubernetes clusters' names.
- enable
Details Boolean - kube
Config StringFile Prefix - name
Regex String - output
File String
Supporting Types
GetManagedKubernetesClustersCluster
- Availability
Zone string - The ID of availability zone.
- Cluster
Network stringType - Connections
Pulumi.
Ali Cloud. CS. Inputs. Get Managed Kubernetes Clusters Cluster Connections - Map of kubernetes cluster connection information. It contains several attributes to
Block Connections
. - Id string
- ID of the node.
- Image
Id string - Key
Name string - The keypair of ssh login cluster node, you have to create it first.
- Log
Configs List<Pulumi.Ali Cloud. CS. Inputs. Get Managed Kubernetes Clusters Cluster Log Config> - A list of one element containing information about the associated log store. It contains the following attributes:
- Name string
- Node name.
- Nat
Gateway stringId - The ID of nat gateway used to launch kubernetes cluster.
- Pod
Cidr string - Security
Group stringId - The ID of security group where the current cluster worker node is located.
- Service
Cidr string - Slb
Internet boolEnabled - Vpc
Id string - The ID of VPC where the current cluster is located.
- Vswitch
Ids List<string> - The ID of VSwitches where the current cluster is located.
- Worker
Auto boolRenew - Worker
Auto intRenew Period - Worker
Data stringDisk Category - Worker
Data intDisk Size - Worker
Disk stringCategory - Worker
Disk intSize - Worker
Instance stringCharge Type - Worker
Instance List<string>Types - Worker
Nodes List<Pulumi.Ali Cloud. CS. Inputs. Get Managed Kubernetes Clusters Cluster Worker Node> - List of cluster worker nodes. It contains several attributes to
Block Nodes
. - Worker
Numbers List<int> - The ECS instance node number in the current container cluster.
- Worker
Period int - Worker
Period stringUnit
- Availability
Zone string - The ID of availability zone.
- Cluster
Network stringType - Connections
Get
Managed Kubernetes Clusters Cluster Connections - Map of kubernetes cluster connection information. It contains several attributes to
Block Connections
. - Id string
- ID of the node.
- Image
Id string - Key
Name string - The keypair of ssh login cluster node, you have to create it first.
- Log
Configs []GetManaged Kubernetes Clusters Cluster Log Config - A list of one element containing information about the associated log store. It contains the following attributes:
- Name string
- Node name.
- Nat
Gateway stringId - The ID of nat gateway used to launch kubernetes cluster.
- Pod
Cidr string - Security
Group stringId - The ID of security group where the current cluster worker node is located.
- Service
Cidr string - Slb
Internet boolEnabled - Vpc
Id string - The ID of VPC where the current cluster is located.
- Vswitch
Ids []string - The ID of VSwitches where the current cluster is located.
- Worker
Auto boolRenew - Worker
Auto intRenew Period - Worker
Data stringDisk Category - Worker
Data intDisk Size - Worker
Disk stringCategory - Worker
Disk intSize - Worker
Instance stringCharge Type - Worker
Instance []stringTypes - Worker
Nodes []GetManaged Kubernetes Clusters Cluster Worker Node - List of cluster worker nodes. It contains several attributes to
Block Nodes
. - Worker
Numbers []int - The ECS instance node number in the current container cluster.
- Worker
Period int - Worker
Period stringUnit
- availability
Zone String - The ID of availability zone.
- cluster
Network StringType - connections
Get
Managed Kubernetes Clusters Cluster Connections - Map of kubernetes cluster connection information. It contains several attributes to
Block Connections
. - id String
- ID of the node.
- image
Id String - key
Name String - The keypair of ssh login cluster node, you have to create it first.
- log
Configs List<GetManaged Kubernetes Clusters Cluster Log Config> - A list of one element containing information about the associated log store. It contains the following attributes:
- name String
- Node name.
- nat
Gateway StringId - The ID of nat gateway used to launch kubernetes cluster.
- pod
Cidr String - security
Group StringId - The ID of security group where the current cluster worker node is located.
- service
Cidr String - slb
Internet BooleanEnabled - vpc
Id String - The ID of VPC where the current cluster is located.
- vswitch
Ids List<String> - The ID of VSwitches where the current cluster is located.
- worker
Auto BooleanRenew - worker
Auto IntegerRenew Period - worker
Data StringDisk Category - worker
Data IntegerDisk Size - worker
Disk StringCategory - worker
Disk IntegerSize - worker
Instance StringCharge Type - worker
Instance List<String>Types - worker
Nodes List<GetManaged Kubernetes Clusters Cluster Worker Node> - List of cluster worker nodes. It contains several attributes to
Block Nodes
. - worker
Numbers List<Integer> - The ECS instance node number in the current container cluster.
- worker
Period Integer - worker
Period StringUnit
- availability
Zone string - The ID of availability zone.
- cluster
Network stringType - connections
Get
Managed Kubernetes Clusters Cluster Connections - Map of kubernetes cluster connection information. It contains several attributes to
Block Connections
. - id string
- ID of the node.
- image
Id string - key
Name string - The keypair of ssh login cluster node, you have to create it first.
- log
Configs GetManaged Kubernetes Clusters Cluster Log Config[] - A list of one element containing information about the associated log store. It contains the following attributes:
- name string
- Node name.
- nat
Gateway stringId - The ID of nat gateway used to launch kubernetes cluster.
- pod
Cidr string - security
Group stringId - The ID of security group where the current cluster worker node is located.
- service
Cidr string - slb
Internet booleanEnabled - vpc
Id string - The ID of VPC where the current cluster is located.
- vswitch
Ids string[] - The ID of VSwitches where the current cluster is located.
- worker
Auto booleanRenew - worker
Auto numberRenew Period - worker
Data stringDisk Category - worker
Data numberDisk Size - worker
Disk stringCategory - worker
Disk numberSize - worker
Instance stringCharge Type - worker
Instance string[]Types - worker
Nodes GetManaged Kubernetes Clusters Cluster Worker Node[] - List of cluster worker nodes. It contains several attributes to
Block Nodes
. - worker
Numbers number[] - The ECS instance node number in the current container cluster.
- worker
Period number - worker
Period stringUnit
- availability_
zone str - The ID of availability zone.
- cluster_
network_ strtype - connections
Get
Managed Kubernetes Clusters Cluster Connections - Map of kubernetes cluster connection information. It contains several attributes to
Block Connections
. - id str
- ID of the node.
- image_
id str - key_
name str - The keypair of ssh login cluster node, you have to create it first.
- log_
configs Sequence[GetManaged Kubernetes Clusters Cluster Log Config] - A list of one element containing information about the associated log store. It contains the following attributes:
- name str
- Node name.
- nat_
gateway_ strid - The ID of nat gateway used to launch kubernetes cluster.
- pod_
cidr str - security_
group_ strid - The ID of security group where the current cluster worker node is located.
- service_
cidr str - slb_
internet_ boolenabled - vpc_
id str - The ID of VPC where the current cluster is located.
- vswitch_
ids Sequence[str] - The ID of VSwitches where the current cluster is located.
- worker_
auto_ boolrenew - worker_
auto_ intrenew_ period - worker_
data_ strdisk_ category - worker_
data_ intdisk_ size - worker_
disk_ strcategory - worker_
disk_ intsize - worker_
instance_ strcharge_ type - worker_
instance_ Sequence[str]types - worker_
nodes Sequence[GetManaged Kubernetes Clusters Cluster Worker Node] - List of cluster worker nodes. It contains several attributes to
Block Nodes
. - worker_
numbers Sequence[int] - The ECS instance node number in the current container cluster.
- worker_
period int - worker_
period_ strunit
- availability
Zone String - The ID of availability zone.
- cluster
Network StringType - connections Property Map
- Map of kubernetes cluster connection information. It contains several attributes to
Block Connections
. - id String
- ID of the node.
- image
Id String - key
Name String - The keypair of ssh login cluster node, you have to create it first.
- log
Configs List<Property Map> - A list of one element containing information about the associated log store. It contains the following attributes:
- name String
- Node name.
- nat
Gateway StringId - The ID of nat gateway used to launch kubernetes cluster.
- pod
Cidr String - security
Group StringId - The ID of security group where the current cluster worker node is located.
- service
Cidr String - slb
Internet BooleanEnabled - vpc
Id String - The ID of VPC where the current cluster is located.
- vswitch
Ids List<String> - The ID of VSwitches where the current cluster is located.
- worker
Auto BooleanRenew - worker
Auto NumberRenew Period - worker
Data StringDisk Category - worker
Data NumberDisk Size - worker
Disk StringCategory - worker
Disk NumberSize - worker
Instance StringCharge Type - worker
Instance List<String>Types - worker
Nodes List<Property Map> - List of cluster worker nodes. It contains several attributes to
Block Nodes
. - worker
Numbers List<Number> - The ECS instance node number in the current container cluster.
- worker
Period Number - worker
Period StringUnit
GetManagedKubernetesClustersClusterConnections
- Api
Server stringInternet - API Server Internet endpoint.
- Api
Server stringIntranet - API Server Intranet endpoint.
- Master
Public stringIp - Master node SSH IP address.
- Service
Domain string - Service Access Domain.
- Api
Server stringInternet - API Server Internet endpoint.
- Api
Server stringIntranet - API Server Intranet endpoint.
- Master
Public stringIp - Master node SSH IP address.
- Service
Domain string - Service Access Domain.
- api
Server StringInternet - API Server Internet endpoint.
- api
Server StringIntranet - API Server Intranet endpoint.
- master
Public StringIp - Master node SSH IP address.
- service
Domain String - Service Access Domain.
- api
Server stringInternet - API Server Internet endpoint.
- api
Server stringIntranet - API Server Intranet endpoint.
- master
Public stringIp - Master node SSH IP address.
- service
Domain string - Service Access Domain.
- api_
server_ strinternet - API Server Internet endpoint.
- api_
server_ strintranet - API Server Intranet endpoint.
- master_
public_ strip - Master node SSH IP address.
- service_
domain str - Service Access Domain.
- api
Server StringInternet - API Server Internet endpoint.
- api
Server StringIntranet - API Server Intranet endpoint.
- master
Public StringIp - Master node SSH IP address.
- service
Domain String - Service Access Domain.
GetManagedKubernetesClustersClusterLogConfig
GetManagedKubernetesClustersClusterWorkerNode
- id str
- ID of the node.
- name str
- Node name.
- private_
ip str - The private IP address of node.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.