AWS Batch ComputeEnvironment ComputeResources
The ComputeResources property type specifies details of the compute resources
managed by the compute environment. This parameter is required for managed compute
environments. For more information, see Compute
Environments in the AWS Batch User Guide.
ComputeResources is a property of the AWS::Batch::ComputeEnvironment resource.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "SpotIamFleetRole" :String, "MaxvCpus" :Integer, "BidPercentage" :Integer, "SecurityGroupIds" : [String, ... ], "Subnets" : [String, ... ], "Type" :String, "MinvCpus" :Integer, "LaunchTemplate" : LaunchTemplateSpecification, "ImageId" :String, "InstanceRole" :String, "InstanceTypes" : [String, ... ], "Ec2KeyPair" :String, "PlacementGroup" :String, "Tags" :Json, "DesiredvCpus" :Integer, }
YAML
SpotIamFleetRole:StringMaxvCpus:IntegerBidPercentage:IntegerSecurityGroupIds: -StringSubnets: -StringType:StringMinvCpus:IntegerLaunchTemplate: LaunchTemplateSpecification ImageId:StringInstanceRole:StringInstanceTypes: -StringEc2KeyPair:StringPlacementGroup:StringTags:JsonDesiredvCpus:Integer
Properties
For more information about each property, see ComputeResource in the AWS Batch API Reference.
SpotIamFleetRole-
The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a
SPOTcompute environment.Required: No
Type: String
Update requires: Replacement
MaxvCpus-
The maximum number of EC2 vCPUs that an environment can reach.
Required: Yes
Type: Integer
Update requires: No interruption
SecurityGroupIds-
The EC2 security group that is associated with instances launched in the compute environment.
Required: Yes
Type: List of String values
Update requires: Replacement
BidPercentage-
The 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%, then the Spot price must be below 20% of the current On-Demand price for that EC2 instance.
Required: No
Type: Integer
Update requires: Replacement
Type-
The type of compute environment:
EC2orSPOT.Required: Yes
Type: String
Update requires: Replacement
Subnets-
The VPC subnets into which the compute resources are launched.
Required: Yes
Type: List of String values
Update requires: Replacement
MinvCpus-
The minimum number of EC2 vCPUs that an environment should maintain.
Required: Yes
Type: Integer
Update requires: No interruption
LaunchTemplate-
The launch template to use for your compute resources. Any other compute resource parameters that you specify in a CreateComputeEnvironment API operation override the same parameters in the launch template. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see Launch Template Support in the AWS Batch User Guide.
Required: No
Type: LaunchTemplateSpecification
Update requires: Replacement
ImageId-
The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.
Required: No
Type: String
Update requires: Replacement
InstanceRole-
The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment.
Required: Yes
Type: String
Update requires: Replacement
InstanceTypes-
The instances types that may launched.
Required: Yes
Type: List of String values
Update requires: Replacement
Ec2KeyPair-
The EC2 key pair that is used for instances launched in the compute environment.
Required: No
Type: String
Update requires: Replacement
PlacementGroup-
The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see Placement Groups in the Amazon EC2 User Guide for Linux Instances.
Required: No
Type: String
Update requires: Replacement
Tags-
Key-value pair tags to be applied to instances that are launched in the compute environment. For AWS Batch, these take the form of
"String1": "String2", whereString1is the tag key andString2is the tag value—for example,{ "Name": "AWS Batch Instance - C4OnDemand" }.Required: No
Type: JSON object
Update requires: Replacement
DesiredvCpus-
The desired number of EC2 vCPUS in the compute environment.
Required: No
Type: Integer
Update requires: No interruption
