1. Packages
  2. AWS
  3. API Docs
  4. batch
  5. getComputeEnvironment
AWS v6.78.0 published on Thursday, Apr 24, 2025 by Pulumi

aws.batch.getComputeEnvironment

Explore with Pulumi AI

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({
    computeEnvironmentName: "batch-mongo-production",
});
Copy
import pulumi
import pulumi_aws as aws

batch_mongo = aws.batch.get_compute_environment(compute_environment_name="batch-mongo-production")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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{
			ComputeEnvironmentName: "batch-mongo-production",
		}, 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 batch_mongo = Aws.Batch.GetComputeEnvironment.Invoke(new()
    {
        ComputeEnvironmentName = "batch-mongo-production",
    });

});
Copy
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.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 batch-mongo = BatchFunctions.getComputeEnvironment(GetComputeEnvironmentArgs.builder()
            .computeEnvironmentName("batch-mongo-production")
            .build());

    }
}
Copy
variables:
  batch-mongo:
    fn::invoke:
      function: aws:batch:getComputeEnvironment
      arguments:
        computeEnvironmentName: batch-mongo-production
Copy

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

> 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)
}
Copy
public static CompletableFuture<GetComputeEnvironmentResult> getComputeEnvironment(GetComputeEnvironmentArgs args, InvokeOptions options)
public static Output<GetComputeEnvironmentResult> getComputeEnvironment(GetComputeEnvironmentArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:batch/getComputeEnvironment:getComputeEnvironment
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ComputeEnvironmentName This property is required. string
Name of the Batch Compute Environment
Tags Dictionary<string, string>
Key-value map of resource tags
ComputeEnvironmentName This property is required. string
Name of the Batch Compute Environment
Tags map[string]string
Key-value map of resource tags
computeEnvironmentName This property is required. String
Name of the Batch Compute Environment
tags Map<String,String>
Key-value map of resource tags
computeEnvironmentName This property is required. string
Name of the Batch Compute Environment
tags {[key: string]: string}
Key-value map of resource tags
compute_environment_name This property is required. str
Name of the Batch Compute Environment
tags Mapping[str, str]
Key-value map of resource tags
computeEnvironmentName This property is required. String
Name of the Batch Compute Environment
tags Map<String>
Key-value map of resource tags

getComputeEnvironment Result

The following output properties are available:

Arn string
ARN of the compute environment.
ComputeEnvironmentName string
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.
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>
Specifies the infrastructure update policy for the compute environment.
Arn string
ARN of the compute environment.
ComputeEnvironmentName string
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.
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
Specifies the infrastructure update policy for the compute environment.
arn String
ARN of the compute environment.
computeEnvironmentName String
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.
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>
Specifies the infrastructure update policy for the compute environment.
arn string
ARN of the compute environment.
computeEnvironmentName string
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.
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[]
Specifies the infrastructure update policy for the compute environment.
arn str
ARN of the compute environment.
compute_environment_name str
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.
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]
Specifies the infrastructure update policy for the compute environment.
arn String
ARN of the compute environment.
computeEnvironmentName String
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.
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>
Specifies the infrastructure update policy for the compute environment.

Supporting Types

GetComputeEnvironmentUpdatePolicy

JobExecutionTimeoutMinutes This property is required. int
TerminateJobsOnUpdate This property is required. bool
JobExecutionTimeoutMinutes This property is required. int
TerminateJobsOnUpdate This property is required. bool
jobExecutionTimeoutMinutes This property is required. Integer
terminateJobsOnUpdate This property is required. Boolean
jobExecutionTimeoutMinutes This property is required. number
terminateJobsOnUpdate This property is required. boolean
job_execution_timeout_minutes This property is required. int
terminate_jobs_on_update This property is required. bool
jobExecutionTimeoutMinutes This property is required. Number
terminateJobsOnUpdate This property is required. Boolean

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.