aws.batch.ComputeEnvironment
Explore with Pulumi AI
Creates a AWS Batch compute environment. Compute environments contain the Amazon ECS container instances that are used to run containerized batch jobs.
For information about AWS Batch, see What is AWS Batch? . For information about compute environment, see Compute Environments .
Note: To prevent a race condition during environment deletion, make sure to set
depends_onto the relatedaws.iam.RolePolicyAttachment; otherwise, the policy may be destroyed too soon and the compute environment will then get stuck in theDELETINGstate, see Troubleshooting AWS Batch .
Example Usage
EC2 Type
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ec2AssumeRole = aws.iam.getPolicyDocument({
    statements: [{
        effect: "Allow",
        principals: [{
            type: "Service",
            identifiers: ["ec2.amazonaws.com"],
        }],
        actions: ["sts:AssumeRole"],
    }],
});
const ecsInstanceRole = new aws.iam.Role("ecs_instance_role", {
    name: "ecs_instance_role",
    assumeRolePolicy: ec2AssumeRole.then(ec2AssumeRole => ec2AssumeRole.json),
});
const ecsInstanceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("ecs_instance_role", {
    role: ecsInstanceRole.name,
    policyArn: "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
});
const ecsInstanceRoleInstanceProfile = new aws.iam.InstanceProfile("ecs_instance_role", {
    name: "ecs_instance_role",
    role: ecsInstanceRole.name,
});
const batchAssumeRole = aws.iam.getPolicyDocument({
    statements: [{
        effect: "Allow",
        principals: [{
            type: "Service",
            identifiers: ["batch.amazonaws.com"],
        }],
        actions: ["sts:AssumeRole"],
    }],
});
const awsBatchServiceRole = new aws.iam.Role("aws_batch_service_role", {
    name: "aws_batch_service_role",
    assumeRolePolicy: batchAssumeRole.then(batchAssumeRole => batchAssumeRole.json),
});
const awsBatchServiceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("aws_batch_service_role", {
    role: awsBatchServiceRole.name,
    policyArn: "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
});
const sample = new aws.ec2.SecurityGroup("sample", {
    name: "aws_batch_compute_environment_security_group",
    egress: [{
        fromPort: 0,
        toPort: 0,
        protocol: "-1",
        cidrBlocks: ["0.0.0.0/0"],
    }],
});
const sampleVpc = new aws.ec2.Vpc("sample", {cidrBlock: "10.1.0.0/16"});
const sampleSubnet = new aws.ec2.Subnet("sample", {
    vpcId: sampleVpc.id,
    cidrBlock: "10.1.1.0/24",
});
const samplePlacementGroup = new aws.ec2.PlacementGroup("sample", {
    name: "sample",
    strategy: aws.ec2.PlacementStrategy.Cluster,
});
const sampleComputeEnvironment = new aws.batch.ComputeEnvironment("sample", {
    computeEnvironmentName: "sample",
    computeResources: {
        instanceRole: ecsInstanceRoleInstanceProfile.arn,
        instanceTypes: ["c4.large"],
        maxVcpus: 16,
        minVcpus: 0,
        placementGroup: samplePlacementGroup.name,
        securityGroupIds: [sample.id],
        subnets: [sampleSubnet.id],
        type: "EC2",
    },
    serviceRole: awsBatchServiceRole.arn,
    type: "MANAGED",
}, {
    dependsOn: [awsBatchServiceRoleRolePolicyAttachment],
});
import pulumi
import pulumi_aws as aws
ec2_assume_role = aws.iam.get_policy_document(statements=[{
    "effect": "Allow",
    "principals": [{
        "type": "Service",
        "identifiers": ["ec2.amazonaws.com"],
    }],
    "actions": ["sts:AssumeRole"],
}])
ecs_instance_role = aws.iam.Role("ecs_instance_role",
    name="ecs_instance_role",
    assume_role_policy=ec2_assume_role.json)
ecs_instance_role_role_policy_attachment = aws.iam.RolePolicyAttachment("ecs_instance_role",
    role=ecs_instance_role.name,
    policy_arn="arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role")
ecs_instance_role_instance_profile = aws.iam.InstanceProfile("ecs_instance_role",
    name="ecs_instance_role",
    role=ecs_instance_role.name)
batch_assume_role = aws.iam.get_policy_document(statements=[{
    "effect": "Allow",
    "principals": [{
        "type": "Service",
        "identifiers": ["batch.amazonaws.com"],
    }],
    "actions": ["sts:AssumeRole"],
}])
aws_batch_service_role = aws.iam.Role("aws_batch_service_role",
    name="aws_batch_service_role",
    assume_role_policy=batch_assume_role.json)
aws_batch_service_role_role_policy_attachment = aws.iam.RolePolicyAttachment("aws_batch_service_role",
    role=aws_batch_service_role.name,
    policy_arn="arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole")
sample = aws.ec2.SecurityGroup("sample",
    name="aws_batch_compute_environment_security_group",
    egress=[{
        "from_port": 0,
        "to_port": 0,
        "protocol": "-1",
        "cidr_blocks": ["0.0.0.0/0"],
    }])
sample_vpc = aws.ec2.Vpc("sample", cidr_block="10.1.0.0/16")
sample_subnet = aws.ec2.Subnet("sample",
    vpc_id=sample_vpc.id,
    cidr_block="10.1.1.0/24")
sample_placement_group = aws.ec2.PlacementGroup("sample",
    name="sample",
    strategy=aws.ec2.PlacementStrategy.CLUSTER)
sample_compute_environment = aws.batch.ComputeEnvironment("sample",
    compute_environment_name="sample",
    compute_resources={
        "instance_role": ecs_instance_role_instance_profile.arn,
        "instance_types": ["c4.large"],
        "max_vcpus": 16,
        "min_vcpus": 0,
        "placement_group": sample_placement_group.name,
        "security_group_ids": [sample.id],
        "subnets": [sample_subnet.id],
        "type": "EC2",
    },
    service_role=aws_batch_service_role.arn,
    type="MANAGED",
    opts = pulumi.ResourceOptions(depends_on=[aws_batch_service_role_role_policy_attachment]))
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ec2AssumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Effect: pulumi.StringRef("Allow"),
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "Service",
							Identifiers: []string{
								"ec2.amazonaws.com",
							},
						},
					},
					Actions: []string{
						"sts:AssumeRole",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		ecsInstanceRole, err := iam.NewRole(ctx, "ecs_instance_role", &iam.RoleArgs{
			Name:             pulumi.String("ecs_instance_role"),
			AssumeRolePolicy: pulumi.String(ec2AssumeRole.Json),
		})
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicyAttachment(ctx, "ecs_instance_role", &iam.RolePolicyAttachmentArgs{
			Role:      ecsInstanceRole.Name,
			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"),
		})
		if err != nil {
			return err
		}
		ecsInstanceRoleInstanceProfile, err := iam.NewInstanceProfile(ctx, "ecs_instance_role", &iam.InstanceProfileArgs{
			Name: pulumi.String("ecs_instance_role"),
			Role: ecsInstanceRole.Name,
		})
		if err != nil {
			return err
		}
		batchAssumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Effect: pulumi.StringRef("Allow"),
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "Service",
							Identifiers: []string{
								"batch.amazonaws.com",
							},
						},
					},
					Actions: []string{
						"sts:AssumeRole",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		awsBatchServiceRole, err := iam.NewRole(ctx, "aws_batch_service_role", &iam.RoleArgs{
			Name:             pulumi.String("aws_batch_service_role"),
			AssumeRolePolicy: pulumi.String(batchAssumeRole.Json),
		})
		if err != nil {
			return err
		}
		awsBatchServiceRoleRolePolicyAttachment, err := iam.NewRolePolicyAttachment(ctx, "aws_batch_service_role", &iam.RolePolicyAttachmentArgs{
			Role:      awsBatchServiceRole.Name,
			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole"),
		})
		if err != nil {
			return err
		}
		sample, err := ec2.NewSecurityGroup(ctx, "sample", &ec2.SecurityGroupArgs{
			Name: pulumi.String("aws_batch_compute_environment_security_group"),
			Egress: ec2.SecurityGroupEgressArray{
				&ec2.SecurityGroupEgressArgs{
					FromPort: pulumi.Int(0),
					ToPort:   pulumi.Int(0),
					Protocol: pulumi.String("-1"),
					CidrBlocks: pulumi.StringArray{
						pulumi.String("0.0.0.0/0"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		sampleVpc, err := ec2.NewVpc(ctx, "sample", &ec2.VpcArgs{
			CidrBlock: pulumi.String("10.1.0.0/16"),
		})
		if err != nil {
			return err
		}
		sampleSubnet, err := ec2.NewSubnet(ctx, "sample", &ec2.SubnetArgs{
			VpcId:     sampleVpc.ID(),
			CidrBlock: pulumi.String("10.1.1.0/24"),
		})
		if err != nil {
			return err
		}
		samplePlacementGroup, err := ec2.NewPlacementGroup(ctx, "sample", &ec2.PlacementGroupArgs{
			Name:     pulumi.String("sample"),
			Strategy: pulumi.String(ec2.PlacementStrategyCluster),
		})
		if err != nil {
			return err
		}
		_, err = batch.NewComputeEnvironment(ctx, "sample", &batch.ComputeEnvironmentArgs{
			ComputeEnvironmentName: pulumi.String("sample"),
			ComputeResources: &batch.ComputeEnvironmentComputeResourcesArgs{
				InstanceRole: ecsInstanceRoleInstanceProfile.Arn,
				InstanceTypes: pulumi.StringArray{
					pulumi.String("c4.large"),
				},
				MaxVcpus:       pulumi.Int(16),
				MinVcpus:       pulumi.Int(0),
				PlacementGroup: samplePlacementGroup.Name,
				SecurityGroupIds: pulumi.StringArray{
					sample.ID(),
				},
				Subnets: pulumi.StringArray{
					sampleSubnet.ID(),
				},
				Type: pulumi.String("EC2"),
			},
			ServiceRole: awsBatchServiceRole.Arn,
			Type:        pulumi.String("MANAGED"),
		}, pulumi.DependsOn([]pulumi.Resource{
			awsBatchServiceRoleRolePolicyAttachment,
		}))
		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 ec2AssumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Effect = "Allow",
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "Service",
                        Identifiers = new[]
                        {
                            "ec2.amazonaws.com",
                        },
                    },
                },
                Actions = new[]
                {
                    "sts:AssumeRole",
                },
            },
        },
    });
    var ecsInstanceRole = new Aws.Iam.Role("ecs_instance_role", new()
    {
        Name = "ecs_instance_role",
        AssumeRolePolicy = ec2AssumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });
    var ecsInstanceRoleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("ecs_instance_role", new()
    {
        Role = ecsInstanceRole.Name,
        PolicyArn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
    });
    var ecsInstanceRoleInstanceProfile = new Aws.Iam.InstanceProfile("ecs_instance_role", new()
    {
        Name = "ecs_instance_role",
        Role = ecsInstanceRole.Name,
    });
    var batchAssumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Effect = "Allow",
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "Service",
                        Identifiers = new[]
                        {
                            "batch.amazonaws.com",
                        },
                    },
                },
                Actions = new[]
                {
                    "sts:AssumeRole",
                },
            },
        },
    });
    var awsBatchServiceRole = new Aws.Iam.Role("aws_batch_service_role", new()
    {
        Name = "aws_batch_service_role",
        AssumeRolePolicy = batchAssumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });
    var awsBatchServiceRoleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("aws_batch_service_role", new()
    {
        Role = awsBatchServiceRole.Name,
        PolicyArn = "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
    });
    var sample = new Aws.Ec2.SecurityGroup("sample", new()
    {
        Name = "aws_batch_compute_environment_security_group",
        Egress = new[]
        {
            new Aws.Ec2.Inputs.SecurityGroupEgressArgs
            {
                FromPort = 0,
                ToPort = 0,
                Protocol = "-1",
                CidrBlocks = new[]
                {
                    "0.0.0.0/0",
                },
            },
        },
    });
    var sampleVpc = new Aws.Ec2.Vpc("sample", new()
    {
        CidrBlock = "10.1.0.0/16",
    });
    var sampleSubnet = new Aws.Ec2.Subnet("sample", new()
    {
        VpcId = sampleVpc.Id,
        CidrBlock = "10.1.1.0/24",
    });
    var samplePlacementGroup = new Aws.Ec2.PlacementGroup("sample", new()
    {
        Name = "sample",
        Strategy = Aws.Ec2.PlacementStrategy.Cluster,
    });
    var sampleComputeEnvironment = new Aws.Batch.ComputeEnvironment("sample", new()
    {
        ComputeEnvironmentName = "sample",
        ComputeResources = new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesArgs
        {
            InstanceRole = ecsInstanceRoleInstanceProfile.Arn,
            InstanceTypes = new[]
            {
                "c4.large",
            },
            MaxVcpus = 16,
            MinVcpus = 0,
            PlacementGroup = samplePlacementGroup.Name,
            SecurityGroupIds = new[]
            {
                sample.Id,
            },
            Subnets = new[]
            {
                sampleSubnet.Id,
            },
            Type = "EC2",
        },
        ServiceRole = awsBatchServiceRole.Arn,
        Type = "MANAGED",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            awsBatchServiceRoleRolePolicyAttachment,
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import com.pulumi.aws.iam.InstanceProfile;
import com.pulumi.aws.iam.InstanceProfileArgs;
import com.pulumi.aws.ec2.SecurityGroup;
import com.pulumi.aws.ec2.SecurityGroupArgs;
import com.pulumi.aws.ec2.inputs.SecurityGroupEgressArgs;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.ec2.Subnet;
import com.pulumi.aws.ec2.SubnetArgs;
import com.pulumi.aws.ec2.PlacementGroup;
import com.pulumi.aws.ec2.PlacementGroupArgs;
import com.pulumi.aws.batch.ComputeEnvironment;
import com.pulumi.aws.batch.ComputeEnvironmentArgs;
import com.pulumi.aws.batch.inputs.ComputeEnvironmentComputeResourcesArgs;
import com.pulumi.resources.CustomResourceOptions;
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 ec2AssumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers("ec2.amazonaws.com")
                    .build())
                .actions("sts:AssumeRole")
                .build())
            .build());
        var ecsInstanceRole = new Role("ecsInstanceRole", RoleArgs.builder()
            .name("ecs_instance_role")
            .assumeRolePolicy(ec2AssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());
        var ecsInstanceRoleRolePolicyAttachment = new RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()
            .role(ecsInstanceRole.name())
            .policyArn("arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role")
            .build());
        var ecsInstanceRoleInstanceProfile = new InstanceProfile("ecsInstanceRoleInstanceProfile", InstanceProfileArgs.builder()
            .name("ecs_instance_role")
            .role(ecsInstanceRole.name())
            .build());
        final var batchAssumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers("batch.amazonaws.com")
                    .build())
                .actions("sts:AssumeRole")
                .build())
            .build());
        var awsBatchServiceRole = new Role("awsBatchServiceRole", RoleArgs.builder()
            .name("aws_batch_service_role")
            .assumeRolePolicy(batchAssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());
        var awsBatchServiceRoleRolePolicyAttachment = new RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()
            .role(awsBatchServiceRole.name())
            .policyArn("arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole")
            .build());
        var sample = new SecurityGroup("sample", SecurityGroupArgs.builder()
            .name("aws_batch_compute_environment_security_group")
            .egress(SecurityGroupEgressArgs.builder()
                .fromPort(0)
                .toPort(0)
                .protocol("-1")
                .cidrBlocks("0.0.0.0/0")
                .build())
            .build());
        var sampleVpc = new Vpc("sampleVpc", VpcArgs.builder()
            .cidrBlock("10.1.0.0/16")
            .build());
        var sampleSubnet = new Subnet("sampleSubnet", SubnetArgs.builder()
            .vpcId(sampleVpc.id())
            .cidrBlock("10.1.1.0/24")
            .build());
        var samplePlacementGroup = new PlacementGroup("samplePlacementGroup", PlacementGroupArgs.builder()
            .name("sample")
            .strategy("cluster")
            .build());
        var sampleComputeEnvironment = new ComputeEnvironment("sampleComputeEnvironment", ComputeEnvironmentArgs.builder()
            .computeEnvironmentName("sample")
            .computeResources(ComputeEnvironmentComputeResourcesArgs.builder()
                .instanceRole(ecsInstanceRoleInstanceProfile.arn())
                .instanceTypes("c4.large")
                .maxVcpus(16)
                .minVcpus(0)
                .placementGroup(samplePlacementGroup.name())
                .securityGroupIds(sample.id())
                .subnets(sampleSubnet.id())
                .type("EC2")
                .build())
            .serviceRole(awsBatchServiceRole.arn())
            .type("MANAGED")
            .build(), CustomResourceOptions.builder()
                .dependsOn(awsBatchServiceRoleRolePolicyAttachment)
                .build());
    }
}
resources:
  ecsInstanceRole:
    type: aws:iam:Role
    name: ecs_instance_role
    properties:
      name: ecs_instance_role
      assumeRolePolicy: ${ec2AssumeRole.json}
  ecsInstanceRoleRolePolicyAttachment:
    type: aws:iam:RolePolicyAttachment
    name: ecs_instance_role
    properties:
      role: ${ecsInstanceRole.name}
      policyArn: arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
  ecsInstanceRoleInstanceProfile:
    type: aws:iam:InstanceProfile
    name: ecs_instance_role
    properties:
      name: ecs_instance_role
      role: ${ecsInstanceRole.name}
  awsBatchServiceRole:
    type: aws:iam:Role
    name: aws_batch_service_role
    properties:
      name: aws_batch_service_role
      assumeRolePolicy: ${batchAssumeRole.json}
  awsBatchServiceRoleRolePolicyAttachment:
    type: aws:iam:RolePolicyAttachment
    name: aws_batch_service_role
    properties:
      role: ${awsBatchServiceRole.name}
      policyArn: arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole
  sample:
    type: aws:ec2:SecurityGroup
    properties:
      name: aws_batch_compute_environment_security_group
      egress:
        - fromPort: 0
          toPort: 0
          protocol: '-1'
          cidrBlocks:
            - 0.0.0.0/0
  sampleVpc:
    type: aws:ec2:Vpc
    name: sample
    properties:
      cidrBlock: 10.1.0.0/16
  sampleSubnet:
    type: aws:ec2:Subnet
    name: sample
    properties:
      vpcId: ${sampleVpc.id}
      cidrBlock: 10.1.1.0/24
  samplePlacementGroup:
    type: aws:ec2:PlacementGroup
    name: sample
    properties:
      name: sample
      strategy: cluster
  sampleComputeEnvironment:
    type: aws:batch:ComputeEnvironment
    name: sample
    properties:
      computeEnvironmentName: sample
      computeResources:
        instanceRole: ${ecsInstanceRoleInstanceProfile.arn}
        instanceTypes:
          - c4.large
        maxVcpus: 16
        minVcpus: 0
        placementGroup: ${samplePlacementGroup.name}
        securityGroupIds:
          - ${sample.id}
        subnets:
          - ${sampleSubnet.id}
        type: EC2
      serviceRole: ${awsBatchServiceRole.arn}
      type: MANAGED
    options:
      dependsOn:
        - ${awsBatchServiceRoleRolePolicyAttachment}
variables:
  ec2AssumeRole:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - effect: Allow
            principals:
              - type: Service
                identifiers:
                  - ec2.amazonaws.com
            actions:
              - sts:AssumeRole
  batchAssumeRole:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - effect: Allow
            principals:
              - type: Service
                identifiers:
                  - batch.amazonaws.com
            actions:
              - sts:AssumeRole
Fargate Type
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const sample = new aws.batch.ComputeEnvironment("sample", {
    computeEnvironmentName: "sample",
    computeResources: {
        maxVcpus: 16,
        securityGroupIds: [sampleAwsSecurityGroup.id],
        subnets: [sampleAwsSubnet.id],
        type: "FARGATE",
    },
    serviceRole: awsBatchServiceRoleAwsIamRole.arn,
    type: "MANAGED",
}, {
    dependsOn: [awsBatchServiceRole],
});
import pulumi
import pulumi_aws as aws
sample = aws.batch.ComputeEnvironment("sample",
    compute_environment_name="sample",
    compute_resources={
        "max_vcpus": 16,
        "security_group_ids": [sample_aws_security_group["id"]],
        "subnets": [sample_aws_subnet["id"]],
        "type": "FARGATE",
    },
    service_role=aws_batch_service_role_aws_iam_role["arn"],
    type="MANAGED",
    opts = pulumi.ResourceOptions(depends_on=[aws_batch_service_role]))
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.NewComputeEnvironment(ctx, "sample", &batch.ComputeEnvironmentArgs{
			ComputeEnvironmentName: pulumi.String("sample"),
			ComputeResources: &batch.ComputeEnvironmentComputeResourcesArgs{
				MaxVcpus: pulumi.Int(16),
				SecurityGroupIds: pulumi.StringArray{
					sampleAwsSecurityGroup.Id,
				},
				Subnets: pulumi.StringArray{
					sampleAwsSubnet.Id,
				},
				Type: pulumi.String("FARGATE"),
			},
			ServiceRole: pulumi.Any(awsBatchServiceRoleAwsIamRole.Arn),
			Type:        pulumi.String("MANAGED"),
		}, pulumi.DependsOn([]pulumi.Resource{
			awsBatchServiceRole,
		}))
		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 sample = new Aws.Batch.ComputeEnvironment("sample", new()
    {
        ComputeEnvironmentName = "sample",
        ComputeResources = new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesArgs
        {
            MaxVcpus = 16,
            SecurityGroupIds = new[]
            {
                sampleAwsSecurityGroup.Id,
            },
            Subnets = new[]
            {
                sampleAwsSubnet.Id,
            },
            Type = "FARGATE",
        },
        ServiceRole = awsBatchServiceRoleAwsIamRole.Arn,
        Type = "MANAGED",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            awsBatchServiceRole,
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.batch.ComputeEnvironment;
import com.pulumi.aws.batch.ComputeEnvironmentArgs;
import com.pulumi.aws.batch.inputs.ComputeEnvironmentComputeResourcesArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
        var sample = new ComputeEnvironment("sample", ComputeEnvironmentArgs.builder()
            .computeEnvironmentName("sample")
            .computeResources(ComputeEnvironmentComputeResourcesArgs.builder()
                .maxVcpus(16)
                .securityGroupIds(sampleAwsSecurityGroup.id())
                .subnets(sampleAwsSubnet.id())
                .type("FARGATE")
                .build())
            .serviceRole(awsBatchServiceRoleAwsIamRole.arn())
            .type("MANAGED")
            .build(), CustomResourceOptions.builder()
                .dependsOn(awsBatchServiceRole)
                .build());
    }
}
resources:
  sample:
    type: aws:batch:ComputeEnvironment
    properties:
      computeEnvironmentName: sample
      computeResources:
        maxVcpus: 16
        securityGroupIds:
          - ${sampleAwsSecurityGroup.id}
        subnets:
          - ${sampleAwsSubnet.id}
        type: FARGATE
      serviceRole: ${awsBatchServiceRoleAwsIamRole.arn}
      type: MANAGED
    options:
      dependsOn:
        - ${awsBatchServiceRole}
Setting Update Policy
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const sample = new aws.batch.ComputeEnvironment("sample", {
    computeEnvironmentName: "sample",
    computeResources: {
        allocationStrategy: "BEST_FIT_PROGRESSIVE",
        instanceRole: ecsInstance.arn,
        instanceTypes: ["optimal"],
        maxVcpus: 4,
        minVcpus: 0,
        securityGroupIds: [sampleAwsSecurityGroup.id],
        subnets: [sampleAwsSubnet.id],
        type: "EC2",
    },
    updatePolicy: {
        jobExecutionTimeoutMinutes: 30,
        terminateJobsOnUpdate: false,
    },
    type: "MANAGED",
});
import pulumi
import pulumi_aws as aws
sample = aws.batch.ComputeEnvironment("sample",
    compute_environment_name="sample",
    compute_resources={
        "allocation_strategy": "BEST_FIT_PROGRESSIVE",
        "instance_role": ecs_instance["arn"],
        "instance_types": ["optimal"],
        "max_vcpus": 4,
        "min_vcpus": 0,
        "security_group_ids": [sample_aws_security_group["id"]],
        "subnets": [sample_aws_subnet["id"]],
        "type": "EC2",
    },
    update_policy={
        "job_execution_timeout_minutes": 30,
        "terminate_jobs_on_update": False,
    },
    type="MANAGED")
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.NewComputeEnvironment(ctx, "sample", &batch.ComputeEnvironmentArgs{
			ComputeEnvironmentName: pulumi.String("sample"),
			ComputeResources: &batch.ComputeEnvironmentComputeResourcesArgs{
				AllocationStrategy: pulumi.String("BEST_FIT_PROGRESSIVE"),
				InstanceRole:       pulumi.Any(ecsInstance.Arn),
				InstanceTypes: pulumi.StringArray{
					pulumi.String("optimal"),
				},
				MaxVcpus: pulumi.Int(4),
				MinVcpus: pulumi.Int(0),
				SecurityGroupIds: pulumi.StringArray{
					sampleAwsSecurityGroup.Id,
				},
				Subnets: pulumi.StringArray{
					sampleAwsSubnet.Id,
				},
				Type: pulumi.String("EC2"),
			},
			UpdatePolicy: &batch.ComputeEnvironmentUpdatePolicyArgs{
				JobExecutionTimeoutMinutes: pulumi.Int(30),
				TerminateJobsOnUpdate:      pulumi.Bool(false),
			},
			Type: pulumi.String("MANAGED"),
		})
		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 sample = new Aws.Batch.ComputeEnvironment("sample", new()
    {
        ComputeEnvironmentName = "sample",
        ComputeResources = new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesArgs
        {
            AllocationStrategy = "BEST_FIT_PROGRESSIVE",
            InstanceRole = ecsInstance.Arn,
            InstanceTypes = new[]
            {
                "optimal",
            },
            MaxVcpus = 4,
            MinVcpus = 0,
            SecurityGroupIds = new[]
            {
                sampleAwsSecurityGroup.Id,
            },
            Subnets = new[]
            {
                sampleAwsSubnet.Id,
            },
            Type = "EC2",
        },
        UpdatePolicy = new Aws.Batch.Inputs.ComputeEnvironmentUpdatePolicyArgs
        {
            JobExecutionTimeoutMinutes = 30,
            TerminateJobsOnUpdate = false,
        },
        Type = "MANAGED",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.batch.ComputeEnvironment;
import com.pulumi.aws.batch.ComputeEnvironmentArgs;
import com.pulumi.aws.batch.inputs.ComputeEnvironmentComputeResourcesArgs;
import com.pulumi.aws.batch.inputs.ComputeEnvironmentUpdatePolicyArgs;
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) {
        var sample = new ComputeEnvironment("sample", ComputeEnvironmentArgs.builder()
            .computeEnvironmentName("sample")
            .computeResources(ComputeEnvironmentComputeResourcesArgs.builder()
                .allocationStrategy("BEST_FIT_PROGRESSIVE")
                .instanceRole(ecsInstance.arn())
                .instanceTypes("optimal")
                .maxVcpus(4)
                .minVcpus(0)
                .securityGroupIds(sampleAwsSecurityGroup.id())
                .subnets(sampleAwsSubnet.id())
                .type("EC2")
                .build())
            .updatePolicy(ComputeEnvironmentUpdatePolicyArgs.builder()
                .jobExecutionTimeoutMinutes(30)
                .terminateJobsOnUpdate(false)
                .build())
            .type("MANAGED")
            .build());
    }
}
resources:
  sample:
    type: aws:batch:ComputeEnvironment
    properties:
      computeEnvironmentName: sample
      computeResources:
        allocationStrategy: BEST_FIT_PROGRESSIVE
        instanceRole: ${ecsInstance.arn}
        instanceTypes:
          - optimal
        maxVcpus: 4
        minVcpus: 0
        securityGroupIds:
          - ${sampleAwsSecurityGroup.id}
        subnets:
          - ${sampleAwsSubnet.id}
        type: EC2
      updatePolicy:
        jobExecutionTimeoutMinutes: 30
        terminateJobsOnUpdate: false
      type: MANAGED
Create ComputeEnvironment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ComputeEnvironment(name: string, args: ComputeEnvironmentArgs, opts?: CustomResourceOptions);@overload
def ComputeEnvironment(resource_name: str,
                       args: ComputeEnvironmentArgs,
                       opts: Optional[ResourceOptions] = None)
@overload
def ComputeEnvironment(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       type: Optional[str] = None,
                       compute_environment_name: Optional[str] = None,
                       compute_environment_name_prefix: Optional[str] = None,
                       compute_resources: Optional[ComputeEnvironmentComputeResourcesArgs] = None,
                       eks_configuration: Optional[ComputeEnvironmentEksConfigurationArgs] = None,
                       service_role: Optional[str] = None,
                       state: Optional[str] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       update_policy: Optional[ComputeEnvironmentUpdatePolicyArgs] = None)func NewComputeEnvironment(ctx *Context, name string, args ComputeEnvironmentArgs, opts ...ResourceOption) (*ComputeEnvironment, error)public ComputeEnvironment(string name, ComputeEnvironmentArgs args, CustomResourceOptions? opts = null)
public ComputeEnvironment(String name, ComputeEnvironmentArgs args)
public ComputeEnvironment(String name, ComputeEnvironmentArgs args, CustomResourceOptions options)
type: aws:batch:ComputeEnvironment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ComputeEnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ComputeEnvironmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ComputeEnvironmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeEnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComputeEnvironmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var computeEnvironmentResource = new Aws.Batch.ComputeEnvironment("computeEnvironmentResource", new()
{
    Type = "string",
    ComputeEnvironmentName = "string",
    ComputeEnvironmentNamePrefix = "string",
    ComputeResources = new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesArgs
    {
        MaxVcpus = 0,
        Type = "string",
        Subnets = new[]
        {
            "string",
        },
        LaunchTemplate = new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesLaunchTemplateArgs
        {
            LaunchTemplateId = "string",
            LaunchTemplateName = "string",
            Version = "string",
        },
        MinVcpus = 0,
        ImageId = "string",
        InstanceRole = "string",
        InstanceTypes = new[]
        {
            "string",
        },
        AllocationStrategy = "string",
        Ec2Configurations = new[]
        {
            new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesEc2ConfigurationArgs
            {
                ImageIdOverride = "string",
                ImageType = "string",
            },
        },
        Ec2KeyPair = "string",
        PlacementGroup = "string",
        SecurityGroupIds = new[]
        {
            "string",
        },
        SpotIamFleetRole = "string",
        DesiredVcpus = 0,
        Tags = 
        {
            { "string", "string" },
        },
        BidPercentage = 0,
    },
    EksConfiguration = new Aws.Batch.Inputs.ComputeEnvironmentEksConfigurationArgs
    {
        EksClusterArn = "string",
        KubernetesNamespace = "string",
    },
    ServiceRole = "string",
    State = "string",
    Tags = 
    {
        { "string", "string" },
    },
    UpdatePolicy = new Aws.Batch.Inputs.ComputeEnvironmentUpdatePolicyArgs
    {
        JobExecutionTimeoutMinutes = 0,
        TerminateJobsOnUpdate = false,
    },
});
example, err := batch.NewComputeEnvironment(ctx, "computeEnvironmentResource", &batch.ComputeEnvironmentArgs{
	Type:                         pulumi.String("string"),
	ComputeEnvironmentName:       pulumi.String("string"),
	ComputeEnvironmentNamePrefix: pulumi.String("string"),
	ComputeResources: &batch.ComputeEnvironmentComputeResourcesArgs{
		MaxVcpus: pulumi.Int(0),
		Type:     pulumi.String("string"),
		Subnets: pulumi.StringArray{
			pulumi.String("string"),
		},
		LaunchTemplate: &batch.ComputeEnvironmentComputeResourcesLaunchTemplateArgs{
			LaunchTemplateId:   pulumi.String("string"),
			LaunchTemplateName: pulumi.String("string"),
			Version:            pulumi.String("string"),
		},
		MinVcpus:     pulumi.Int(0),
		ImageId:      pulumi.String("string"),
		InstanceRole: pulumi.String("string"),
		InstanceTypes: pulumi.StringArray{
			pulumi.String("string"),
		},
		AllocationStrategy: pulumi.String("string"),
		Ec2Configurations: batch.ComputeEnvironmentComputeResourcesEc2ConfigurationArray{
			&batch.ComputeEnvironmentComputeResourcesEc2ConfigurationArgs{
				ImageIdOverride: pulumi.String("string"),
				ImageType:       pulumi.String("string"),
			},
		},
		Ec2KeyPair:     pulumi.String("string"),
		PlacementGroup: pulumi.String("string"),
		SecurityGroupIds: pulumi.StringArray{
			pulumi.String("string"),
		},
		SpotIamFleetRole: pulumi.String("string"),
		DesiredVcpus:     pulumi.Int(0),
		Tags: pulumi.StringMap{
			"string": pulumi.String("string"),
		},
		BidPercentage: pulumi.Int(0),
	},
	EksConfiguration: &batch.ComputeEnvironmentEksConfigurationArgs{
		EksClusterArn:       pulumi.String("string"),
		KubernetesNamespace: pulumi.String("string"),
	},
	ServiceRole: pulumi.String("string"),
	State:       pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	UpdatePolicy: &batch.ComputeEnvironmentUpdatePolicyArgs{
		JobExecutionTimeoutMinutes: pulumi.Int(0),
		TerminateJobsOnUpdate:      pulumi.Bool(false),
	},
})
var computeEnvironmentResource = new ComputeEnvironment("computeEnvironmentResource", ComputeEnvironmentArgs.builder()
    .type("string")
    .computeEnvironmentName("string")
    .computeEnvironmentNamePrefix("string")
    .computeResources(ComputeEnvironmentComputeResourcesArgs.builder()
        .maxVcpus(0)
        .type("string")
        .subnets("string")
        .launchTemplate(ComputeEnvironmentComputeResourcesLaunchTemplateArgs.builder()
            .launchTemplateId("string")
            .launchTemplateName("string")
            .version("string")
            .build())
        .minVcpus(0)
        .imageId("string")
        .instanceRole("string")
        .instanceTypes("string")
        .allocationStrategy("string")
        .ec2Configurations(ComputeEnvironmentComputeResourcesEc2ConfigurationArgs.builder()
            .imageIdOverride("string")
            .imageType("string")
            .build())
        .ec2KeyPair("string")
        .placementGroup("string")
        .securityGroupIds("string")
        .spotIamFleetRole("string")
        .desiredVcpus(0)
        .tags(Map.of("string", "string"))
        .bidPercentage(0)
        .build())
    .eksConfiguration(ComputeEnvironmentEksConfigurationArgs.builder()
        .eksClusterArn("string")
        .kubernetesNamespace("string")
        .build())
    .serviceRole("string")
    .state("string")
    .tags(Map.of("string", "string"))
    .updatePolicy(ComputeEnvironmentUpdatePolicyArgs.builder()
        .jobExecutionTimeoutMinutes(0)
        .terminateJobsOnUpdate(false)
        .build())
    .build());
compute_environment_resource = aws.batch.ComputeEnvironment("computeEnvironmentResource",
    type="string",
    compute_environment_name="string",
    compute_environment_name_prefix="string",
    compute_resources={
        "max_vcpus": 0,
        "type": "string",
        "subnets": ["string"],
        "launch_template": {
            "launch_template_id": "string",
            "launch_template_name": "string",
            "version": "string",
        },
        "min_vcpus": 0,
        "image_id": "string",
        "instance_role": "string",
        "instance_types": ["string"],
        "allocation_strategy": "string",
        "ec2_configurations": [{
            "image_id_override": "string",
            "image_type": "string",
        }],
        "ec2_key_pair": "string",
        "placement_group": "string",
        "security_group_ids": ["string"],
        "spot_iam_fleet_role": "string",
        "desired_vcpus": 0,
        "tags": {
            "string": "string",
        },
        "bid_percentage": 0,
    },
    eks_configuration={
        "eks_cluster_arn": "string",
        "kubernetes_namespace": "string",
    },
    service_role="string",
    state="string",
    tags={
        "string": "string",
    },
    update_policy={
        "job_execution_timeout_minutes": 0,
        "terminate_jobs_on_update": False,
    })
const computeEnvironmentResource = new aws.batch.ComputeEnvironment("computeEnvironmentResource", {
    type: "string",
    computeEnvironmentName: "string",
    computeEnvironmentNamePrefix: "string",
    computeResources: {
        maxVcpus: 0,
        type: "string",
        subnets: ["string"],
        launchTemplate: {
            launchTemplateId: "string",
            launchTemplateName: "string",
            version: "string",
        },
        minVcpus: 0,
        imageId: "string",
        instanceRole: "string",
        instanceTypes: ["string"],
        allocationStrategy: "string",
        ec2Configurations: [{
            imageIdOverride: "string",
            imageType: "string",
        }],
        ec2KeyPair: "string",
        placementGroup: "string",
        securityGroupIds: ["string"],
        spotIamFleetRole: "string",
        desiredVcpus: 0,
        tags: {
            string: "string",
        },
        bidPercentage: 0,
    },
    eksConfiguration: {
        eksClusterArn: "string",
        kubernetesNamespace: "string",
    },
    serviceRole: "string",
    state: "string",
    tags: {
        string: "string",
    },
    updatePolicy: {
        jobExecutionTimeoutMinutes: 0,
        terminateJobsOnUpdate: false,
    },
});
type: aws:batch:ComputeEnvironment
properties:
    computeEnvironmentName: string
    computeEnvironmentNamePrefix: string
    computeResources:
        allocationStrategy: string
        bidPercentage: 0
        desiredVcpus: 0
        ec2Configurations:
            - imageIdOverride: string
              imageType: string
        ec2KeyPair: string
        imageId: string
        instanceRole: string
        instanceTypes:
            - string
        launchTemplate:
            launchTemplateId: string
            launchTemplateName: string
            version: string
        maxVcpus: 0
        minVcpus: 0
        placementGroup: string
        securityGroupIds:
            - string
        spotIamFleetRole: string
        subnets:
            - string
        tags:
            string: string
        type: string
    eksConfiguration:
        eksClusterArn: string
        kubernetesNamespace: string
    serviceRole: string
    state: string
    tags:
        string: string
    type: string
    updatePolicy:
        jobExecutionTimeoutMinutes: 0
        terminateJobsOnUpdate: false
ComputeEnvironment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ComputeEnvironment resource accepts the following input properties:
- Type string
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- ComputeEnvironment stringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- ComputeEnvironment stringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- ComputeResources ComputeEnvironment Compute Resources 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- EksConfiguration ComputeEnvironment Eks Configuration 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- ServiceRole string
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- State string
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- UpdatePolicy ComputeEnvironment Update Policy 
- Specifies the infrastructure update policy for the compute environment. See details below.
- Type string
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- ComputeEnvironment stringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- ComputeEnvironment stringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- ComputeResources ComputeEnvironment Compute Resources Args 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- EksConfiguration ComputeEnvironment Eks Configuration Args 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- ServiceRole string
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- State string
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- map[string]string
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- UpdatePolicy ComputeEnvironment Update Policy Args 
- Specifies the infrastructure update policy for the compute environment. See details below.
- type String
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- computeEnvironment StringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- computeEnvironment StringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- computeResources ComputeEnvironment Compute Resources 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- eksConfiguration ComputeEnvironment Eks Configuration 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- serviceRole String
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state String
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Map<String,String>
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- updatePolicy ComputeEnvironment Update Policy 
- Specifies the infrastructure update policy for the compute environment. See details below.
- type string
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- computeEnvironment stringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- computeEnvironment stringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- computeResources ComputeEnvironment Compute Resources 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- eksConfiguration ComputeEnvironment Eks Configuration 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- serviceRole string
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state string
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- {[key: string]: string}
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- updatePolicy ComputeEnvironment Update Policy 
- Specifies the infrastructure update policy for the compute environment. See details below.
- type str
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- compute_environment_ strname 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- compute_environment_ strname_ prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- compute_resources ComputeEnvironment Compute Resources Args 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- eks_configuration ComputeEnvironment Eks Configuration Args 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- service_role str
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state str
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Mapping[str, str]
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- update_policy ComputeEnvironment Update Policy Args 
- Specifies the infrastructure update policy for the compute environment. See details below.
- type String
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- computeEnvironment StringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- computeEnvironment StringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- computeResources Property Map
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- eksConfiguration Property Map
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- serviceRole String
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state String
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Map<String>
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- updatePolicy Property Map
- Specifies the infrastructure update policy for the compute environment. See details below.
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeEnvironment resource produces the following output properties:
- Arn string
- The Amazon Resource Name (ARN) of the compute environment.
- EcsCluster stringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The current status of the compute environment (for example, CREATING or VALID).
- StatusReason string
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Arn string
- The Amazon Resource Name (ARN) of the compute environment.
- EcsCluster stringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The current status of the compute environment (for example, CREATING or VALID).
- StatusReason string
- A short, human-readable string to provide additional details about the current status of the compute environment.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- The Amazon Resource Name (ARN) of the compute environment.
- ecsCluster StringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The current status of the compute environment (for example, CREATING or VALID).
- statusReason String
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn string
- The Amazon Resource Name (ARN) of the compute environment.
- ecsCluster stringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The current status of the compute environment (for example, CREATING or VALID).
- statusReason string
- A short, human-readable string to provide additional details about the current status of the compute environment.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn str
- The Amazon Resource Name (ARN) of the compute environment.
- ecs_cluster_ strarn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The current status of the compute environment (for example, CREATING or VALID).
- status_reason str
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- arn String
- The Amazon Resource Name (ARN) of the compute environment.
- ecsCluster StringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The current status of the compute environment (for example, CREATING or VALID).
- statusReason String
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
Look up Existing ComputeEnvironment Resource
Get an existing ComputeEnvironment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ComputeEnvironmentState, opts?: CustomResourceOptions): ComputeEnvironment@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        compute_environment_name: Optional[str] = None,
        compute_environment_name_prefix: Optional[str] = None,
        compute_resources: Optional[ComputeEnvironmentComputeResourcesArgs] = None,
        ecs_cluster_arn: Optional[str] = None,
        eks_configuration: Optional[ComputeEnvironmentEksConfigurationArgs] = None,
        service_role: Optional[str] = None,
        state: Optional[str] = None,
        status: Optional[str] = None,
        status_reason: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        type: Optional[str] = None,
        update_policy: Optional[ComputeEnvironmentUpdatePolicyArgs] = None) -> ComputeEnvironmentfunc GetComputeEnvironment(ctx *Context, name string, id IDInput, state *ComputeEnvironmentState, opts ...ResourceOption) (*ComputeEnvironment, error)public static ComputeEnvironment Get(string name, Input<string> id, ComputeEnvironmentState? state, CustomResourceOptions? opts = null)public static ComputeEnvironment get(String name, Output<String> id, ComputeEnvironmentState state, CustomResourceOptions options)resources:  _:    type: aws:batch:ComputeEnvironment    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- The Amazon Resource Name (ARN) of the compute environment.
- ComputeEnvironment stringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- ComputeEnvironment stringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- ComputeResources ComputeEnvironment Compute Resources 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- EcsCluster stringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- EksConfiguration ComputeEnvironment Eks Configuration 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- ServiceRole string
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- State string
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Status string
- The current status of the compute environment (for example, CREATING or VALID).
- StatusReason string
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Type string
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- UpdatePolicy ComputeEnvironment Update Policy 
- Specifies the infrastructure update policy for the compute environment. See details below.
- Arn string
- The Amazon Resource Name (ARN) of the compute environment.
- ComputeEnvironment stringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- ComputeEnvironment stringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- ComputeResources ComputeEnvironment Compute Resources Args 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- EcsCluster stringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- EksConfiguration ComputeEnvironment Eks Configuration Args 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- ServiceRole string
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- State string
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Status string
- The current status of the compute environment (for example, CREATING or VALID).
- StatusReason string
- A short, human-readable string to provide additional details about the current status of the compute environment.
- map[string]string
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Type string
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- UpdatePolicy ComputeEnvironment Update Policy Args 
- Specifies the infrastructure update policy for the compute environment. See details below.
- arn String
- The Amazon Resource Name (ARN) of the compute environment.
- computeEnvironment StringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- computeEnvironment StringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- computeResources ComputeEnvironment Compute Resources 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- ecsCluster StringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- eksConfiguration ComputeEnvironment Eks Configuration 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- serviceRole String
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state String
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- status String
- The current status of the compute environment (for example, CREATING or VALID).
- statusReason String
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Map<String,String>
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- type String
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- updatePolicy ComputeEnvironment Update Policy 
- Specifies the infrastructure update policy for the compute environment. See details below.
- arn string
- The Amazon Resource Name (ARN) of the compute environment.
- computeEnvironment stringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- computeEnvironment stringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- computeResources ComputeEnvironment Compute Resources 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- ecsCluster stringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- eksConfiguration ComputeEnvironment Eks Configuration 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- serviceRole string
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state string
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- status string
- The current status of the compute environment (for example, CREATING or VALID).
- statusReason string
- A short, human-readable string to provide additional details about the current status of the compute environment.
- {[key: string]: string}
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- type string
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- updatePolicy ComputeEnvironment Update Policy 
- Specifies the infrastructure update policy for the compute environment. See details below.
- arn str
- The Amazon Resource Name (ARN) of the compute environment.
- compute_environment_ strname 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- compute_environment_ strname_ prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- compute_resources ComputeEnvironment Compute Resources Args 
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- ecs_cluster_ strarn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- eks_configuration ComputeEnvironment Eks Configuration Args 
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- service_role str
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state str
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- status str
- The current status of the compute environment (for example, CREATING or VALID).
- status_reason str
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Mapping[str, str]
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- type str
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- update_policy ComputeEnvironment Update Policy Args 
- Specifies the infrastructure update policy for the compute environment. See details below.
- arn String
- The Amazon Resource Name (ARN) of the compute environment.
- computeEnvironment StringName 
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, the provider will assign a random, unique name.
- computeEnvironment StringName Prefix 
- Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
- computeResources Property Map
- Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- ecsCluster StringArn 
- The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- eksConfiguration Property Map
- Details for the Amazon EKS cluster that supports the compute environment. See details below.
- serviceRole String
- The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state String
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- status String
- The current status of the compute environment (for example, CREATING or VALID).
- statusReason String
- A short, human-readable string to provide additional details about the current status of the compute environment.
- Map<String>
- Key-value map of resource tags. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- type String
- The type of the compute environment. Valid items are MANAGEDorUNMANAGED.
- updatePolicy Property Map
- Specifies the infrastructure update policy for the compute environment. See details below.
Supporting Types
ComputeEnvironmentComputeResources, ComputeEnvironmentComputeResourcesArgs        
- MaxVcpus int
- The maximum number of EC2 vCPUs that an environment can reach.
- Subnets List<string>
- A list of VPC subnets into which the compute resources are launched.
- Type string
- The type of compute environment. Valid items are EC2,SPOT,FARGATEorFARGATE_SPOT.
- AllocationStrategy string
- The allocation strategy to use for the compute resource in case not enough instances of the best fitting instance type can be allocated. For valid values, refer to the AWS documentation. Defaults to BEST_FIT. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- BidPercentage int
- Integer of maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. If you leave this field empty, the default value is 100% of the On-Demand price. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- DesiredVcpus int
- The desired number of EC2 vCPUS in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- Ec2Configurations
List<ComputeEnvironment Compute Resources Ec2Configuration> 
- Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2. This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
- Ec2KeyPair string
- The EC2 key pair that is used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- ImageId string
- The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified. (Deprecated, use ec2_configurationimage_id_overrideinstead)
- InstanceRole string
- The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- InstanceTypes List<string>
- A list of instance types that may be launched. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- LaunchTemplate ComputeEnvironment Compute Resources Launch Template 
- The launch template to use for your compute resources. See details below. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- MinVcpus int
- The minimum number of EC2 vCPUs that an environment should maintain. For EC2orSPOTcompute environments, if the parameter is not explicitly defined, a0default value will be set. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- PlacementGroup string
- The Amazon EC2 placement group to associate with your compute resources.
- SecurityGroup List<string>Ids 
- A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
- SpotIam stringFleet Role 
- The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- Dictionary<string, string>
- Key-value pair tags to be applied to resources that are launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- MaxVcpus int
- The maximum number of EC2 vCPUs that an environment can reach.
- Subnets []string
- A list of VPC subnets into which the compute resources are launched.
- Type string
- The type of compute environment. Valid items are EC2,SPOT,FARGATEorFARGATE_SPOT.
- AllocationStrategy string
- The allocation strategy to use for the compute resource in case not enough instances of the best fitting instance type can be allocated. For valid values, refer to the AWS documentation. Defaults to BEST_FIT. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- BidPercentage int
- Integer of maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. If you leave this field empty, the default value is 100% of the On-Demand price. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- DesiredVcpus int
- The desired number of EC2 vCPUS in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- Ec2Configurations
[]ComputeEnvironment Compute Resources Ec2Configuration 
- Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2. This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
- Ec2KeyPair string
- The EC2 key pair that is used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- ImageId string
- The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified. (Deprecated, use ec2_configurationimage_id_overrideinstead)
- InstanceRole string
- The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- InstanceTypes []string
- A list of instance types that may be launched. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- LaunchTemplate ComputeEnvironment Compute Resources Launch Template 
- The launch template to use for your compute resources. See details below. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- MinVcpus int
- The minimum number of EC2 vCPUs that an environment should maintain. For EC2orSPOTcompute environments, if the parameter is not explicitly defined, a0default value will be set. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- PlacementGroup string
- The Amazon EC2 placement group to associate with your compute resources.
- SecurityGroup []stringIds 
- A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
- SpotIam stringFleet Role 
- The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- map[string]string
- Key-value pair tags to be applied to resources that are launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- maxVcpus Integer
- The maximum number of EC2 vCPUs that an environment can reach.
- subnets List<String>
- A list of VPC subnets into which the compute resources are launched.
- type String
- The type of compute environment. Valid items are EC2,SPOT,FARGATEorFARGATE_SPOT.
- allocationStrategy String
- The allocation strategy to use for the compute resource in case not enough instances of the best fitting instance type can be allocated. For valid values, refer to the AWS documentation. Defaults to BEST_FIT. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- bidPercentage Integer
- Integer of maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. If you leave this field empty, the default value is 100% of the On-Demand price. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- desiredVcpus Integer
- The desired number of EC2 vCPUS in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- ec2Configurations
List<ComputeEnvironment Compute Resources Ec2Configuration> 
- Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2. This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
- ec2KeyPair String
- The EC2 key pair that is used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- imageId String
- The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified. (Deprecated, use ec2_configurationimage_id_overrideinstead)
- instanceRole String
- The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- instanceTypes List<String>
- A list of instance types that may be launched. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- launchTemplate ComputeEnvironment Compute Resources Launch Template 
- The launch template to use for your compute resources. See details below. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- minVcpus Integer
- The minimum number of EC2 vCPUs that an environment should maintain. For EC2orSPOTcompute environments, if the parameter is not explicitly defined, a0default value will be set. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- placementGroup String
- The Amazon EC2 placement group to associate with your compute resources.
- securityGroup List<String>Ids 
- A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
- spotIam StringFleet Role 
- The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- Map<String,String>
- Key-value pair tags to be applied to resources that are launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- maxVcpus number
- The maximum number of EC2 vCPUs that an environment can reach.
- subnets string[]
- A list of VPC subnets into which the compute resources are launched.
- type string
- The type of compute environment. Valid items are EC2,SPOT,FARGATEorFARGATE_SPOT.
- allocationStrategy string
- The allocation strategy to use for the compute resource in case not enough instances of the best fitting instance type can be allocated. For valid values, refer to the AWS documentation. Defaults to BEST_FIT. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- bidPercentage number
- Integer of maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. If you leave this field empty, the default value is 100% of the On-Demand price. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- desiredVcpus number
- The desired number of EC2 vCPUS in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- ec2Configurations
ComputeEnvironment Compute Resources Ec2Configuration[] 
- Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2. This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
- ec2KeyPair string
- The EC2 key pair that is used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- imageId string
- The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified. (Deprecated, use ec2_configurationimage_id_overrideinstead)
- instanceRole string
- The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- instanceTypes string[]
- A list of instance types that may be launched. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- launchTemplate ComputeEnvironment Compute Resources Launch Template 
- The launch template to use for your compute resources. See details below. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- minVcpus number
- The minimum number of EC2 vCPUs that an environment should maintain. For EC2orSPOTcompute environments, if the parameter is not explicitly defined, a0default value will be set. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- placementGroup string
- The Amazon EC2 placement group to associate with your compute resources.
- securityGroup string[]Ids 
- A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
- spotIam stringFleet Role 
- The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- {[key: string]: string}
- Key-value pair tags to be applied to resources that are launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- max_vcpus int
- The maximum number of EC2 vCPUs that an environment can reach.
- subnets Sequence[str]
- A list of VPC subnets into which the compute resources are launched.
- type str
- The type of compute environment. Valid items are EC2,SPOT,FARGATEorFARGATE_SPOT.
- allocation_strategy str
- The allocation strategy to use for the compute resource in case not enough instances of the best fitting instance type can be allocated. For valid values, refer to the AWS documentation. Defaults to BEST_FIT. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- bid_percentage int
- Integer of maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. If you leave this field empty, the default value is 100% of the On-Demand price. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- desired_vcpus int
- The desired number of EC2 vCPUS in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- ec2_configurations Sequence[ComputeEnvironment Compute Resources Ec2Configuration] 
- Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2. This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
- ec2_key_ strpair 
- The EC2 key pair that is used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- image_id str
- The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified. (Deprecated, use ec2_configurationimage_id_overrideinstead)
- instance_role str
- The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- instance_types Sequence[str]
- A list of instance types that may be launched. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- launch_template ComputeEnvironment Compute Resources Launch Template 
- The launch template to use for your compute resources. See details below. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- min_vcpus int
- The minimum number of EC2 vCPUs that an environment should maintain. For EC2orSPOTcompute environments, if the parameter is not explicitly defined, a0default value will be set. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- placement_group str
- The Amazon EC2 placement group to associate with your compute resources.
- security_group_ Sequence[str]ids 
- A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
- spot_iam_ strfleet_ role 
- The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- Mapping[str, str]
- Key-value pair tags to be applied to resources that are launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- maxVcpus Number
- The maximum number of EC2 vCPUs that an environment can reach.
- subnets List<String>
- A list of VPC subnets into which the compute resources are launched.
- type String
- The type of compute environment. Valid items are EC2,SPOT,FARGATEorFARGATE_SPOT.
- allocationStrategy String
- The allocation strategy to use for the compute resource in case not enough instances of the best fitting instance type can be allocated. For valid values, refer to the AWS documentation. Defaults to BEST_FIT. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- bidPercentage Number
- Integer of maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your bid percentage is 20% (20), then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. If you leave this field empty, the default value is 100% of the On-Demand price. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- desiredVcpus Number
- The desired number of EC2 vCPUS in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- ec2Configurations List<Property Map>
- Provides information used to select Amazon Machine Images (AMIs) for EC2 instances in the compute environment. If Ec2Configuration isn't specified, the default is ECS_AL2. This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
- ec2KeyPair String
- The EC2 key pair that is used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- imageId String
- The Amazon Machine Image (AMI) ID used for instances launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified. (Deprecated, use ec2_configurationimage_id_overrideinstead)
- instanceRole String
- The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- instanceTypes List<String>
- A list of instance types that may be launched. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- launchTemplate Property Map
- The launch template to use for your compute resources. See details below. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- minVcpus Number
- The minimum number of EC2 vCPUs that an environment should maintain. For EC2orSPOTcompute environments, if the parameter is not explicitly defined, a0default value will be set. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- placementGroup String
- The Amazon EC2 placement group to associate with your compute resources.
- securityGroup List<String>Ids 
- A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
- spotIam StringFleet Role 
- The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
- Map<String>
- Key-value pair tags to be applied to resources that are launched in the compute environment. This parameter isn't applicable to jobs running on Fargate resources, and shouldn't be specified.
ComputeEnvironmentComputeResourcesEc2Configuration, ComputeEnvironmentComputeResourcesEc2ConfigurationArgs          
- ImageId stringOverride 
- The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_idargument in thecompute_resourcesblock.
- ImageType string
- The image type to match with the instance type to select an AMI. If the image_id_overrideparameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
- ImageId stringOverride 
- The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_idargument in thecompute_resourcesblock.
- ImageType string
- The image type to match with the instance type to select an AMI. If the image_id_overrideparameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
- imageId StringOverride 
- The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_idargument in thecompute_resourcesblock.
- imageType String
- The image type to match with the instance type to select an AMI. If the image_id_overrideparameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
- imageId stringOverride 
- The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_idargument in thecompute_resourcesblock.
- imageType string
- The image type to match with the instance type to select an AMI. If the image_id_overrideparameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
- image_id_ stroverride 
- The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_idargument in thecompute_resourcesblock.
- image_type str
- The image type to match with the instance type to select an AMI. If the image_id_overrideparameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
- imageId StringOverride 
- The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_idargument in thecompute_resourcesblock.
- imageType String
- The image type to match with the instance type to select an AMI. If the image_id_overrideparameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
ComputeEnvironmentComputeResourcesLaunchTemplate, ComputeEnvironmentComputeResourcesLaunchTemplateArgs            
- LaunchTemplate stringId 
- ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- LaunchTemplate stringName 
- Name of the launch template.
- Version string
- The version number of the launch template. Default: The default version of the launch template.
- LaunchTemplate stringId 
- ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- LaunchTemplate stringName 
- Name of the launch template.
- Version string
- The version number of the launch template. Default: The default version of the launch template.
- launchTemplate StringId 
- ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- launchTemplate StringName 
- Name of the launch template.
- version String
- The version number of the launch template. Default: The default version of the launch template.
- launchTemplate stringId 
- ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- launchTemplate stringName 
- Name of the launch template.
- version string
- The version number of the launch template. Default: The default version of the launch template.
- launch_template_ strid 
- ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- launch_template_ strname 
- Name of the launch template.
- version str
- The version number of the launch template. Default: The default version of the launch template.
- launchTemplate StringId 
- ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- launchTemplate StringName 
- Name of the launch template.
- version String
- The version number of the launch template. Default: The default version of the launch template.
ComputeEnvironmentEksConfiguration, ComputeEnvironmentEksConfigurationArgs        
- EksCluster stringArn 
- The Amazon Resource Name (ARN) of the Amazon EKS cluster.
- KubernetesNamespace string
- The namespace of the Amazon EKS cluster. AWS Batch manages pods in this namespace.
- EksCluster stringArn 
- The Amazon Resource Name (ARN) of the Amazon EKS cluster.
- KubernetesNamespace string
- The namespace of the Amazon EKS cluster. AWS Batch manages pods in this namespace.
- eksCluster StringArn 
- The Amazon Resource Name (ARN) of the Amazon EKS cluster.
- kubernetesNamespace String
- The namespace of the Amazon EKS cluster. AWS Batch manages pods in this namespace.
- eksCluster stringArn 
- The Amazon Resource Name (ARN) of the Amazon EKS cluster.
- kubernetesNamespace string
- The namespace of the Amazon EKS cluster. AWS Batch manages pods in this namespace.
- eks_cluster_ strarn 
- The Amazon Resource Name (ARN) of the Amazon EKS cluster.
- kubernetes_namespace str
- The namespace of the Amazon EKS cluster. AWS Batch manages pods in this namespace.
- eksCluster StringArn 
- The Amazon Resource Name (ARN) of the Amazon EKS cluster.
- kubernetesNamespace String
- The namespace of the Amazon EKS cluster. AWS Batch manages pods in this namespace.
ComputeEnvironmentUpdatePolicy, ComputeEnvironmentUpdatePolicyArgs        
- JobExecution intTimeout Minutes 
- Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
- TerminateJobs boolOn Update 
- Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
- JobExecution intTimeout Minutes 
- Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
- TerminateJobs boolOn Update 
- Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
- jobExecution IntegerTimeout Minutes 
- Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
- terminateJobs BooleanOn Update 
- Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
- jobExecution numberTimeout Minutes 
- Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
- terminateJobs booleanOn Update 
- Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
- job_execution_ inttimeout_ minutes 
- Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
- terminate_jobs_ boolon_ update 
- Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
- jobExecution NumberTimeout Minutes 
- Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
- terminateJobs BooleanOn Update 
- Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
Import
Using pulumi import, import AWS Batch compute using the compute_environment_name. For example:
$ pulumi import aws:batch/computeEnvironment:ComputeEnvironment sample sample
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.