FargateComputeEnvironmentProps Struct
Props for a FargateComputeEnvironment.
Example
declare const vpc: ec2.IVpc;
const sharedComputeEnv = new batch.FargateComputeEnvironment(this, 'spotEnv', {
vpc,
spot: true,
});
const lowPriorityQueue = new batch.JobQueue(this, 'JobQueue', {
priority: 1,
});
const highPriorityQueue = new batch.JobQueue(this, 'JobQueue', {
priority: 10,
});
lowPriorityQueue.addComputeEnvironment(sharedComputeEnv, 1);
highPriorityQueue.addComputeEnvironment(sharedComputeEnv, 1);
Properties
computeEnvironmentNameoptionalstringcompute_environment_nameoptionalstrcomputeEnvironmentNameoptionalStringComputeEnvironmentNameoptionalstringComputeEnvironmentNameoptional*string#Default: generated by CloudFormation
enabledoptionalbooleanenabledoptionalboolenabledoptionalBooleanEnabledoptionalboolEnabledoptional*bool= true#notes
Enabled ComputeEnvironments can accept jobs from a Queue and can scale instances up or down. Disabled ComputeEnvironments cannot accept jobs from a Queue or scale instances up or down.
If you change a ComputeEnvironment from enabled to disabled while it is executing jobs, Jobs in the STARTED or RUNNING states will not be interrupted. As jobs complete, the ComputeEnvironment will scale instances down to minvCpus.
To ensure you aren't billed for unused capacity, set minvCpus to 0.
maxvCpusoptionalnumbermaxv_cpusoptionalint | floatmaxvCpusoptionalNumberMaxvCpusoptionaldoubleMaxvCpusoptional*float64= 256#notes
Note: if this Compute Environment uses EC2 resources (not Fargate) with either AllocationStrategy.BEST_FIT_PROGRESSIVE or AllocationStrategy.SPOT_CAPACITY_OPTIMIZED, or AllocationStrategy.BEST_FIT with Spot instances, The scheduler may exceed this number by at most one of the instances specified in instanceTypes or instanceClasses.
replaceComputeEnvironmentoptionalbooleanreplace_compute_environmentoptionalboolreplaceComputeEnvironmentoptionalBooleanReplaceComputeEnvironmentoptionalboolReplaceComputeEnvironmentoptional*bool= false#notes
To enable more properties to be updated, set this property to false. When changing the value of this property to false, do not change any other properties at the same time. If other properties are changed at the same time, and the change needs to be rolled back but it can't, it's possible for the stack to go into the UPDATE_ROLLBACK_FAILED state. You can't update a stack that is in the UPDATE_ROLLBACK_FAILED state. However, if you can continue to roll it back, you can return the stack to its original settings and then try to update it again.
The properties which require a replacement of the Compute Environment are:
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#Default: new security groups will be created
serviceRoleoptionalIRoleservice_roleoptionalIRoleserviceRoleoptionalIRoleServiceRoleoptionalIRoleServiceRoleoptionalIRole#Default: a serviceRole will be created for managed CEs, none for unmanaged CEs
Spot instances are less expensive EC2 instances that can be reclaimed by EC2 at any time; your job will be given two minutes of notice before reclamation.
terminateOnUpdateoptionalbooleanterminate_on_updateoptionalboolterminateOnUpdateoptionalBooleanTerminateOnUpdateoptionalboolTerminateOnUpdateoptional*bool= false#If this is enabled, any terminated jobs may be retried, depending on the job's retry policy.
updateTimeoutoptionalDurationupdate_timeoutoptionalDurationupdateTimeoutoptionalDurationUpdateTimeoutoptionalDurationUpdateTimeoutoptionalDuration#Default: 30 minutes
If so, when an infrastructure update is triggered, any running jobs will be allowed to run until updateTimeout has expired.
updateToLatestImageVersionoptionalbooleanupdate_to_latest_image_versionoptionalboolupdateToLatestImageVersionoptionalBooleanUpdateToLatestImageVersionoptionalboolUpdateToLatestImageVersionoptional*bool= false#If you specify a specific AMI, this property will be ignored.
Note: the CDK will never set this value by default, false will set by CFN. This is to avoid a deployment failure that occurs when this value is set.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection#Default: new subnets will be created