1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ehpc
  5. getClusters
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.ehpc.getClusters

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Ehpc Clusters of the current Alibaba Cloud user.

    NOTE: Available in v1.173.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.ehpc.getClusters({
        ids: ["example_id"],
    });
    export const ehpcClusterId1 = ids.then(ids => ids.clusters?.[0]?.id);
    const nameRegex = alicloud.ehpc.getClusters({
        nameRegex: "^my-Cluster",
    });
    export const ehpcClusterId2 = nameRegex.then(nameRegex => nameRegex.clusters?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.ehpc.get_clusters(ids=["example_id"])
    pulumi.export("ehpcClusterId1", ids.clusters[0].id)
    name_regex = alicloud.ehpc.get_clusters(name_regex="^my-Cluster")
    pulumi.export("ehpcClusterId2", name_regex.clusters[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ehpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := ehpc.GetClusters(ctx, &ehpc.GetClustersArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ehpcClusterId1", ids.Clusters[0].Id)
    		nameRegex, err := ehpc.GetClusters(ctx, &ehpc.GetClustersArgs{
    			NameRegex: pulumi.StringRef("^my-Cluster"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ehpcClusterId2", nameRegex.Clusters[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Ehpc.GetClusters.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.Ehpc.GetClusters.Invoke(new()
        {
            NameRegex = "^my-Cluster",
        });
    
        return new Dictionary<string, object?>
        {
            ["ehpcClusterId1"] = ids.Apply(getClustersResult => getClustersResult.Clusters[0]?.Id),
            ["ehpcClusterId2"] = nameRegex.Apply(getClustersResult => getClustersResult.Clusters[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ehpc.EhpcFunctions;
    import com.pulumi.alicloud.ehpc.inputs.GetClustersArgs;
    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 ids = EhpcFunctions.getClusters(GetClustersArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("ehpcClusterId1", ids.applyValue(getClustersResult -> getClustersResult.clusters()[0].id()));
            final var nameRegex = EhpcFunctions.getClusters(GetClustersArgs.builder()
                .nameRegex("^my-Cluster")
                .build());
    
            ctx.export("ehpcClusterId2", nameRegex.applyValue(getClustersResult -> getClustersResult.clusters()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:ehpc:getClusters
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:ehpc:getClusters
          Arguments:
            nameRegex: ^my-Cluster
    outputs:
      ehpcClusterId1: ${ids.clusters[0].id}
      ehpcClusterId2: ${nameRegex.clusters[0].id}
    

    Using getClusters

    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 getClusters(args: GetClustersArgs, opts?: InvokeOptions): Promise<GetClustersResult>
    function getClustersOutput(args: GetClustersOutputArgs, opts?: InvokeOptions): Output<GetClustersResult>
    def get_clusters(enable_details: Optional[bool] = None,
                     ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetClustersResult
    def get_clusters_output(enable_details: Optional[pulumi.Input[bool]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetClustersResult]
    func GetClusters(ctx *Context, args *GetClustersArgs, opts ...InvokeOption) (*GetClustersResult, error)
    func GetClustersOutput(ctx *Context, args *GetClustersOutputArgs, opts ...InvokeOption) GetClustersResultOutput

    > Note: This function is named GetClusters in the Go SDK.

    public static class GetClusters 
    {
        public static Task<GetClustersResult> InvokeAsync(GetClustersArgs args, InvokeOptions? opts = null)
        public static Output<GetClustersResult> Invoke(GetClustersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetClustersResult> getClusters(GetClustersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ehpc/getClusters:getClusters
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Cluster IDs.
    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).
    Status string
    The status of the resource. Valid values:
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Cluster IDs.
    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).
    Status string
    The status of the resource. Valid values:
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Cluster IDs.
    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).
    status String
    The status of the resource. Valid values:
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Cluster IDs.
    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).
    status string
    The status of the resource. Valid values:
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Cluster IDs.
    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).
    status str
    The status of the resource. Valid values:
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Cluster IDs.
    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).
    status String
    The status of the resource. Valid values:

    getClusters Result

    The following output properties are available:

    Clusters List<Pulumi.AliCloud.Ehpc.Outputs.GetClustersCluster>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string
    Clusters []GetClustersCluster
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string
    clusters List<GetClustersCluster>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    status String
    clusters GetClustersCluster[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    enableDetails boolean
    nameRegex string
    outputFile string
    status string
    clusters Sequence[GetClustersCluster]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    enable_details bool
    name_regex str
    output_file str
    status str
    clusters List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    status String

    Supporting Types

    GetClustersCluster

    AccountType string
    The server type of the account.
    Applications List<Pulumi.AliCloud.Ehpc.Inputs.GetClustersClusterApplication>
    ClientVersion string
    The version number of the client used by the cluster.
    ClusterId string
    ClusterName string
    ComputeCount int
    ComputeInstanceType string
    CreateTime string
    DeployMode string
    Description string
    HaEnable bool
    Id string
    ImageId string
    ImageOwnerAlias string
    LoginCount int
    LoginInstanceType string
    ManagerCount int
    ManagerInstanceType string
    OsTag string
    PostInstallScripts List<Pulumi.AliCloud.Ehpc.Inputs.GetClustersClusterPostInstallScript>
    RemoteDirectory string
    SccClusterId string
    SchedulerType string
    SecurityGroupId string
    Status string
    The status of the resource. Valid values:
    VolumeId string
    VolumeMountpoint string
    VolumeProtocol string
    VolumeType string
    VpcId string
    VswitchId string
    ZoneId string
    AccountType string
    The server type of the account.
    Applications []GetClustersClusterApplication
    ClientVersion string
    The version number of the client used by the cluster.
    ClusterId string
    ClusterName string
    ComputeCount int
    ComputeInstanceType string
    CreateTime string
    DeployMode string
    Description string
    HaEnable bool
    Id string
    ImageId string
    ImageOwnerAlias string
    LoginCount int
    LoginInstanceType string
    ManagerCount int
    ManagerInstanceType string
    OsTag string
    PostInstallScripts []GetClustersClusterPostInstallScript
    RemoteDirectory string
    SccClusterId string
    SchedulerType string
    SecurityGroupId string
    Status string
    The status of the resource. Valid values:
    VolumeId string
    VolumeMountpoint string
    VolumeProtocol string
    VolumeType string
    VpcId string
    VswitchId string
    ZoneId string
    accountType String
    The server type of the account.
    applications List<GetClustersClusterApplication>
    clientVersion String
    The version number of the client used by the cluster.
    clusterId String
    clusterName String
    computeCount Integer
    computeInstanceType String
    createTime String
    deployMode String
    description String
    haEnable Boolean
    id String
    imageId String
    imageOwnerAlias String
    loginCount Integer
    loginInstanceType String
    managerCount Integer
    managerInstanceType String
    osTag String
    postInstallScripts List<GetClustersClusterPostInstallScript>
    remoteDirectory String
    sccClusterId String
    schedulerType String
    securityGroupId String
    status String
    The status of the resource. Valid values:
    volumeId String
    volumeMountpoint String
    volumeProtocol String
    volumeType String
    vpcId String
    vswitchId String
    zoneId String
    accountType string
    The server type of the account.
    applications GetClustersClusterApplication[]
    clientVersion string
    The version number of the client used by the cluster.
    clusterId string
    clusterName string
    computeCount number
    computeInstanceType string
    createTime string
    deployMode string
    description string
    haEnable boolean
    id string
    imageId string
    imageOwnerAlias string
    loginCount number
    loginInstanceType string
    managerCount number
    managerInstanceType string
    osTag string
    postInstallScripts GetClustersClusterPostInstallScript[]
    remoteDirectory string
    sccClusterId string
    schedulerType string
    securityGroupId string
    status string
    The status of the resource. Valid values:
    volumeId string
    volumeMountpoint string
    volumeProtocol string
    volumeType string
    vpcId string
    vswitchId string
    zoneId string
    accountType String
    The server type of the account.
    applications List<Property Map>
    clientVersion String
    The version number of the client used by the cluster.
    clusterId String
    clusterName String
    computeCount Number
    computeInstanceType String
    createTime String
    deployMode String
    description String
    haEnable Boolean
    id String
    imageId String
    imageOwnerAlias String
    loginCount Number
    loginInstanceType String
    managerCount Number
    managerInstanceType String
    osTag String
    postInstallScripts List<Property Map>
    remoteDirectory String
    sccClusterId String
    schedulerType String
    securityGroupId String
    status String
    The status of the resource. Valid values:
    volumeId String
    volumeMountpoint String
    volumeProtocol String
    volumeType String
    vpcId String
    vswitchId String
    zoneId String

    GetClustersClusterApplication

    Tag string
    Tag string
    tag String
    tag string
    tag str
    tag String

    GetClustersClusterPostInstallScript

    Args string
    Url string
    Args string
    Url string
    args String
    url String
    args string
    url string
    args str
    url str
    args String
    url String

    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.54.0 published on Wednesday, Apr 24, 2024 by Pulumi