1. Packages
  2. AWS
  3. API Docs
  4. ecs
  5. getClusters
AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
aws-v6 logo
AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi

    Data source for managing an AWS ECS (Elastic Container) Clusters.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ecs.getClusters({});
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ecs.get_clusters()
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.GetClusters(ctx, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ecs.GetClusters.Invoke();
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ecs.EcsFunctions;
    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.getClusters(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:ecs:getClusters
          arguments: {}
    

    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(opts?: InvokeOptions): Promise<GetClustersResult>
    function getClustersOutput(opts?: InvokeOptions): Output<GetClustersResult>
    def get_clusters(opts: Optional[InvokeOptions] = None) -> GetClustersResult
    def get_clusters_output(opts: Optional[InvokeOptions] = None) -> Output[GetClustersResult]
    func GetClusters(ctx *Context, opts ...InvokeOption) (*GetClustersResult, error)
    func GetClustersOutput(ctx *Context, opts ...InvokeOption) GetClustersResultOutput

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

    public static class GetClusters 
    {
        public static Task<GetClustersResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetClustersResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetClustersResult> getClusters(InvokeOptions options)
    public static Output<GetClustersResult> getClusters(InvokeOptions options)
    
    fn::invoke:
      function: aws:ecs/getClusters:getClusters
      arguments:
        # arguments dictionary

    getClusters Result

    The following output properties are available:

    ClusterArns List<string>
    List of ECS cluster ARNs associated with the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    ClusterArns []string
    List of ECS cluster ARNs associated with the account.
    Id string
    The provider-assigned unique ID for this managed resource.
    clusterArns List<String>
    List of ECS cluster ARNs associated with the account.
    id String
    The provider-assigned unique ID for this managed resource.
    clusterArns string[]
    List of ECS cluster ARNs associated with the account.
    id string
    The provider-assigned unique ID for this managed resource.
    cluster_arns Sequence[str]
    List of ECS cluster ARNs associated with the account.
    id str
    The provider-assigned unique ID for this managed resource.
    clusterArns List<String>
    List of ECS cluster ARNs associated with the account.
    id String
    The provider-assigned unique ID for this managed resource.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws-v6 logo
    AWS v6 v6.83.2 published on Thursday, Nov 20, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate