getComputeEnvironment function

Future<GetComputeEnvironmentResult> getComputeEnvironment(
  1. GetComputeEnvironmentArgs args, {
  2. InvokeOptions? options,
})

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")
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 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
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_batch_getcomputeenvironment" "batch-mongo" {
  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

args Arguments passed to this invoke. Arguments for getComputeEnvironment. options Invoke options controlling this call.

Implementation

Future<GetComputeEnvironmentResult> getComputeEnvironment(
  GetComputeEnvironmentArgs args, {
  pulumi.InvokeOptions? options,
}) async {
  final deployment = pulumi.Deployment.instance;
  final result = await deployment.invoke<Map<String, dynamic>>(
    'aws:batch/getComputeEnvironment:getComputeEnvironment',
    args.toMap(),
    options: pulumi.toDeploymentInvokeOptions(options),
  );
  return GetComputeEnvironmentResult.fromMap(result);
}