Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cs.getServerlessKubernetesClusters
Explore with Pulumi AI
This data source provides a list Container Service Serverless Kubernetes Clusters on Alibaba Cloud.
NOTE: Available in 1.58.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.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.applyValue(getServerlessKubernetesClustersResult -> getServerlessKubernetesClustersResult.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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cs/getServerlessKubernetesClusters:getServerlessKubernetesClusters
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Boolean, false by default, only
id
andname
are 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.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 - Boolean, false by default, only
id
andname
are 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.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 - Boolean, false by default, only
id
andname
are 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.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 - Boolean, false by default, only
id
andname
are 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.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 - Boolean, false by default, only
id
andname
are 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.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 - Boolean, false by default, only
id
andname
are 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.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
).
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 - 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>
- 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 - 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
- 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 - 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>
- 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 - 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}
- 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 - 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]
- 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 - 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>
- 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
alicloud
Terraform Provider.