Viewing docs for Alibaba Cloud v3.97.0
published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.97.0
published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
This data source provides a list Container Service Serverless Kubernetes Clusters on Alibaba Cloud.
NOTE: Available since v1.58.0
NOTE: From version v1.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.getServerlessKubernetesClusters({
nameRegex: "my-first-k8s",
outputFile: "my-first-k8s-json",
kubeConfigFilePrefix: "~/.kube/serverless",
});
export const output = k8sClusters.then(k8sClusters => k8sClusters.clusters);
import pulumi
import pulumi_alicloud as alicloud
# Declare the data source
k8s_clusters = alicloud.cs.get_serverless_kubernetes_clusters(name_regex="my-first-k8s",
output_file="my-first-k8s-json",
kube_config_file_prefix="~/.kube/serverless")
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.GetServerlessKubernetesClusters(ctx, &cs.GetServerlessKubernetesClustersArgs{
NameRegex: pulumi.StringRef("my-first-k8s"),
OutputFile: pulumi.StringRef("my-first-k8s-json"),
KubeConfigFilePrefix: pulumi.StringRef("~/.kube/serverless"),
}, 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.GetServerlessKubernetesClusters.Invoke(new()
{
NameRegex = "my-first-k8s",
OutputFile = "my-first-k8s-json",
KubeConfigFilePrefix = "~/.kube/serverless",
});
return new Dictionary<string, object?>
{
["output"] = k8sClusters.Apply(getServerlessKubernetesClustersResult => getServerlessKubernetesClustersResult.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.GetServerlessKubernetesClustersArgs;
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.getServerlessKubernetesClusters(GetServerlessKubernetesClustersArgs.builder()
.nameRegex("my-first-k8s")
.outputFile("my-first-k8s-json")
.kubeConfigFilePrefix("~/.kube/serverless")
.build());
ctx.export("output", k8sClusters.clusters());
}
}
variables:
# Declare the data source
k8sClusters:
fn::invoke:
function: alicloud:cs:getServerlessKubernetesClusters
arguments:
nameRegex: my-first-k8s
outputFile: my-first-k8s-json
kubeConfigFilePrefix: ~/.kube/serverless
outputs:
output: ${k8sClusters.clusters}
Using getServerlessKubernetesClusters
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 getServerlessKubernetesClusters(args: GetServerlessKubernetesClustersArgs, opts?: InvokeOptions): Promise<GetServerlessKubernetesClustersResult>
function getServerlessKubernetesClustersOutput(args: GetServerlessKubernetesClustersOutputArgs, opts?: InvokeOptions): Output<GetServerlessKubernetesClustersResult>def get_serverless_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) -> GetServerlessKubernetesClustersResult
def get_serverless_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[GetServerlessKubernetesClustersResult]func GetServerlessKubernetesClusters(ctx *Context, args *GetServerlessKubernetesClustersArgs, opts ...InvokeOption) (*GetServerlessKubernetesClustersResult, error)
func GetServerlessKubernetesClustersOutput(ctx *Context, args *GetServerlessKubernetesClustersOutputArgs, opts ...InvokeOption) GetServerlessKubernetesClustersResultOutput> Note: This function is named GetServerlessKubernetesClusters in the Go SDK.
public static class GetServerlessKubernetesClusters
{
public static Task<GetServerlessKubernetesClustersResult> InvokeAsync(GetServerlessKubernetesClustersArgs args, InvokeOptions? opts = null)
public static Output<GetServerlessKubernetesClustersResult> Invoke(GetServerlessKubernetesClustersInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetServerlessKubernetesClustersResult> getServerlessKubernetesClusters(GetServerlessKubernetesClustersArgs args, InvokeOptions options)
public static Output<GetServerlessKubernetesClustersResult> getServerlessKubernetesClusters(GetServerlessKubernetesClustersArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:cs/getServerlessKubernetesClusters:getServerlessKubernetesClusters
arguments:
# arguments dictionaryThe following arguments are supported:
- Enable
Details bool - Boolean, false by default, only
idandnameare exported. Set to true if more details are needed, e.g.,deletion_protection,connections. See full list in attributes. - 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/serverless, then it will be named with~/.kube/serverless-clusterID-kubeconfig. From version 1.243.0, kube_config will not export kube_config if this field is not set. Please use the attribute output_file of new DataSourcealicloud.cs.getClusterCredentialto replace it - 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 - Boolean, false by default, only
idandnameare exported. Set to true if more details are needed, e.g.,deletion_protection,connections. See full list in attributes. - 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/serverless, then it will be named with~/.kube/serverless-clusterID-kubeconfig. From version 1.243.0, kube_config will not export kube_config if this field is not set. Please use the attribute output_file of new DataSourcealicloud.cs.getClusterCredentialto replace it - 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 - Boolean, false by default, only
idandnameare exported. Set to true if more details are needed, e.g.,deletion_protection,connections. See full list in attributes. - 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/serverless, then it will be named with~/.kube/serverless-clusterID-kubeconfig. From version 1.243.0, kube_config will not export kube_config if this field is not set. Please use the attribute output_file of new DataSourcealicloud.cs.getClusterCredentialto replace it - 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 - Boolean, false by default, only
idandnameare exported. Set to true if more details are needed, e.g.,deletion_protection,connections. See full list in attributes. - 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/serverless, then it will be named with~/.kube/serverless-clusterID-kubeconfig. From version 1.243.0, kube_config will not export kube_config if this field is not set. Please use the attribute output_file of new DataSourcealicloud.cs.getClusterCredentialto replace it - 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 - Boolean, false by default, only
idandnameare exported. Set to true if more details are needed, e.g.,deletion_protection,connections. See full list in attributes. - 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/serverless, then it will be named with~/.kube/serverless-clusterID-kubeconfig. From version 1.243.0, kube_config will not export kube_config if this field is not set. Please use the attribute output_file of new DataSourcealicloud.cs.getClusterCredentialto replace it - 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 - Boolean, false by default, only
idandnameare exported. Set to true if more details are needed, e.g.,deletion_protection,connections. See full list in attributes. - 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/serverless, then it will be named with~/.kube/serverless-clusterID-kubeconfig. From version 1.243.0, kube_config will not export kube_config if this field is not set. Please use the attribute output_file of new DataSourcealicloud.cs.getClusterCredentialto replace it - 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).
getServerlessKubernetesClusters Result
The following output properties are available:
- Clusters
List<Pulumi.
Ali Cloud. CS. Outputs. Get Serverless 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
Serverless 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
Serverless 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
Serverless 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
Serverless 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
GetServerlessKubernetesClustersCluster
- Connections
Pulumi.
Ali Cloud. CS. Inputs. Get Serverless Kubernetes Clusters Cluster Connections - Map of serverless cluster connection information. It contains several attributes to
Block Connections. - Deletion
Protection bool - Whether the cluster support delete protection.
- Endpoint
Public boolAccess Enabled - Whether to create internet eip for API Server.
- Id string
- The ID of the container cluster.
- Name string
- The name of the container cluster.
- Nat
Gateway stringId - The ID of nat gateway used to launch kubernetes cluster.
- Security
Group stringId - The ID of security group where the current cluster is located.
- Dictionary<string, string>
- A map of tags assigned to the kubernetes cluster.
- Vpc
Id string - The ID of VPC where the current cluster is located.
- Vswitch
Id string - The ID of vSwitch where the current cluster is located.
- Connections
Get
Serverless Kubernetes Clusters Cluster Connections - Map of serverless cluster connection information. It contains several attributes to
Block Connections. - Deletion
Protection bool - Whether the cluster support delete protection.
- Endpoint
Public boolAccess Enabled - Whether to create internet eip for API Server.
- Id string
- The ID of the container cluster.
- Name string
- The name of the container cluster.
- Nat
Gateway stringId - The ID of nat gateway used to launch kubernetes cluster.
- Security
Group stringId - The ID of security group where the current cluster is located.
- map[string]string
- A map of tags assigned to the kubernetes cluster.
- Vpc
Id string - The ID of VPC where the current cluster is located.
- Vswitch
Id string - The ID of vSwitch where the current cluster is located.
- connections
Get
Serverless Kubernetes Clusters Cluster Connections - Map of serverless cluster connection information. It contains several attributes to
Block Connections. - deletion
Protection Boolean - Whether the cluster support delete protection.
- endpoint
Public BooleanAccess Enabled - Whether to create internet eip for API Server.
- id String
- The ID of the container cluster.
- name String
- The name of the container cluster.
- nat
Gateway StringId - The ID of nat gateway used to launch kubernetes cluster.
- security
Group StringId - The ID of security group where the current cluster is located.
- Map<String,String>
- A map of tags assigned to the kubernetes cluster.
- vpc
Id String - The ID of VPC where the current cluster is located.
- vswitch
Id String - The ID of vSwitch where the current cluster is located.
- connections
Get
Serverless Kubernetes Clusters Cluster Connections - Map of serverless cluster connection information. It contains several attributes to
Block Connections. - deletion
Protection boolean - Whether the cluster support delete protection.
- endpoint
Public booleanAccess Enabled - Whether to create internet eip for API Server.
- id string
- The ID of the container cluster.
- name string
- The name of the container cluster.
- nat
Gateway stringId - The ID of nat gateway used to launch kubernetes cluster.
- security
Group stringId - The ID of security group where the current cluster is located.
- {[key: string]: string}
- A map of tags assigned to the kubernetes cluster.
- vpc
Id string - The ID of VPC where the current cluster is located.
- vswitch
Id string - The ID of vSwitch where the current cluster is located.
- connections
Get
Serverless Kubernetes Clusters Cluster Connections - Map of serverless cluster connection information. It contains several attributes to
Block Connections. - deletion_
protection bool - Whether the cluster support delete protection.
- endpoint_
public_ boolaccess_ enabled - Whether to create internet eip for API Server.
- id str
- The ID of the container cluster.
- name str
- The name of the container cluster.
- nat_
gateway_ strid - The ID of nat gateway used to launch kubernetes cluster.
- security_
group_ strid - The ID of security group where the current cluster is located.
- Mapping[str, str]
- A map of tags assigned to the kubernetes cluster.
- vpc_
id str - The ID of VPC where the current cluster is located.
- vswitch_
id str - The ID of vSwitch where the current cluster is located.
- connections Property Map
- Map of serverless cluster connection information. It contains several attributes to
Block Connections. - deletion
Protection Boolean - Whether the cluster support delete protection.
- endpoint
Public BooleanAccess Enabled - Whether to create internet eip for API Server.
- id String
- The ID of the container cluster.
- name String
- The name of the container cluster.
- nat
Gateway StringId - The ID of nat gateway used to launch kubernetes cluster.
- security
Group StringId - The ID of security group where the current cluster is located.
- Map<String>
- A map of tags assigned to the kubernetes cluster.
- vpc
Id String - The ID of VPC where the current cluster is located.
- vswitch
Id String - The ID of vSwitch where the current cluster is located.
GetServerlessKubernetesClustersClusterConnections
- Api
Server stringInternet - API Server Internet endpoint.
- Api
Server stringIntranet - API Server Intranet endpoint.
- Master
Public stringIp - Master node SSH IP address.
- Api
Server stringInternet - API Server Internet endpoint.
- Api
Server stringIntranet - API Server Intranet endpoint.
- Master
Public stringIp - Master node SSH IP address.
- api
Server StringInternet - API Server Internet endpoint.
- api
Server StringIntranet - API Server Intranet endpoint.
- master
Public StringIp - Master node SSH IP address.
- api
Server stringInternet - API Server Internet endpoint.
- api
Server stringIntranet - API Server Intranet endpoint.
- master
Public stringIp - Master node SSH IP address.
- api_
server_ strinternet - API Server Internet endpoint.
- api_
server_ strintranet - API Server Intranet endpoint.
- master_
public_ strip - Master node SSH IP address.
- api
Server StringInternet - API Server Internet endpoint.
- api
Server StringIntranet - API Server Intranet endpoint.
- master
Public StringIp - Master node SSH IP address.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.97.0
published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
