1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cs
  5. getServerlessKubernetesClusters
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cs.getServerlessKubernetesClusters

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    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:

    EnableDetails bool
    Ids List<string>
    Cluster IDs to filter.
    KubeConfigFilePrefix string
    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.
    NameRegex string
    A regex string to filter results by cluster name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    EnableDetails bool
    Ids []string
    Cluster IDs to filter.
    KubeConfigFilePrefix string
    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.
    NameRegex string
    A regex string to filter results by cluster name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    enableDetails Boolean
    ids List<String>
    Cluster IDs to filter.
    kubeConfigFilePrefix String
    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.
    nameRegex String
    A regex string to filter results by cluster name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    enableDetails boolean
    ids string[]
    Cluster IDs to filter.
    kubeConfigFilePrefix string
    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.
    nameRegex string
    A regex string to filter results by cluster name.
    outputFile 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_file_prefix str
    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).
    enableDetails Boolean
    ids List<String>
    Cluster IDs to filter.
    kubeConfigFilePrefix String
    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.
    nameRegex String
    A regex string to filter results by cluster name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getServerlessKubernetesClusters Result

    The following output properties are available:

    Clusters List<Pulumi.AliCloud.CS.Outputs.GetServerlessKubernetesClustersCluster>
    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.
    EnableDetails bool
    KubeConfigFilePrefix string
    NameRegex string
    OutputFile string
    Clusters []GetServerlessKubernetesClustersCluster
    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.
    EnableDetails bool
    KubeConfigFilePrefix string
    NameRegex string
    OutputFile string
    clusters List<GetServerlessKubernetesClustersCluster>
    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.
    enableDetails Boolean
    kubeConfigFilePrefix String
    nameRegex String
    outputFile String
    clusters GetServerlessKubernetesClustersCluster[]
    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.
    enableDetails boolean
    kubeConfigFilePrefix string
    nameRegex string
    outputFile string
    clusters Sequence[GetServerlessKubernetesClustersCluster]
    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_file_prefix str
    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.
    enableDetails Boolean
    kubeConfigFilePrefix String
    nameRegex String
    outputFile String

    Supporting Types

    GetServerlessKubernetesClustersCluster

    Connections Pulumi.AliCloud.CS.Inputs.GetServerlessKubernetesClustersClusterConnections
    Map of serverless cluster connection information. It contains several attributes to Block Connections.
    DeletionProtection bool
    Whether the cluster support delete protection.
    EndpointPublicAccessEnabled bool
    Id string
    The ID of the container cluster.
    Name string
    The name of the container cluster.
    NatGatewayId string
    The ID of nat gateway used to launch kubernetes cluster.
    SecurityGroupId string
    The ID of security group where the current cluster is located.
    Tags Dictionary<string, object>
    VpcId string
    The ID of VPC where the current cluster is located.
    VswitchId string
    The ID of VSwitch where the current cluster is located.
    Connections GetServerlessKubernetesClustersClusterConnections
    Map of serverless cluster connection information. It contains several attributes to Block Connections.
    DeletionProtection bool
    Whether the cluster support delete protection.
    EndpointPublicAccessEnabled bool
    Id string
    The ID of the container cluster.
    Name string
    The name of the container cluster.
    NatGatewayId string
    The ID of nat gateway used to launch kubernetes cluster.
    SecurityGroupId string
    The ID of security group where the current cluster is located.
    Tags map[string]interface{}
    VpcId string
    The ID of VPC where the current cluster is located.
    VswitchId string
    The ID of VSwitch where the current cluster is located.
    connections GetServerlessKubernetesClustersClusterConnections
    Map of serverless cluster connection information. It contains several attributes to Block Connections.
    deletionProtection Boolean
    Whether the cluster support delete protection.
    endpointPublicAccessEnabled Boolean
    id String
    The ID of the container cluster.
    name String
    The name of the container cluster.
    natGatewayId String
    The ID of nat gateway used to launch kubernetes cluster.
    securityGroupId String
    The ID of security group where the current cluster is located.
    tags Map<String,Object>
    vpcId String
    The ID of VPC where the current cluster is located.
    vswitchId String
    The ID of VSwitch where the current cluster is located.
    connections GetServerlessKubernetesClustersClusterConnections
    Map of serverless cluster connection information. It contains several attributes to Block Connections.
    deletionProtection boolean
    Whether the cluster support delete protection.
    endpointPublicAccessEnabled boolean
    id string
    The ID of the container cluster.
    name string
    The name of the container cluster.
    natGatewayId string
    The ID of nat gateway used to launch kubernetes cluster.
    securityGroupId string
    The ID of security group where the current cluster is located.
    tags {[key: string]: any}
    vpcId string
    The ID of VPC where the current cluster is located.
    vswitchId string
    The ID of VSwitch where the current cluster is located.
    connections GetServerlessKubernetesClustersClusterConnections
    Map of serverless cluster connection information. It contains several attributes to Block Connections.
    deletion_protection bool
    Whether the cluster support delete protection.
    endpoint_public_access_enabled bool
    id str
    The ID of the container cluster.
    name str
    The name of the container cluster.
    nat_gateway_id str
    The ID of nat gateway used to launch kubernetes cluster.
    security_group_id str
    The ID of security group where the current cluster is located.
    tags Mapping[str, Any]
    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.
    deletionProtection Boolean
    Whether the cluster support delete protection.
    endpointPublicAccessEnabled Boolean
    id String
    The ID of the container cluster.
    name String
    The name of the container cluster.
    natGatewayId String
    The ID of nat gateway used to launch kubernetes cluster.
    securityGroupId String
    The ID of security group where the current cluster is located.
    tags Map<Any>
    vpcId String
    The ID of VPC where the current cluster is located.
    vswitchId String
    The ID of VSwitch where the current cluster is located.

    GetServerlessKubernetesClustersClusterConnections

    ApiServerInternet string
    API Server Internet endpoint.
    ApiServerIntranet string
    API Server Intranet endpoint.
    MasterPublicIp string
    Master node SSH IP address.
    ApiServerInternet string
    API Server Internet endpoint.
    ApiServerIntranet string
    API Server Intranet endpoint.
    MasterPublicIp string
    Master node SSH IP address.
    apiServerInternet String
    API Server Internet endpoint.
    apiServerIntranet String
    API Server Intranet endpoint.
    masterPublicIp String
    Master node SSH IP address.
    apiServerInternet string
    API Server Internet endpoint.
    apiServerIntranet string
    API Server Intranet endpoint.
    masterPublicIp string
    Master node SSH IP address.
    api_server_internet str
    API Server Internet endpoint.
    api_server_intranet str
    API Server Intranet endpoint.
    master_public_ip str
    Master node SSH IP address.
    apiServerInternet String
    API Server Internet endpoint.
    apiServerIntranet String
    API Server Intranet endpoint.
    masterPublicIp String
    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.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi