1. Packages
  2. AWS
  3. API Docs
  4. ecs
  5. getClusters
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.ecs.getClusters

Explore with Pulumi AI

AWS v6.75.0 published on Wednesday, Apr 2, 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({});
Copy
import pulumi
import pulumi_aws as aws

example = aws.ecs.get_clusters()
Copy
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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Ecs.GetClusters.Invoke();

});
Copy
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();

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:ecs:getClusters
      arguments: {}
Copy

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

> 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)
}
Copy
public static CompletableFuture<GetClustersResult> getClusters(InvokeOptions options)
public static Output<GetClustersResult> getClusters(InvokeOptions options)
Copy
fn::invoke:
  function: aws:ecs/getClusters:getClusters
  arguments:
    # arguments dictionary
Copy

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.75.0 published on Wednesday, Apr 2, 2025 by Pulumi