1. Packages
  2. AWS
  3. API Docs
  4. ecs
  5. getCluster
AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi

aws.ecs.getCluster

Explore with Pulumi AI

aws logo
AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi

    The ECS Cluster data source allows access to details of a specific cluster within an AWS ECS service.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const ecs-mongo = aws.ecs.getCluster({
        clusterName: "ecs-mongo-production",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ecs_mongo = aws.ecs.get_cluster(cluster_name="ecs-mongo-production")
    
    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.LookupCluster(ctx, &ecs.LookupClusterArgs{
    			ClusterName: "ecs-mongo-production",
    		}, 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 ecs_mongo = Aws.Ecs.GetCluster.Invoke(new()
        {
            ClusterName = "ecs-mongo-production",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ecs.EcsFunctions;
    import com.pulumi.aws.ecs.inputs.GetClusterArgs;
    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 ecs-mongo = EcsFunctions.getCluster(GetClusterArgs.builder()
                .clusterName("ecs-mongo-production")
                .build());
    
        }
    }
    
    variables:
      ecs-mongo:
        fn::invoke:
          Function: aws:ecs:getCluster
          Arguments:
            clusterName: ecs-mongo-production
    

    Using getCluster

    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 getCluster(args: GetClusterArgs, opts?: InvokeOptions): Promise<GetClusterResult>
    function getClusterOutput(args: GetClusterOutputArgs, opts?: InvokeOptions): Output<GetClusterResult>
    def get_cluster(cluster_name: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetClusterResult
    def get_cluster_output(cluster_name: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetClusterResult]
    func LookupCluster(ctx *Context, args *LookupClusterArgs, opts ...InvokeOption) (*LookupClusterResult, error)
    func LookupClusterOutput(ctx *Context, args *LookupClusterOutputArgs, opts ...InvokeOption) LookupClusterResultOutput

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

    public static class GetCluster 
    {
        public static Task<GetClusterResult> InvokeAsync(GetClusterArgs args, InvokeOptions? opts = null)
        public static Output<GetClusterResult> Invoke(GetClusterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetClusterResult> getCluster(GetClusterArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:ecs/getCluster:getCluster
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterName string
    Name of the ECS Cluster
    Tags Dictionary<string, string>
    Key-value map of resource tags
    ClusterName string
    Name of the ECS Cluster
    Tags map[string]string
    Key-value map of resource tags
    clusterName String
    Name of the ECS Cluster
    tags Map<String,String>
    Key-value map of resource tags
    clusterName string
    Name of the ECS Cluster
    tags {[key: string]: string}
    Key-value map of resource tags
    cluster_name str
    Name of the ECS Cluster
    tags Mapping[str, str]
    Key-value map of resource tags
    clusterName String
    Name of the ECS Cluster
    tags Map<String>
    Key-value map of resource tags

    getCluster Result

    The following output properties are available:

    Arn string
    ARN of the ECS Cluster
    ClusterName string
    Id string
    The provider-assigned unique ID for this managed resource.
    PendingTasksCount int
    Number of pending tasks for the ECS Cluster
    RegisteredContainerInstancesCount int
    The number of registered container instances for the ECS Cluster
    RunningTasksCount int
    Number of running tasks for the ECS Cluster
    ServiceConnectDefaults List<GetClusterServiceConnectDefault>
    The default Service Connect namespace
    Settings List<GetClusterSetting>
    Settings associated with the ECS Cluster
    Status string
    Status of the ECS Cluster
    Tags Dictionary<string, string>
    Key-value map of resource tags
    Arn string
    ARN of the ECS Cluster
    ClusterName string
    Id string
    The provider-assigned unique ID for this managed resource.
    PendingTasksCount int
    Number of pending tasks for the ECS Cluster
    RegisteredContainerInstancesCount int
    The number of registered container instances for the ECS Cluster
    RunningTasksCount int
    Number of running tasks for the ECS Cluster
    ServiceConnectDefaults []GetClusterServiceConnectDefault
    The default Service Connect namespace
    Settings []GetClusterSetting
    Settings associated with the ECS Cluster
    Status string
    Status of the ECS Cluster
    Tags map[string]string
    Key-value map of resource tags
    arn String
    ARN of the ECS Cluster
    clusterName String
    id String
    The provider-assigned unique ID for this managed resource.
    pendingTasksCount Integer
    Number of pending tasks for the ECS Cluster
    registeredContainerInstancesCount Integer
    The number of registered container instances for the ECS Cluster
    runningTasksCount Integer
    Number of running tasks for the ECS Cluster
    serviceConnectDefaults List<GetClusterServiceConnectDefault>
    The default Service Connect namespace
    settings List<GetClusterSetting>
    Settings associated with the ECS Cluster
    status String
    Status of the ECS Cluster
    tags Map<String,String>
    Key-value map of resource tags
    arn string
    ARN of the ECS Cluster
    clusterName string
    id string
    The provider-assigned unique ID for this managed resource.
    pendingTasksCount number
    Number of pending tasks for the ECS Cluster
    registeredContainerInstancesCount number
    The number of registered container instances for the ECS Cluster
    runningTasksCount number
    Number of running tasks for the ECS Cluster
    serviceConnectDefaults GetClusterServiceConnectDefault[]
    The default Service Connect namespace
    settings GetClusterSetting[]
    Settings associated with the ECS Cluster
    status string
    Status of the ECS Cluster
    tags {[key: string]: string}
    Key-value map of resource tags
    arn str
    ARN of the ECS Cluster
    cluster_name str
    id str
    The provider-assigned unique ID for this managed resource.
    pending_tasks_count int
    Number of pending tasks for the ECS Cluster
    registered_container_instances_count int
    The number of registered container instances for the ECS Cluster
    running_tasks_count int
    Number of running tasks for the ECS Cluster
    service_connect_defaults Sequence[GetClusterServiceConnectDefault]
    The default Service Connect namespace
    settings Sequence[GetClusterSetting]
    Settings associated with the ECS Cluster
    status str
    Status of the ECS Cluster
    tags Mapping[str, str]
    Key-value map of resource tags
    arn String
    ARN of the ECS Cluster
    clusterName String
    id String
    The provider-assigned unique ID for this managed resource.
    pendingTasksCount Number
    Number of pending tasks for the ECS Cluster
    registeredContainerInstancesCount Number
    The number of registered container instances for the ECS Cluster
    runningTasksCount Number
    Number of running tasks for the ECS Cluster
    serviceConnectDefaults List<Property Map>
    The default Service Connect namespace
    settings List<Property Map>
    Settings associated with the ECS Cluster
    status String
    Status of the ECS Cluster
    tags Map<String>
    Key-value map of resource tags

    Supporting Types

    GetClusterServiceConnectDefault

    Namespace string
    Namespace string
    namespace String
    namespace string
    namespace String

    GetClusterSetting

    Name string
    Value string
    Name string
    Value string
    name String
    value String
    name string
    value string
    name str
    value str
    name String
    value String

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.55.0 published on Monday, Oct 7, 2024 by Pulumi