ComputeEnvironment

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var ecsInstanceRoleRole = new Aws.Iam.Role("ecsInstanceRoleRole", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
    ""Version"": ""2012-10-17"",
    ""Statement"": [
 {
     ""Action"": ""sts:AssumeRole"",
     ""Effect"": ""Allow"",
     ""Principal"": {
     ""Service"": ""ec2.amazonaws.com""
     }
 }
    ]
}

",
        });
        var ecsInstanceRoleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs
        {
            PolicyArn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
            Role = ecsInstanceRoleRole.Name,
        });
        var ecsInstanceRoleInstanceProfile = new Aws.Iam.InstanceProfile("ecsInstanceRoleInstanceProfile", new Aws.Iam.InstanceProfileArgs
        {
            Role = ecsInstanceRoleRole.Name,
        });
        var awsBatchServiceRoleRole = new Aws.Iam.Role("awsBatchServiceRoleRole", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
    ""Version"": ""2012-10-17"",
    ""Statement"": [
 {
     ""Action"": ""sts:AssumeRole"",
     ""Effect"": ""Allow"",
     ""Principal"": {
     ""Service"": ""batch.amazonaws.com""
     }
 }
    ]
}

",
        });
        var awsBatchServiceRoleRolePolicyAttachment = new Aws.Iam.RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment", new Aws.Iam.RolePolicyAttachmentArgs
        {
            PolicyArn = "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
            Role = awsBatchServiceRoleRole.Name,
        });
        var sampleSecurityGroup = new Aws.Ec2.SecurityGroup("sampleSecurityGroup", new Aws.Ec2.SecurityGroupArgs
        {
            Egress = 
            {
                new Aws.Ec2.Inputs.SecurityGroupEgressArgs
                {
                    CidrBlocks = 
                    {
                        "0.0.0.0/0",
                    },
                    FromPort = 0,
                    Protocol = "-1",
                    ToPort = 0,
                },
            },
        });
        var sampleVpc = new Aws.Ec2.Vpc("sampleVpc", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.1.0.0/16",
        });
        var sampleSubnet = new Aws.Ec2.Subnet("sampleSubnet", new Aws.Ec2.SubnetArgs
        {
            CidrBlock = "10.1.1.0/24",
            VpcId = sampleVpc.Id,
        });
        var sampleComputeEnvironment = new Aws.Batch.ComputeEnvironment("sampleComputeEnvironment", new Aws.Batch.ComputeEnvironmentArgs
        {
            ComputeEnvironmentName = "sample",
            ComputeResources = new Aws.Batch.Inputs.ComputeEnvironmentComputeResourcesArgs
            {
                InstanceRole = ecsInstanceRoleInstanceProfile.Arn,
                InstanceTypes = 
                {
                    "c4.large",
                },
                MaxVcpus = 16,
                MinVcpus = 0,
                SecurityGroupIds = 
                {
                    sampleSecurityGroup.Id,
                },
                Subnets = 
                {
                    sampleSubnet.Id,
                },
                Type = "EC2",
            },
            ServiceRole = awsBatchServiceRoleRole.Arn,
            Type = "MANAGED",
        }, new CustomResourceOptions
        {
            DependsOn = 
            {
                "aws_iam_role_policy_attachment.aws_batch_service_role",
            },
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/batch"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        ecsInstanceRoleRole, err := iam.NewRole(ctx, "ecsInstanceRoleRole", &iam.RoleArgs{
            AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "    \"Version\": \"2012-10-17\",\n", "    \"Statement\": [\n", "   {\n", "       \"Action\": \"sts:AssumeRole\",\n", "     \"Effect\": \"Allow\",\n", "      \"Principal\": {\n", "        \"Service\": \"ec2.amazonaws.com\"\n", "      }\n", "   }\n", "    ]\n", "}\n", "\n")),
        })
        if err != nil {
            return err
        }
        _, err = iam.NewRolePolicyAttachment(ctx, "ecsInstanceRoleRolePolicyAttachment", &iam.RolePolicyAttachmentArgs{
            PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role"),
            Role:      ecsInstanceRoleRole.Name,
        })
        if err != nil {
            return err
        }
        ecsInstanceRoleInstanceProfile, err := iam.NewInstanceProfile(ctx, "ecsInstanceRoleInstanceProfile", &iam.InstanceProfileArgs{
            Role: ecsInstanceRoleRole.Name,
        })
        if err != nil {
            return err
        }
        awsBatchServiceRoleRole, err := iam.NewRole(ctx, "awsBatchServiceRoleRole", &iam.RoleArgs{
            AssumeRolePolicy: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "    \"Version\": \"2012-10-17\",\n", "    \"Statement\": [\n", "   {\n", "       \"Action\": \"sts:AssumeRole\",\n", "     \"Effect\": \"Allow\",\n", "      \"Principal\": {\n", "        \"Service\": \"batch.amazonaws.com\"\n", "        }\n", "   }\n", "    ]\n", "}\n", "\n")),
        })
        if err != nil {
            return err
        }
        _, err = iam.NewRolePolicyAttachment(ctx, "awsBatchServiceRoleRolePolicyAttachment", &iam.RolePolicyAttachmentArgs{
            PolicyArn: pulumi.String("arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole"),
            Role:      awsBatchServiceRoleRole.Name,
        })
        if err != nil {
            return err
        }
        sampleSecurityGroup, err := ec2.NewSecurityGroup(ctx, "sampleSecurityGroup", &ec2.SecurityGroupArgs{
            Egress: ec2.SecurityGroupEgressArray{
                &ec2.SecurityGroupEgressArgs{
                    CidrBlocks: pulumi.StringArray{
                        pulumi.String("0.0.0.0/0"),
                    },
                    FromPort: pulumi.Int(0),
                    Protocol: pulumi.String("-1"),
                    ToPort:   pulumi.Int(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{
            CidrBlock: pulumi.String("10.1.1.0/24"),
            VpcId:     sampleVpc.ID(),
        })
        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),
                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{
            "aws_iam_role_policy_attachment.aws_batch_service_role",
        }))
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

ecs_instance_role_role = aws.iam.Role("ecsInstanceRoleRole", assume_role_policy="""{
    "Version": "2012-10-17",
    "Statement": [
    {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
        "Service": "ec2.amazonaws.com"
        }
    }
    ]
}

""")
ecs_instance_role_role_policy_attachment = aws.iam.RolePolicyAttachment("ecsInstanceRoleRolePolicyAttachment",
    policy_arn="arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
    role=ecs_instance_role_role.name)
ecs_instance_role_instance_profile = aws.iam.InstanceProfile("ecsInstanceRoleInstanceProfile", role=ecs_instance_role_role.name)
aws_batch_service_role_role = aws.iam.Role("awsBatchServiceRoleRole", assume_role_policy="""{
    "Version": "2012-10-17",
    "Statement": [
    {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
        "Service": "batch.amazonaws.com"
        }
    }
    ]
}

""")
aws_batch_service_role_role_policy_attachment = aws.iam.RolePolicyAttachment("awsBatchServiceRoleRolePolicyAttachment",
    policy_arn="arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
    role=aws_batch_service_role_role.name)
sample_security_group = aws.ec2.SecurityGroup("sampleSecurityGroup", egress=[{
    "cidr_blocks": ["0.0.0.0/0"],
    "from_port": 0,
    "protocol": "-1",
    "to_port": 0,
}])
sample_vpc = aws.ec2.Vpc("sampleVpc", cidr_block="10.1.0.0/16")
sample_subnet = aws.ec2.Subnet("sampleSubnet",
    cidr_block="10.1.1.0/24",
    vpc_id=sample_vpc.id)
sample_compute_environment = aws.batch.ComputeEnvironment("sampleComputeEnvironment",
    compute_environment_name="sample",
    compute_resources={
        "instanceRole": ecs_instance_role_instance_profile.arn,
        "instance_types": ["c4.large"],
        "maxVcpus": 16,
        "minVcpus": 0,
        "security_group_ids": [sample_security_group.id],
        "subnets": [sample_subnet.id],
        "type": "EC2",
    },
    service_role=aws_batch_service_role_role.arn,
    type="MANAGED",
    opts=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 ecsInstanceRoleRole = new aws.iam.Role("ecs_instance_role", {
    assumeRolePolicy: `{
    "Version": "2012-10-17",
    "Statement": [
    {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
        "Service": "ec2.amazonaws.com"
        }
    }
    ]
}
`,
});
const ecsInstanceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("ecs_instance_role", {
    policyArn: "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role",
    role: ecsInstanceRoleRole.name,
});
const ecsInstanceRoleInstanceProfile = new aws.iam.InstanceProfile("ecs_instance_role", {
    role: ecsInstanceRoleRole.name,
});
const awsBatchServiceRoleRole = new aws.iam.Role("aws_batch_service_role", {
    assumeRolePolicy: `{
    "Version": "2012-10-17",
    "Statement": [
    {
        "Action": "sts:AssumeRole",
        "Effect": "Allow",
        "Principal": {
        "Service": "batch.amazonaws.com"
        }
    }
    ]
}
`,
});
const awsBatchServiceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("aws_batch_service_role", {
    policyArn: "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole",
    role: awsBatchServiceRoleRole.name,
});
const sampleSecurityGroup = new aws.ec2.SecurityGroup("sample", {
    egress: [{
        cidrBlocks: ["0.0.0.0/0"],
        fromPort: 0,
        protocol: "-1",
        toPort: 0,
    }],
});
const sampleVpc = new aws.ec2.Vpc("sample", {
    cidrBlock: "10.1.0.0/16",
});
const sampleSubnet = new aws.ec2.Subnet("sample", {
    cidrBlock: "10.1.1.0/24",
    vpcId: sampleVpc.id,
});
const sampleComputeEnvironment = new aws.batch.ComputeEnvironment("sample", {
    computeEnvironmentName: "sample",
    computeResources: {
        instanceRole: ecsInstanceRoleInstanceProfile.arn,
        instanceTypes: ["c4.large"],
        maxVcpus: 16,
        minVcpus: 0,
        securityGroupIds: [sampleSecurityGroup.id],
        subnets: [sampleSubnet.id],
        type: "EC2",
    },
    serviceRole: awsBatchServiceRoleRole.arn,
    type: "MANAGED",
}, { dependsOn: [awsBatchServiceRoleRolePolicyAttachment] });

Create a ComputeEnvironment Resource

def ComputeEnvironment(resource_name, opts=None, compute_environment_name=None, compute_environment_name_prefix=None, compute_resources=None, service_role=None, state=None, type=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

ComputeEnvironment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ComputeEnvironment resource accepts the following input properties:

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.

Type string

The type of compute environment. Valid items are EC2 or SPOT.

ComputeEnvironmentName string

The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, this 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.

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.

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.

Type string

The type of compute environment. Valid items are EC2 or SPOT.

ComputeEnvironmentName string

The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, this 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.

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.

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.

type string

The type of compute environment. Valid items are EC2 or SPOT.

computeEnvironmentName string

The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, this 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.

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.

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.

type str

The type of compute environment. Valid items are EC2 or SPOT.

compute_environment_name str

The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, this 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 Dict[ComputeEnvironmentComputeResources]

Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.

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.

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.

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.

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.

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.

Look up an 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
static get(resource_name, id, opts=None, arn=None, compute_environment_name=None, compute_environment_name_prefix=None, compute_resources=None, ecs_cluster_arn=None, service_role=None, state=None, status=None, status_reason=None, type=None, __props__=None);
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)
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.

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, this 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.

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.

Type string

The type of compute environment. Valid items are EC2 or SPOT.

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, this 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.

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.

Type string

The type of compute environment. Valid items are EC2 or SPOT.

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, this 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.

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.

type string

The type of compute environment. Valid items are EC2 or SPOT.

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, this 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 Dict[ComputeEnvironmentComputeResources]

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.

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.

type str

The type of compute environment. Valid items are EC2 or SPOT.

Supporting Types

ComputeEnvironmentComputeResources

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

InstanceRole string

The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

InstanceTypes List<string>

A list of instance types that may be launched.

MaxVcpus int

The maximum number of EC2 vCPUs that an environment can reach.

MinVcpus int

The minimum number of EC2 vCPUs that an environment should maintain.

SecurityGroupIds List<string>

A list of EC2 security group that are associated with instances launched in the compute environment.

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 or 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.

BidPercentage int

Integer of minimum percentage that a Spot Instance price must 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. This parameter is required for SPOT compute environments.

DesiredVcpus int

The desired number of EC2 vCPUS in the compute environment.

Ec2KeyPair string

The EC2 key pair that is used for instances launched in the compute environment.

ImageId string

The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

LaunchTemplate ComputeEnvironmentComputeResourcesLaunchTemplateArgs

The launch template to use for your compute resources. See details below.

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.

Tags Dictionary<string, string>

Key-value pair tags to be applied to resources that are launched in the compute environment.

InstanceRole string

The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

InstanceTypes []string

A list of instance types that may be launched.

MaxVcpus int

The maximum number of EC2 vCPUs that an environment can reach.

MinVcpus int

The minimum number of EC2 vCPUs that an environment should maintain.

SecurityGroupIds []string

A list of EC2 security group that are associated with instances launched in the compute environment.

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 or 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.

BidPercentage int

Integer of minimum percentage that a Spot Instance price must 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. This parameter is required for SPOT compute environments.

DesiredVcpus int

The desired number of EC2 vCPUS in the compute environment.

Ec2KeyPair string

The EC2 key pair that is used for instances launched in the compute environment.

ImageId string

The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

LaunchTemplate ComputeEnvironmentComputeResourcesLaunchTemplate

The launch template to use for your compute resources. See details below.

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.

Tags map[string]string

Key-value pair tags to be applied to resources that are launched in the compute environment.

instanceRole string

The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

instanceTypes string[]

A list of instance types that may be launched.

maxVcpus number

The maximum number of EC2 vCPUs that an environment can reach.

minVcpus number

The minimum number of EC2 vCPUs that an environment should maintain.

securityGroupIds string[]

A list of EC2 security group that are associated with instances launched in the compute environment.

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 or 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.

bidPercentage number

Integer of minimum percentage that a Spot Instance price must 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. This parameter is required for SPOT compute environments.

desiredVcpus number

The desired number of EC2 vCPUS in the compute environment.

ec2KeyPair string

The EC2 key pair that is used for instances launched in the compute environment.

imageId string

The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

launchTemplate ComputeEnvironmentComputeResourcesLaunchTemplate

The launch template to use for your compute resources. See details below.

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.

tags {[key: string]: string}

Key-value pair tags to be applied to resources that are launched in the compute environment.

instanceRole str

The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.

instance_types List[str]

A list of instance types that may be launched.

maxVcpus float

The maximum number of EC2 vCPUs that an environment can reach.

minVcpus float

The minimum number of EC2 vCPUs that an environment should maintain.

security_group_ids List[str]

A list of EC2 security group that are associated with instances launched in the compute environment.

subnets List[str]

A list of VPC subnets into which the compute resources are launched.

type str

The type of compute environment. Valid items are EC2 or 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.

bidPercentage float

Integer of minimum percentage that a Spot Instance price must 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. This parameter is required for SPOT compute environments.

desiredVcpus float

The desired number of EC2 vCPUS in the compute environment.

ec2KeyPair str

The EC2 key pair that is used for instances launched in the compute environment.

image_id str

The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.

launch_template Dict[ComputeEnvironmentComputeResourcesLaunchTemplate]

The launch template to use for your compute resources. See details below.

spotIamFleetRole 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.

tags Dict[str, str]

Key-value pair tags to be applied to resources that are launched in the compute environment.

ComputeEnvironmentComputeResourcesLaunchTemplate

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 str

ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.

launchTemplateName str

Name of the launch template.

version str

The version number of the launch template. Default: The default version of the launch template.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.