1. Registry
  2. Packages
  3. AWS
  4. API Docs
  5. batch
  6. getComputeEnvironment
Viewing docs for AWS v7.51.1
published on Friday, Oct 16, 2026 by Pulumi
aws logo aws logo
Viewing docs for AWS v7.51.1
published on Friday, Oct 16, 2026 by Pulumi

    The Batch Compute Environment data source allows access to details of a specific compute environment within AWS Batch.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const batch_mongo = aws.batch.getComputeEnvironment({
        name: "batch-mongo-production",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    batch_mongo = aws.batch.get_compute_environment(name="batch-mongo-production")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/batch"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := batch.LookupComputeEnvironment(ctx, &batch.LookupComputeEnvironmentArgs{
    			Name: "batch-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 batch_mongo = Aws.Batch.GetComputeEnvironment.Invoke(new()
        {
            Name = "batch-mongo-production",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.batch.BatchFunctions;
    import com.pulumi.aws.batch.inputs.GetComputeEnvironmentArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 batch-mongo = BatchFunctions.getComputeEnvironment(GetComputeEnvironmentArgs.builder()
                .name("batch-mongo-production")
                .build());
    
        }
    }
    
    variables:
      batch-mongo:
        fn::invoke:
          function: aws:batch:getComputeEnvironment
          arguments:
            name: batch-mongo-production
    
    pulumi {
      required_providers {
        aws = {
          source = "pulumi/aws"
        }
      }
    }
    
    data "aws_batch_getcomputeenvironment" "batch-mongo" {
      name = "batch-mongo-production"
    }
    

    Using getComputeEnvironment

    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 getComputeEnvironment(args: GetComputeEnvironmentArgs, opts?: InvokeOptions): Promise<GetComputeEnvironmentResult>
    function getComputeEnvironmentOutput(args: GetComputeEnvironmentOutputArgs, opts?: InvokeOutputOptions): Output<GetComputeEnvironmentResult>
    def get_compute_environment(name: Optional[str] = None,
                                region: Optional[str] = None,
                                tags: Optional[Mapping[str, str]] = None,
                                opts: Optional[InvokeOptions] = None) -> GetComputeEnvironmentResult
    def get_compute_environment_output(name: pulumi.Input[Optional[str]] = None,
                                region: pulumi.Input[Optional[str]] = None,
                                tags: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
                                opts: Optional[InvokeOutputOptions] = None) -> Output[GetComputeEnvironmentResult]
    func LookupComputeEnvironment(ctx *Context, args *LookupComputeEnvironmentArgs, opts ...InvokeOption) (*LookupComputeEnvironmentResult, error)
    func LookupComputeEnvironmentOutput(ctx *Context, args *LookupComputeEnvironmentOutputArgs, opts ...InvokeOption) LookupComputeEnvironmentResultOutput

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

    public static class GetComputeEnvironment 
    {
        public static Task<GetComputeEnvironmentResult> InvokeAsync(GetComputeEnvironmentArgs args, InvokeOptions? opts = null)
        public static Output<GetComputeEnvironmentResult> Invoke(GetComputeEnvironmentInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetComputeEnvironmentResult> Invoke(GetComputeEnvironmentInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetComputeEnvironmentResult> getComputeEnvironment(GetComputeEnvironmentArgs args, InvokeOptions options)
    public static Output<GetComputeEnvironmentResult> getComputeEnvironment(GetComputeEnvironmentArgs args, InvokeOptions options)
    public static Output<GetComputeEnvironmentResult> getComputeEnvironment(GetComputeEnvironmentArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: aws:batch/getComputeEnvironment:getComputeEnvironment
      arguments:
        # arguments dictionary
    data "aws_batch_get_compute_environment" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    Name of the Batch Compute Environment
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    Key-value map of resource tags
    Name string
    Name of the Batch Compute Environment
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    Key-value map of resource tags
    name string
    Name of the Batch Compute Environment
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags map(string)
    Key-value map of resource tags
    name String
    Name of the Batch Compute Environment
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    Key-value map of resource tags
    name string
    Name of the Batch Compute Environment
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    Key-value map of resource tags
    name str
    Name of the Batch Compute Environment
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    Key-value map of resource tags
    name String
    Name of the Batch Compute Environment
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    Key-value map of resource tags

    getComputeEnvironment Result

    The following output properties are available:

    Arn string
    ARN of the compute environment.
    EcsClusterArn string
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Region string
    ServiceRole string
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    State string
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    Status string
    Current status of the compute environment (for example, CREATING or VALID).
    StatusReason string
    Short, human-readable string to provide additional details about the current status of the compute environment.
    Tags Dictionary<string, string>
    Key-value map of resource tags
    Type string
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    UpdatePolicies List<GetComputeEnvironmentUpdatePolicy>
    Infrastructure update policy for the compute environment.
    Arn string
    ARN of the compute environment.
    EcsClusterArn string
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Region string
    ServiceRole string
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    State string
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    Status string
    Current status of the compute environment (for example, CREATING or VALID).
    StatusReason string
    Short, human-readable string to provide additional details about the current status of the compute environment.
    Tags map[string]string
    Key-value map of resource tags
    Type string
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    UpdatePolicies []GetComputeEnvironmentUpdatePolicy
    Infrastructure update policy for the compute environment.
    arn string
    ARN of the compute environment.
    ecs_cluster_arn string
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    region string
    service_role string
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    state string
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    status string
    Current status of the compute environment (for example, CREATING or VALID).
    status_reason string
    Short, human-readable string to provide additional details about the current status of the compute environment.
    tags map(string)
    Key-value map of resource tags
    type string
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    update_policies list(object)
    Infrastructure update policy for the compute environment.
    arn String
    ARN of the compute environment.
    ecsClusterArn String
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    region String
    serviceRole String
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    state String
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    status String
    Current status of the compute environment (for example, CREATING or VALID).
    statusReason String
    Short, human-readable string to provide additional details about the current status of the compute environment.
    tags Map<String,String>
    Key-value map of resource tags
    type String
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    updatePolicies List<GetComputeEnvironmentUpdatePolicy>
    Infrastructure update policy for the compute environment.
    arn string
    ARN of the compute environment.
    ecsClusterArn string
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    region string
    serviceRole string
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    state string
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    status string
    Current status of the compute environment (for example, CREATING or VALID).
    statusReason string
    Short, human-readable string to provide additional details about the current status of the compute environment.
    tags {[key: string]: string}
    Key-value map of resource tags
    type string
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    updatePolicies GetComputeEnvironmentUpdatePolicy[]
    Infrastructure update policy for the compute environment.
    arn str
    ARN of the compute environment.
    ecs_cluster_arn str
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    region str
    service_role str
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    state str
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    status str
    Current status of the compute environment (for example, CREATING or VALID).
    status_reason str
    Short, human-readable string to provide additional details about the current status of the compute environment.
    tags Mapping[str, str]
    Key-value map of resource tags
    type str
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    update_policies Sequence[GetComputeEnvironmentUpdatePolicy]
    Infrastructure update policy for the compute environment.
    arn String
    ARN of the compute environment.
    ecsClusterArn String
    ARN of the underlying Amazon ECS cluster used by the compute environment.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    region String
    serviceRole String
    ARN of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
    state String
    State of the compute environment (for example, ENABLED or DISABLED). If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.
    status String
    Current status of the compute environment (for example, CREATING or VALID).
    statusReason String
    Short, human-readable string to provide additional details about the current status of the compute environment.
    tags Map<String>
    Key-value map of resource tags
    type String
    Type of the compute environment (for example, MANAGED or UNMANAGED).
    updatePolicies List<Property Map>
    Infrastructure update policy for the compute environment.

    Supporting Types

    GetComputeEnvironmentUpdatePolicy

    JobExecutionTimeoutMinutes int
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    TerminateJobsOnUpdate bool
    Whether running jobs are terminated when the compute environment infrastructure is updated.
    JobExecutionTimeoutMinutes int
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    TerminateJobsOnUpdate bool
    Whether running jobs are terminated when the compute environment infrastructure is updated.
    job_execution_timeout_minutes number
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    terminate_jobs_on_update bool
    Whether running jobs are terminated when the compute environment infrastructure is updated.
    jobExecutionTimeoutMinutes Integer
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    terminateJobsOnUpdate Boolean
    Whether running jobs are terminated when the compute environment infrastructure is updated.
    jobExecutionTimeoutMinutes number
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    terminateJobsOnUpdate boolean
    Whether running jobs are terminated when the compute environment infrastructure is updated.
    job_execution_timeout_minutes int
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    terminate_jobs_on_update bool
    Whether running jobs are terminated when the compute environment infrastructure is updated.
    jobExecutionTimeoutMinutes Number
    Time, in minutes, that a job can run before the compute environment infrastructure is updated.
    terminateJobsOnUpdate Boolean
    Whether running jobs are terminated when the compute environment infrastructure is updated.

    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 logo
    Viewing docs for AWS v7.51.1
    published on Friday, Oct 16, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial