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_onto the relatedaws.iam.RolePolicyAttachment; otherwise, the policy may be destroyed too soon and the compute environment will then get stuck in theDELETINGstate, see Troubleshooting AWS Batch .
Example Usage
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
new ComputeEnvironment(name: string, args: ComputeEnvironmentArgs, opts?: CustomResourceOptions);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);func NewComputeEnvironment(ctx *Context, name string, args ComputeEnvironmentArgs, opts ...ResourceOption) (*ComputeEnvironment, error)public ComputeEnvironment(string name, ComputeEnvironmentArgs args, CustomResourceOptions? opts = null)- 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:
- Service
Role 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
EC2orSPOT.- Compute
Environment stringName 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 stringName Prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- Compute
Resources ComputeEnvironment Compute Resources Args Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- State string
The state of the compute environment. If the state is
ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.
- Service
Role 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
EC2orSPOT.- Compute
Environment stringName 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 stringName Prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- Compute
Resources ComputeEnvironment Compute Resources 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 areENABLEDorDISABLED. Defaults toENABLED.
- service
Role 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
EC2orSPOT.- compute
Environment stringName 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 stringName Prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- compute
Resources ComputeEnvironment Compute Resources 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 areENABLEDorDISABLED. Defaults toENABLED.
- 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
EC2orSPOT.- compute_
environment_ strname 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_ strname_ prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- compute_
resources Dict[ComputeEnvironment Compute Resources] 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 areENABLEDorDISABLED. Defaults toENABLED.
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.
- Ecs
Cluster stringArn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
The current status of the compute environment (for example, CREATING or VALID).
- Status
Reason 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.
- Ecs
Cluster stringArn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
The current status of the compute environment (for example, CREATING or VALID).
- Status
Reason 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.
- ecs
Cluster stringArn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
The current status of the compute environment (for example, CREATING or VALID).
- status
Reason 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_ strarn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
The current status of the compute environment (for example, CREATING or VALID).
- status_
reason str A short, human-readable string to provide additional details about the current status of the compute environment.
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): ComputeEnvironmentstatic 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.
- Compute
Environment stringName 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 stringName Prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- Compute
Resources ComputeEnvironment Compute Resources Args Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- Ecs
Cluster stringArn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- Service
Role string The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- State string
The state of the compute environment. If the state is
ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.- Status string
The current status of the compute environment (for example, CREATING or VALID).
- Status
Reason 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
EC2orSPOT.
- Arn string
The Amazon Resource Name (ARN) of the compute environment.
- Compute
Environment stringName 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 stringName Prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- Compute
Resources ComputeEnvironment Compute Resources Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- Ecs
Cluster stringArn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- Service
Role string The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- State string
The state of the compute environment. If the state is
ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.- Status string
The current status of the compute environment (for example, CREATING or VALID).
- Status
Reason 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
EC2orSPOT.
- arn string
The Amazon Resource Name (ARN) of the compute environment.
- compute
Environment stringName 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 stringName Prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- compute
Resources ComputeEnvironment Compute Resources Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- ecs
Cluster stringArn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- service
Role string The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state string
The state of the compute environment. If the state is
ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.- status string
The current status of the compute environment (for example, CREATING or VALID).
- status
Reason 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
EC2orSPOT.
- arn str
The Amazon Resource Name (ARN) of the compute environment.
- compute_
environment_ strname The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed. If omitted, this provider will assign a random, unique name.
- compute_
environment_ strname_ prefix Creates a unique compute environment name beginning with the specified prefix. Conflicts with
compute_environment_name.- compute_
resources Dict[ComputeEnvironment Compute Resources] Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. See details below.
- ecs_
cluster_ strarn The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment.
- service_
role str The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.
- state str
The state of the compute environment. If the state is
ENABLED, then the compute environment accepts jobs from a queue and can scale out automatically based on queues. Valid items areENABLEDorDISABLED. Defaults toENABLED.- status str
The current status of the compute environment (for example, CREATING or VALID).
- status_
reason str A short, human-readable string to provide additional details about the current status of the compute environment.
- type str
The type of compute environment. Valid items are
EC2orSPOT.
Supporting Types
ComputeEnvironmentComputeResources
- Instance
Role string The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.
- Instance
Types List<string> A list of instance types that may be launched.
- Max
Vcpus int The maximum number of EC2 vCPUs that an environment can reach.
- Min
Vcpus int The minimum number of EC2 vCPUs that an environment should maintain.
- Security
Group List<string>Ids 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
EC2orSPOT.- Allocation
Strategy 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_OPTIMIZEDorBEST_FIT. Defaults toBEST_FIT. See AWS docs for details.- Bid
Percentage 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.- Desired
Vcpus int The desired number of EC2 vCPUS in the compute environment.
- Ec2Key
Pair string The EC2 key pair that is used for instances launched in the compute environment.
- Image
Id string The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.
- Launch
Template ComputeEnvironment Compute Resources Launch Template Args The launch template to use for your compute resources. See details below.
- Spot
Iam stringFleet Role The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.
- Dictionary<string, string>
Key-value pair tags to be applied to resources that are launched in the compute environment.
- Instance
Role string The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.
- Instance
Types []string A list of instance types that may be launched.
- Max
Vcpus int The maximum number of EC2 vCPUs that an environment can reach.
- Min
Vcpus int The minimum number of EC2 vCPUs that an environment should maintain.
- Security
Group []stringIds 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
EC2orSPOT.- Allocation
Strategy 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_OPTIMIZEDorBEST_FIT. Defaults toBEST_FIT. See AWS docs for details.- Bid
Percentage 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.- Desired
Vcpus int The desired number of EC2 vCPUS in the compute environment.
- Ec2Key
Pair string The EC2 key pair that is used for instances launched in the compute environment.
- Image
Id string The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.
- Launch
Template ComputeEnvironment Compute Resources Launch Template The launch template to use for your compute resources. See details below.
- Spot
Iam stringFleet Role The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.
- map[string]string
Key-value pair tags to be applied to resources that are launched in the compute environment.
- instance
Role string The Amazon ECS instance role applied to Amazon EC2 instances in a compute environment.
- instance
Types string[] A list of instance types that may be launched.
- max
Vcpus number The maximum number of EC2 vCPUs that an environment can reach.
- min
Vcpus number The minimum number of EC2 vCPUs that an environment should maintain.
- security
Group string[]Ids 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
EC2orSPOT.- allocation
Strategy 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_OPTIMIZEDorBEST_FIT. Defaults toBEST_FIT. See AWS docs for details.- bid
Percentage 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.- desired
Vcpus number The desired number of EC2 vCPUS in the compute environment.
- ec2Key
Pair string The EC2 key pair that is used for instances launched in the compute environment.
- image
Id string The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.
- launch
Template ComputeEnvironment Compute Resources Launch Template The launch template to use for your compute resources. See details below.
- spot
Iam stringFleet Role The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.
- {[key: string]: string}
Key-value pair tags to be applied to resources that are launched in the compute environment.
- instance
Role 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.
- max
Vcpus float The maximum number of EC2 vCPUs that an environment can reach.
- min
Vcpus float The minimum number of EC2 vCPUs that an environment should maintain.
- security_
group_ List[str]ids 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
EC2orSPOT.- 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_OPTIMIZEDorBEST_FIT. Defaults toBEST_FIT. See AWS docs for details.- bid
Percentage 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.- desired
Vcpus float The desired number of EC2 vCPUS in the compute environment.
- ec2Key
Pair 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[ComputeEnvironment Compute Resources Launch Template] The launch template to use for your compute resources. See details below.
- spot
Iam strFleet Role The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a SPOT compute environment. This parameter is required for SPOT compute environments.
- Dict[str, str]
Key-value pair tags to be applied to resources that are launched in the compute environment.
ComputeEnvironmentComputeResourcesLaunchTemplate
- Launch
Template stringId 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 stringName Name of the launch template.
- Version string
The version number of the launch template. Default: The default version of the launch template.
- Launch
Template stringId 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 stringName Name of the launch template.
- Version string
The version number of the launch template. Default: The default version of the launch template.
- launch
Template stringId 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 stringName Name of the launch template.
- version string
The version number of the launch template. Default: The default version of the launch template.
- launch
Template strId ID of the launch template. You must specify either the launch template ID or launch template name in the request, but not both.
- launch
Template strName Name of the launch template.
- version str
The version number of the launch template. Default: The default version of the launch template.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.