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

alicloud.ecs.getHpcClusters

Explore with Pulumi AI

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

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

    NOTE: Available in v1.116.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.ecs.getHpcClusters({
        ids: ["hpc-bp1i09xxxxxxxx"],
        nameRegex: "tf-testAcc",
    });
    export const firstEcsHpcClusterId = example.then(example => example.clusters?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.ecs.get_hpc_clusters(ids=["hpc-bp1i09xxxxxxxx"],
        name_regex="tf-testAcc")
    pulumi.export("firstEcsHpcClusterId", example.clusters[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ecs.GetHpcClusters(ctx, &ecs.GetHpcClustersArgs{
    			Ids: []string{
    				"hpc-bp1i09xxxxxxxx",
    			},
    			NameRegex: pulumi.StringRef("tf-testAcc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstEcsHpcClusterId", example.Clusters[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Ecs.GetHpcClusters.Invoke(new()
        {
            Ids = new[]
            {
                "hpc-bp1i09xxxxxxxx",
            },
            NameRegex = "tf-testAcc",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstEcsHpcClusterId"] = example.Apply(getHpcClustersResult => getHpcClustersResult.Clusters[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetHpcClustersArgs;
    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 example = EcsFunctions.getHpcClusters(GetHpcClustersArgs.builder()
                .ids("hpc-bp1i09xxxxxxxx")
                .nameRegex("tf-testAcc")
                .build());
    
            ctx.export("firstEcsHpcClusterId", example.applyValue(getHpcClustersResult -> getHpcClustersResult.clusters()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:ecs:getHpcClusters
          Arguments:
            ids:
              - hpc-bp1i09xxxxxxxx
            nameRegex: tf-testAcc
    outputs:
      firstEcsHpcClusterId: ${example.clusters[0].id}
    

    Using getHpcClusters

    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 getHpcClusters(args: GetHpcClustersArgs, opts?: InvokeOptions): Promise<GetHpcClustersResult>
    function getHpcClustersOutput(args: GetHpcClustersOutputArgs, opts?: InvokeOptions): Output<GetHpcClustersResult>
    def get_hpc_clusters(ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetHpcClustersResult
    def get_hpc_clusters_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetHpcClustersResult]
    func GetHpcClusters(ctx *Context, args *GetHpcClustersArgs, opts ...InvokeOption) (*GetHpcClustersResult, error)
    func GetHpcClustersOutput(ctx *Context, args *GetHpcClustersOutputArgs, opts ...InvokeOption) GetHpcClustersResultOutput

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

    public static class GetHpcClusters 
    {
        public static Task<GetHpcClustersResult> InvokeAsync(GetHpcClustersArgs args, InvokeOptions? opts = null)
        public static Output<GetHpcClustersResult> Invoke(GetHpcClustersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetHpcClustersResult> getHpcClusters(GetHpcClustersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getHpcClusters:getHpcClusters
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Hpc Cluster IDs.
    NameRegex string
    A regex string to filter results by Hpc Cluster name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Hpc Cluster IDs.
    NameRegex string
    A regex string to filter results by Hpc Cluster name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Hpc Cluster IDs.
    nameRegex String
    A regex string to filter results by Hpc Cluster name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Hpc Cluster IDs.
    nameRegex string
    A regex string to filter results by Hpc Cluster name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Hpc Cluster IDs.
    name_regex str
    A regex string to filter results by Hpc Cluster name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Hpc Cluster IDs.
    nameRegex String
    A regex string to filter results by Hpc Cluster name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getHpcClusters Result

    The following output properties are available:

    Clusters List<Pulumi.AliCloud.Ecs.Outputs.GetHpcClustersCluster>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    NameRegex string
    OutputFile string
    Clusters []GetHpcClustersCluster
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    NameRegex string
    OutputFile string
    clusters List<GetHpcClustersCluster>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    clusters GetHpcClustersCluster[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    nameRegex string
    outputFile string
    clusters Sequence[GetHpcClustersCluster]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    name_regex str
    output_file str
    clusters List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String

    Supporting Types

    GetHpcClustersCluster

    Description string
    The description of ECS Hpc Cluster.
    HpcClusterId string
    The ID of the Hpc Cluster.
    Id string
    The ID of the Hpc Cluster.
    Name string
    The name of ECS Hpc Cluster.
    Description string
    The description of ECS Hpc Cluster.
    HpcClusterId string
    The ID of the Hpc Cluster.
    Id string
    The ID of the Hpc Cluster.
    Name string
    The name of ECS Hpc Cluster.
    description String
    The description of ECS Hpc Cluster.
    hpcClusterId String
    The ID of the Hpc Cluster.
    id String
    The ID of the Hpc Cluster.
    name String
    The name of ECS Hpc Cluster.
    description string
    The description of ECS Hpc Cluster.
    hpcClusterId string
    The ID of the Hpc Cluster.
    id string
    The ID of the Hpc Cluster.
    name string
    The name of ECS Hpc Cluster.
    description str
    The description of ECS Hpc Cluster.
    hpc_cluster_id str
    The ID of the Hpc Cluster.
    id str
    The ID of the Hpc Cluster.
    name str
    The name of ECS Hpc Cluster.
    description String
    The description of ECS Hpc Cluster.
    hpcClusterId String
    The ID of the Hpc Cluster.
    id String
    The ID of the Hpc Cluster.
    name String
    The name of ECS Hpc Cluster.

    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