1. Packages
  2. AWS Classic
  3. API Docs
  4. batch
  5. ComputeEnvironment

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.22.2 published on Friday, Feb 16, 2024 by Pulumi

aws.batch.ComputeEnvironment

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.22.2 published on Friday, Feb 16, 2024 by Pulumi

    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_on to the related aws.iam.RolePolicyAttachment; otherwise, the policy may be destroyed too soon and the compute environment will then get stuck in the DELETING state, see Troubleshooting AWS Batch .

    Example Usage

    EC2 Type

    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 ecsInstanceRoleRole = new Aws.Iam.Role("ecsInstanceRoleRole", new()
        {
            AssumeRolePolicy = ec2AssumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        });
    
        var ecsInstanceRoleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment", new()
        {
            Role = ecsInstanceRoleRole.Name,
            PolicyArn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
        });
    
        var ecsInstanceRoleInstanceProfile = new Aws.Iam.InstanceProfile("ecsInstanceRoleInstanceProfile", new()
        {
            Role = ecsInstanceRoleRole.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 awsBatchServiceRoleRole = new Aws.Iam.Role("awsBatchServiceRoleRole", new()
        {
            AssumeRolePolicy = batchAssumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
        });
    
        var awsBatchServiceRoleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment", new()
        {
            Role = awsBatchServiceRoleRole.Name,
            PolicyArn = "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
        });
    
        var sampleSecurityGroup = new Aws.Ec2.SecurityGroup("sampleSecurityGroup", new()
        {
            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("sampleVpc", new()
        {
            CidrBlock = "10.1.0.0/16",
        });
    
        var sampleSubnet = new Aws.Ec2.Subnet("sampleSubnet", new()
        {
            VpcId = sampleVpc.Id,
            CidrBlock = "10.1.1.0/24",
        });
    
        var samplePlacementGroup = new Aws.Ec2.PlacementGroup("samplePlacementGroup", new()
        {
            Strategy = "cluster",
        });
    
        var sampleComputeEnvironment = new Aws.Batch.ComputeEnvironment("sampleComputeEnvironment", 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[]
                {
                    sampleSecurityGroup.Id,
                },
                Subnets = new[]
                {
                    sampleSubnet.Id,
                },
                Type = "EC2",
            },
            ServiceRole = awsBatchServiceRoleRole.Arn,
            Type = "MANAGED",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                awsBatchServiceRoleRolePolicyAttachment,
            },
        });
    
    });
    
    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
    		}
    		ecsInstanceRoleRole, err := iam.NewRole(ctx, "ecsInstanceRoleRole", &iam.RoleArgs{
    			AssumeRolePolicy: *pulumi.String(ec2AssumeRole.Json),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = iam.NewRolePolicyAttachment(ctx, "ecsInstanceRoleRolePolicyAttachment", &iam.RolePolicyAttachmentArgs{
    			Role:      ecsInstanceRoleRole.Name,
    			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"),
    		})
    		if err != nil {
    			return err
    		}
    		ecsInstanceRoleInstanceProfile, err := iam.NewInstanceProfile(ctx, "ecsInstanceRoleInstanceProfile", &iam.InstanceProfileArgs{
    			Role: ecsInstanceRoleRole.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
    		}
    		awsBatchServiceRoleRole, err := iam.NewRole(ctx, "awsBatchServiceRoleRole", &iam.RoleArgs{
    			AssumeRolePolicy: *pulumi.String(batchAssumeRole.Json),
    		})
    		if err != nil {
    			return err
    		}
    		awsBatchServiceRoleRolePolicyAttachment, err := iam.NewRolePolicyAttachment(ctx, "awsBatchServiceRoleRolePolicyAttachment", &iam.RolePolicyAttachmentArgs{
    			Role:      awsBatchServiceRoleRole.Name,
    			PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole"),
    		})
    		if err != nil {
    			return err
    		}
    		sampleSecurityGroup, err := ec2.NewSecurityGroup(ctx, "sampleSecurityGroup", &ec2.SecurityGroupArgs{
    			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, "sampleVpc", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.1.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		sampleSubnet, err := ec2.NewSubnet(ctx, "sampleSubnet", &ec2.SubnetArgs{
    			VpcId:     sampleVpc.ID(),
    			CidrBlock: pulumi.String("10.1.1.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		samplePlacementGroup, err := ec2.NewPlacementGroup(ctx, "samplePlacementGroup", &ec2.PlacementGroupArgs{
    			Strategy: pulumi.String("cluster"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = batch.NewComputeEnvironment(ctx, "sampleComputeEnvironment", &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{
    					sampleSecurityGroup.ID(),
    				},
    				Subnets: pulumi.StringArray{
    					sampleSubnet.ID(),
    				},
    				Type: pulumi.String("EC2"),
    			},
    			ServiceRole: awsBatchServiceRoleRole.Arn,
    			Type:        pulumi.String("MANAGED"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			awsBatchServiceRoleRolePolicyAttachment,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 ecsInstanceRoleRole = new Role("ecsInstanceRoleRole", RoleArgs.builder()        
                .assumeRolePolicy(ec2AssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
                .build());
    
            var ecsInstanceRoleRolePolicyAttachment = new RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()        
                .role(ecsInstanceRoleRole.name())
                .policyArn("arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role")
                .build());
    
            var ecsInstanceRoleInstanceProfile = new InstanceProfile("ecsInstanceRoleInstanceProfile", InstanceProfileArgs.builder()        
                .role(ecsInstanceRoleRole.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 awsBatchServiceRoleRole = new Role("awsBatchServiceRoleRole", RoleArgs.builder()        
                .assumeRolePolicy(batchAssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
                .build());
    
            var awsBatchServiceRoleRolePolicyAttachment = new RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()        
                .role(awsBatchServiceRoleRole.name())
                .policyArn("arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole")
                .build());
    
            var sampleSecurityGroup = new SecurityGroup("sampleSecurityGroup", SecurityGroupArgs.builder()        
                .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()        
                .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(sampleSecurityGroup.id())
                    .subnets(sampleSubnet.id())
                    .type("EC2")
                    .build())
                .serviceRole(awsBatchServiceRoleRole.arn())
                .type("MANAGED")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(awsBatchServiceRoleRolePolicyAttachment)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    ec2_assume_role = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
        effect="Allow",
        principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
            type="Service",
            identifiers=["ec2.amazonaws.com"],
        )],
        actions=["sts:AssumeRole"],
    )])
    ecs_instance_role_role = aws.iam.Role("ecsInstanceRoleRole", assume_role_policy=ec2_assume_role.json)
    ecs_instance_role_role_policy_attachment = aws.iam.RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment",
        role=ecs_instance_role_role.name,
        policy_arn="arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role")
    ecs_instance_role_instance_profile = aws.iam.InstanceProfile("ecsInstanceRoleInstanceProfile", role=ecs_instance_role_role.name)
    batch_assume_role = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
        effect="Allow",
        principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
            type="Service",
            identifiers=["batch.amazonaws.com"],
        )],
        actions=["sts:AssumeRole"],
    )])
    aws_batch_service_role_role = aws.iam.Role("awsBatchServiceRoleRole", assume_role_policy=batch_assume_role.json)
    aws_batch_service_role_role_policy_attachment = aws.iam.RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment",
        role=aws_batch_service_role_role.name,
        policy_arn="arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole")
    sample_security_group = aws.ec2.SecurityGroup("sampleSecurityGroup", egress=[aws.ec2.SecurityGroupEgressArgs(
        from_port=0,
        to_port=0,
        protocol="-1",
        cidr_blocks=["0.0.0.0/0"],
    )])
    sample_vpc = aws.ec2.Vpc("sampleVpc", cidr_block="10.1.0.0/16")
    sample_subnet = aws.ec2.Subnet("sampleSubnet",
        vpc_id=sample_vpc.id,
        cidr_block="10.1.1.0/24")
    sample_placement_group = aws.ec2.PlacementGroup("samplePlacementGroup", strategy="cluster")
    sample_compute_environment = aws.batch.ComputeEnvironment("sampleComputeEnvironment",
        compute_environment_name="sample",
        compute_resources=aws.batch.ComputeEnvironmentComputeResourcesArgs(
            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_security_group.id],
            subnets=[sample_subnet.id],
            type="EC2",
        ),
        service_role=aws_batch_service_role_role.arn,
        type="MANAGED",
        opts=pulumi.ResourceOptions(depends_on=[aws_batch_service_role_role_policy_attachment]))
    
    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 ecsInstanceRoleRole = new aws.iam.Role("ecsInstanceRoleRole", {assumeRolePolicy: ec2AssumeRole.then(ec2AssumeRole => ec2AssumeRole.json)});
    const ecsInstanceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment", {
        role: ecsInstanceRoleRole.name,
        policyArn: "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
    });
    const ecsInstanceRoleInstanceProfile = new aws.iam.InstanceProfile("ecsInstanceRoleInstanceProfile", {role: ecsInstanceRoleRole.name});
    const batchAssumeRole = aws.iam.getPolicyDocument({
        statements: [{
            effect: "Allow",
            principals: [{
                type: "Service",
                identifiers: ["batch.amazonaws.com"],
            }],
            actions: ["sts:AssumeRole"],
        }],
    });
    const awsBatchServiceRoleRole = new aws.iam.Role("awsBatchServiceRoleRole", {assumeRolePolicy: batchAssumeRole.then(batchAssumeRole => batchAssumeRole.json)});
    const awsBatchServiceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment", {
        role: awsBatchServiceRoleRole.name,
        policyArn: "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
    });
    const sampleSecurityGroup = new aws.ec2.SecurityGroup("sampleSecurityGroup", {egress: [{
        fromPort: 0,
        toPort: 0,
        protocol: "-1",
        cidrBlocks: ["0.0.0.0/0"],
    }]});
    const sampleVpc = new aws.ec2.Vpc("sampleVpc", {cidrBlock: "10.1.0.0/16"});
    const sampleSubnet = new aws.ec2.Subnet("sampleSubnet", {
        vpcId: sampleVpc.id,
        cidrBlock: "10.1.1.0/24",
    });
    const samplePlacementGroup = new aws.ec2.PlacementGroup("samplePlacementGroup", {strategy: "cluster"});
    const sampleComputeEnvironment = new aws.batch.ComputeEnvironment("sampleComputeEnvironment", {
        computeEnvironmentName: "sample",
        computeResources: {
            instanceRole: ecsInstanceRoleInstanceProfile.arn,
            instanceTypes: ["c4.large"],
            maxVcpus: 16,
            minVcpus: 0,
            placementGroup: samplePlacementGroup.name,
            securityGroupIds: [sampleSecurityGroup.id],
            subnets: [sampleSubnet.id],
            type: "EC2",
        },
        serviceRole: awsBatchServiceRoleRole.arn,
        type: "MANAGED",
    }, {
        dependsOn: [awsBatchServiceRoleRolePolicyAttachment],
    });
    
    resources:
      ecsInstanceRoleRole:
        type: aws:iam:Role
        properties:
          assumeRolePolicy: ${ec2AssumeRole.json}
      ecsInstanceRoleRolePolicyAttachment:
        type: aws:iam:RolePolicyAttachment
        properties:
          role: ${ecsInstanceRoleRole.name}
          policyArn: arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
      ecsInstanceRoleInstanceProfile:
        type: aws:iam:InstanceProfile
        properties:
          role: ${ecsInstanceRoleRole.name}
      awsBatchServiceRoleRole:
        type: aws:iam:Role
        properties:
          assumeRolePolicy: ${batchAssumeRole.json}
      awsBatchServiceRoleRolePolicyAttachment:
        type: aws:iam:RolePolicyAttachment
        properties:
          role: ${awsBatchServiceRoleRole.name}
          policyArn: arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole
      sampleSecurityGroup:
        type: aws:ec2:SecurityGroup
        properties:
          egress:
            - fromPort: 0
              toPort: 0
              protocol: '-1'
              cidrBlocks:
                - 0.0.0.0/0
      sampleVpc:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.1.0.0/16
      sampleSubnet:
        type: aws:ec2:Subnet
        properties:
          vpcId: ${sampleVpc.id}
          cidrBlock: 10.1.1.0/24
      samplePlacementGroup:
        type: aws:ec2:PlacementGroup
        properties:
          strategy: cluster
      sampleComputeEnvironment:
        type: aws:batch:ComputeEnvironment
        properties:
          computeEnvironmentName: sample
          computeResources:
            instanceRole: ${ecsInstanceRoleInstanceProfile.arn}
            instanceTypes:
              - c4.large
            maxVcpus: 16
            minVcpus: 0
            placementGroup: ${samplePlacementGroup.name}
            securityGroupIds:
              - ${sampleSecurityGroup.id}
            subnets:
              - ${sampleSubnet.id}
            type: EC2
          serviceRole: ${awsBatchServiceRoleRole.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

    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[]
                {
                    aws_security_group.Sample.Id,
                },
                Subnets = new[]
                {
                    aws_subnet.Sample.Id,
                },
                Type = "FARGATE",
            },
            ServiceRole = aws_iam_role.Aws_batch_service_role.Arn,
            Type = "MANAGED",
        }, new CustomResourceOptions
        {
            DependsOn = new[]
            {
                aws_iam_role_policy_attachment.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{
    					aws_security_group.Sample.Id,
    				},
    				Subnets: pulumi.StringArray{
    					aws_subnet.Sample.Id,
    				},
    				Type: pulumi.String("FARGATE"),
    			},
    			ServiceRole: pulumi.Any(aws_iam_role.Aws_batch_service_role.Arn),
    			Type:        pulumi.String("MANAGED"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			aws_iam_role_policy_attachment.Aws_batch_service_role,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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(aws_security_group.sample().id())
                    .subnets(aws_subnet.sample().id())
                    .type("FARGATE")
                    .build())
                .serviceRole(aws_iam_role.aws_batch_service_role().arn())
                .type("MANAGED")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(aws_iam_role_policy_attachment.aws_batch_service_role())
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    sample = aws.batch.ComputeEnvironment("sample",
        compute_environment_name="sample",
        compute_resources=aws.batch.ComputeEnvironmentComputeResourcesArgs(
            max_vcpus=16,
            security_group_ids=[aws_security_group["sample"]["id"]],
            subnets=[aws_subnet["sample"]["id"]],
            type="FARGATE",
        ),
        service_role=aws_iam_role["aws_batch_service_role"]["arn"],
        type="MANAGED",
        opts=pulumi.ResourceOptions(depends_on=[aws_iam_role_policy_attachment["aws_batch_service_role"]]))
    
    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: [aws_security_group.sample.id],
            subnets: [aws_subnet.sample.id],
            type: "FARGATE",
        },
        serviceRole: aws_iam_role.aws_batch_service_role.arn,
        type: "MANAGED",
    }, {
        dependsOn: [aws_iam_role_policy_attachment.aws_batch_service_role],
    });
    
    resources:
      sample:
        type: aws:batch:ComputeEnvironment
        properties:
          computeEnvironmentName: sample
          computeResources:
            maxVcpus: 16
            securityGroupIds:
              - ${aws_security_group.sample.id}
            subnets:
              - ${aws_subnet.sample.id}
            type: FARGATE
          serviceRole: ${aws_iam_role.aws_batch_service_role.arn}
          type: MANAGED
        options:
          dependson:
            - ${aws_iam_role_policy_attachment.aws_batch_service_role}
    

    Setting Update Policy

    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 = aws_iam_instance_profile.Ecs_instance.Arn,
                InstanceTypes = new[]
                {
                    "optimal",
                },
                MaxVcpus = 4,
                MinVcpus = 0,
                SecurityGroupIds = new[]
                {
                    aws_security_group.Sample.Id,
                },
                Subnets = new[]
                {
                    aws_subnet.Sample.Id,
                },
                Type = "EC2",
            },
            UpdatePolicy = new Aws.Batch.Inputs.ComputeEnvironmentUpdatePolicyArgs
            {
                JobExecutionTimeoutMinutes = 30,
                TerminateJobsOnUpdate = 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(aws_iam_instance_profile.Ecs_instance.Arn),
    				InstanceTypes: pulumi.StringArray{
    					pulumi.String("optimal"),
    				},
    				MaxVcpus: pulumi.Int(4),
    				MinVcpus: pulumi.Int(0),
    				SecurityGroupIds: pulumi.StringArray{
    					aws_security_group.Sample.Id,
    				},
    				Subnets: pulumi.StringArray{
    					aws_subnet.Sample.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
    	})
    }
    
    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(aws_iam_instance_profile.ecs_instance().arn())
                    .instanceTypes("optimal")
                    .maxVcpus(4)
                    .minVcpus(0)
                    .securityGroupIds(aws_security_group.sample().id())
                    .subnets(aws_subnet.sample().id())
                    .type("EC2")
                    .build())
                .updatePolicy(ComputeEnvironmentUpdatePolicyArgs.builder()
                    .jobExecutionTimeoutMinutes(30)
                    .terminateJobsOnUpdate(false)
                    .build())
                .type("MANAGED")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    sample = aws.batch.ComputeEnvironment("sample",
        compute_environment_name="sample",
        compute_resources=aws.batch.ComputeEnvironmentComputeResourcesArgs(
            allocation_strategy="BEST_FIT_PROGRESSIVE",
            instance_role=aws_iam_instance_profile["ecs_instance"]["arn"],
            instance_types=["optimal"],
            max_vcpus=4,
            min_vcpus=0,
            security_group_ids=[aws_security_group["sample"]["id"]],
            subnets=[aws_subnet["sample"]["id"]],
            type="EC2",
        ),
        update_policy=aws.batch.ComputeEnvironmentUpdatePolicyArgs(
            job_execution_timeout_minutes=30,
            terminate_jobs_on_update=False,
        ),
        type="MANAGED")
    
    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: aws_iam_instance_profile.ecs_instance.arn,
            instanceTypes: ["optimal"],
            maxVcpus: 4,
            minVcpus: 0,
            securityGroupIds: [aws_security_group.sample.id],
            subnets: [aws_subnet.sample.id],
            type: "EC2",
        },
        updatePolicy: {
            jobExecutionTimeoutMinutes: 30,
            terminateJobsOnUpdate: false,
        },
        type: "MANAGED",
    });
    
    resources:
      sample:
        type: aws:batch:ComputeEnvironment
        properties:
          computeEnvironmentName: sample
          computeResources:
            allocationStrategy: BEST_FIT_PROGRESSIVE
            instanceRole: ${aws_iam_instance_profile.ecs_instance.arn}
            instanceTypes:
              - optimal
            maxVcpus: 4
            minVcpus: 0
            securityGroupIds:
              - ${aws_security_group.sample.id}
            subnets:
              - ${aws_subnet.sample.id}
            type: EC2
          updatePolicy:
            jobExecutionTimeoutMinutes: 30
            terminateJobsOnUpdate: false
          type: MANAGED
    

    Create ComputeEnvironment Resource

    new ComputeEnvironment(name: string, args: ComputeEnvironmentArgs, opts?: CustomResourceOptions);
    @overload
    def ComputeEnvironment(resource_name: str,
                           opts: Optional[ResourceOptions] = 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,
                           type: Optional[str] = None,
                           update_policy: Optional[ComputeEnvironmentUpdatePolicyArgs] = None)
    @overload
    def ComputeEnvironment(resource_name: str,
                           args: ComputeEnvironmentArgs,
                           opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    The ComputeEnvironment resource accepts the following input properties:

    Type string
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    ComputeEnvironmentName string
    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.
    ComputeEnvironmentNamePrefix string
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    ComputeResources ComputeEnvironmentComputeResources
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    EksConfiguration ComputeEnvironmentEksConfiguration
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    Tags Dictionary<string, string>
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    UpdatePolicy ComputeEnvironmentUpdatePolicy
    Specifies the infrastructure update policy for the compute environment. See details below.
    Type string
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    ComputeEnvironmentName string
    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.
    ComputeEnvironmentNamePrefix string
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    ComputeResources ComputeEnvironmentComputeResourcesArgs
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    EksConfiguration ComputeEnvironmentEksConfigurationArgs
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    Tags map[string]string
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    UpdatePolicy ComputeEnvironmentUpdatePolicyArgs
    Specifies the infrastructure update policy for the compute environment. See details below.
    type String
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    computeEnvironmentName String
    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.
    computeEnvironmentNamePrefix String
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    computeResources ComputeEnvironmentComputeResources
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    eksConfiguration ComputeEnvironmentEksConfiguration
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    tags Map<String,String>
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    updatePolicy ComputeEnvironmentUpdatePolicy
    Specifies the infrastructure update policy for the compute environment. See details below.
    type string
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    computeEnvironmentName string
    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.
    computeEnvironmentNamePrefix string
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    computeResources ComputeEnvironmentComputeResources
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    eksConfiguration ComputeEnvironmentEksConfiguration
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    tags {[key: string]: string}
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    updatePolicy ComputeEnvironmentUpdatePolicy
    Specifies the infrastructure update policy for the compute environment. See details below.
    type str
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    compute_environment_name str
    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_name_prefix str
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    compute_resources ComputeEnvironmentComputeResourcesArgs
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    eks_configuration ComputeEnvironmentEksConfigurationArgs
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    tags Mapping[str, str]
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    update_policy ComputeEnvironmentUpdatePolicyArgs
    Specifies the infrastructure update policy for the compute environment. See details below.
    type String
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    computeEnvironmentName String
    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.
    computeEnvironmentNamePrefix String
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    tags Map<String>
    Key-value map of resource tags. If configured with a provider default_tags configuration 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.
    EcsClusterArn string
    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.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Arn string
    The Amazon Resource Name (ARN) of the compute environment.
    EcsClusterArn string
    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.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The Amazon Resource Name (ARN) of the compute environment.
    ecsClusterArn String
    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.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn string
    The Amazon Resource Name (ARN) of the compute environment.
    ecsClusterArn string
    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.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn str
    The Amazon Resource Name (ARN) of the compute environment.
    ecs_cluster_arn str
    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.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    arn String
    The Amazon Resource Name (ARN) of the compute environment.
    ecsClusterArn String
    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.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    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) -> ComputeEnvironment
    func 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Arn string
    The Amazon Resource Name (ARN) of the compute environment.
    ComputeEnvironmentName string
    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.
    ComputeEnvironmentNamePrefix string
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    ComputeResources ComputeEnvironmentComputeResources
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    EcsClusterArn string
    The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
    EksConfiguration ComputeEnvironmentEksConfiguration
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    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.
    Tags Dictionary<string, string>
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Type string
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    UpdatePolicy ComputeEnvironmentUpdatePolicy
    Specifies the infrastructure update policy for the compute environment. See details below.
    Arn string
    The Amazon Resource Name (ARN) of the compute environment.
    ComputeEnvironmentName string
    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.
    ComputeEnvironmentNamePrefix string
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    ComputeResources ComputeEnvironmentComputeResourcesArgs
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    EcsClusterArn string
    The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
    EksConfiguration ComputeEnvironmentEksConfigurationArgs
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    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.
    Tags map[string]string
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    Type string
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    UpdatePolicy ComputeEnvironmentUpdatePolicyArgs
    Specifies the infrastructure update policy for the compute environment. See details below.
    arn String
    The Amazon Resource Name (ARN) of the compute environment.
    computeEnvironmentName String
    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.
    computeEnvironmentNamePrefix String
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    computeResources ComputeEnvironmentComputeResources
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    ecsClusterArn String
    The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
    eksConfiguration ComputeEnvironmentEksConfiguration
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    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.
    tags Map<String,String>
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    type String
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    updatePolicy ComputeEnvironmentUpdatePolicy
    Specifies the infrastructure update policy for the compute environment. See details below.
    arn string
    The Amazon Resource Name (ARN) of the compute environment.
    computeEnvironmentName string
    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.
    computeEnvironmentNamePrefix string
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    computeResources ComputeEnvironmentComputeResources
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    ecsClusterArn string
    The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
    eksConfiguration ComputeEnvironmentEksConfiguration
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    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.
    tags {[key: string]: string}
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    type string
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    updatePolicy ComputeEnvironmentUpdatePolicy
    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_name str
    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_name_prefix str
    Creates a unique compute environment name beginning with the specified prefix. Conflicts with compute_environment_name.
    compute_resources ComputeEnvironmentComputeResourcesArgs
    Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
    ecs_cluster_arn str
    The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
    eks_configuration ComputeEnvironmentEksConfigurationArgs
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    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.
    tags Mapping[str, str]
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    type str
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    update_policy ComputeEnvironmentUpdatePolicyArgs
    Specifies the infrastructure update policy for the compute environment. See details below.
    arn String
    The Amazon Resource Name (ARN) of the compute environment.
    computeEnvironmentName String
    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.
    computeEnvironmentNamePrefix String
    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.
    ecsClusterArn String
    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 are ENABLED or DISABLED. Defaults to ENABLED.
    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.
    tags Map<String>
    Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated:Please use tags instead.

    type String
    The type of the compute environment. Valid items are MANAGED or UNMANAGED.
    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, FARGATE or FARGATE_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. Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT. Defaults to BEST_FIT. See AWS docs for details. 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<ComputeEnvironmentComputeResourcesEc2Configuration>
    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_configuration image_id_override instead)
    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 ComputeEnvironmentComputeResourcesLaunchTemplate
    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 EC2 or SPOT compute environments, if the parameter is not explicitly defined, a 0 default 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.
    SecurityGroupIds List<string>
    A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
    SpotIamFleetRole string
    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.
    Tags 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, FARGATE or FARGATE_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. Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT. Defaults to BEST_FIT. See AWS docs for details. 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 []ComputeEnvironmentComputeResourcesEc2Configuration
    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_configuration image_id_override instead)
    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 ComputeEnvironmentComputeResourcesLaunchTemplate
    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 EC2 or SPOT compute environments, if the parameter is not explicitly defined, a 0 default 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.
    SecurityGroupIds []string
    A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
    SpotIamFleetRole string
    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.
    Tags 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, FARGATE or FARGATE_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. Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT. Defaults to BEST_FIT. See AWS docs for details. 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<ComputeEnvironmentComputeResourcesEc2Configuration>
    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_configuration image_id_override instead)
    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 ComputeEnvironmentComputeResourcesLaunchTemplate
    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 EC2 or SPOT compute environments, if the parameter is not explicitly defined, a 0 default 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.
    securityGroupIds List<String>
    A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
    spotIamFleetRole String
    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.
    tags 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, FARGATE or FARGATE_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. Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT. Defaults to BEST_FIT. See AWS docs for details. 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 ComputeEnvironmentComputeResourcesEc2Configuration[]
    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_configuration image_id_override instead)
    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 ComputeEnvironmentComputeResourcesLaunchTemplate
    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 EC2 or SPOT compute environments, if the parameter is not explicitly defined, a 0 default 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.
    securityGroupIds string[]
    A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
    spotIamFleetRole string
    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.
    tags {[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, FARGATE or FARGATE_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. Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT. Defaults to BEST_FIT. See AWS docs for details. 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[ComputeEnvironmentComputeResourcesEc2Configuration]
    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_pair str
    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_configuration image_id_override instead)
    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 ComputeEnvironmentComputeResourcesLaunchTemplate
    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 EC2 or SPOT compute environments, if the parameter is not explicitly defined, a 0 default 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_ids Sequence[str]
    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_fleet_role str
    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.
    tags 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, FARGATE or FARGATE_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. Valid items are BEST_FIT_PROGRESSIVE, SPOT_CAPACITY_OPTIMIZED or BEST_FIT. Defaults to BEST_FIT. See AWS docs for details. 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_configuration image_id_override instead)
    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 EC2 or SPOT compute environments, if the parameter is not explicitly defined, a 0 default 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.
    securityGroupIds List<String>
    A list of EC2 security group that are associated with instances launched in the compute environment. This parameter is required for Fargate compute environments.
    spotIamFleetRole String
    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.
    tags 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

    ImageIdOverride string
    The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_id argument in the compute_resources block.
    ImageType string
    The image type to match with the instance type to select an AMI. If the image_id_override parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
    ImageIdOverride string
    The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_id argument in the compute_resources block.
    ImageType string
    The image type to match with the instance type to select an AMI. If the image_id_override parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
    imageIdOverride String
    The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_id argument in the compute_resources block.
    imageType String
    The image type to match with the instance type to select an AMI. If the image_id_override parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
    imageIdOverride string
    The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_id argument in the compute_resources block.
    imageType string
    The image type to match with the instance type to select an AMI. If the image_id_override parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
    image_id_override str
    The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_id argument in the compute_resources block.
    image_type str
    The image type to match with the instance type to select an AMI. If the image_id_override parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.
    imageIdOverride String
    The AMI ID used for instances launched in the compute environment that match the image type. This setting overrides the image_id argument in the compute_resources block.
    imageType String
    The image type to match with the instance type to select an AMI. If the image_id_override parameter isn't specified, then a recent Amazon ECS-optimized Amazon Linux 2 AMI (ECS_AL2) is used.

    ComputeEnvironmentComputeResourcesLaunchTemplate, ComputeEnvironmentComputeResourcesLaunchTemplateArgs

    LaunchTemplateId string
    ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
    LaunchTemplateName string
    Name of the launch template.
    Version string
    The version number of the launch template. Default: The default version of the launch template.
    LaunchTemplateId string
    ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
    LaunchTemplateName string
    Name of the launch template.
    Version string
    The version number of the launch template. Default: The default version of the launch template.
    launchTemplateId String
    ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
    launchTemplateName String
    Name of the launch template.
    version String
    The version number of the launch template. Default: The default version of the launch template.
    launchTemplateId string
    ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
    launchTemplateName string
    Name of the launch template.
    version string
    The version number of the launch template. Default: The default version of the launch template.
    launch_template_id str
    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_name str
    Name of the launch template.
    version str
    The version number of the launch template. Default: The default version of the launch template.
    launchTemplateId String
    ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
    launchTemplateName String
    Name of the launch template.
    version String
    The version number of the launch template. Default: The default version of the launch template.

    ComputeEnvironmentEksConfiguration, ComputeEnvironmentEksConfigurationArgs

    EksClusterArn string
    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.
    EksClusterArn string
    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.
    eksClusterArn String
    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.
    eksClusterArn string
    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_arn str
    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.
    eksClusterArn String
    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

    JobExecutionTimeoutMinutes int
    Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
    TerminateJobsOnUpdate bool
    Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
    JobExecutionTimeoutMinutes int
    Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
    TerminateJobsOnUpdate bool
    Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
    jobExecutionTimeoutMinutes Integer
    Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
    terminateJobsOnUpdate Boolean
    Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
    jobExecutionTimeoutMinutes number
    Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
    terminateJobsOnUpdate boolean
    Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
    job_execution_timeout_minutes int
    Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
    terminate_jobs_on_update bool
    Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated.
    jobExecutionTimeoutMinutes Number
    Specifies the job timeout (in minutes) when the compute environment infrastructure is updated.
    terminateJobsOnUpdate Boolean
    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
    

    Package Details

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

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.22.2 published on Friday, Feb 16, 2024 by Pulumi