Show / Hide Table of Contents

Interface IManagedEc2EcsComputeEnvironment

A ManagedComputeEnvironment that uses ECS orchestration on EC2 instances.

Inherited Members
IManagedComputeEnvironment.MaxvCpus
IManagedComputeEnvironment.SecurityGroups
IManagedComputeEnvironment.ReplaceComputeEnvironment
IManagedComputeEnvironment.Spot
IManagedComputeEnvironment.TerminateOnUpdate
IManagedComputeEnvironment.UpdateTimeout
IManagedComputeEnvironment.UpdateToLatestImageVersion
IManagedComputeEnvironment.VpcSubnets
IComputeEnvironment.ComputeEnvironmentArn
IComputeEnvironment.ComputeEnvironmentName
IComputeEnvironment.Enabled
IComputeEnvironment.ServiceRole
IResource.ApplyRemovalPolicy(RemovalPolicy)
IResource.Stack
IComputeEnvironmentRef.ComputeEnvironmentRef
IEnvironmentAware.Env
IConnectable.Connections
ITaggable.Tags
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IManagedEc2EcsComputeEnvironment : IManagedComputeEnvironment, IComputeEnvironment, IResource, IComputeEnvironmentRef, IConstruct, IDependable, IEnvironmentAware, IConnectable, ITaggable
Syntax (vb)
Public Interface IManagedEc2EcsComputeEnvironment Inherits IManagedComputeEnvironment, IComputeEnvironment, IResource, IComputeEnvironmentRef, IConstruct, IDependable, IEnvironmentAware, IConnectable, ITaggable

Synopsis

Properties

AllocationStrategy

The allocation strategy to use if not enough instances of the best fitting instance type can be allocated.

Images

Configure which AMIs this Compute Environment can launch.

InstanceClasses

The instance classes that this Compute Environment can launch.

InstanceRole

The execution Role that instances launched by this Compute Environment will use.

InstanceTypes

The instance types that this Compute Environment can launch.

LaunchTemplate

The Launch Template that this Compute Environment will use to provision EC2 Instances.

MinvCpus

The minimum vCPUs that an environment should maintain, even if the compute environment is DISABLED.

PlacementGroup

The EC2 placement group to associate with your compute resources.

SpotBidPercentage

The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched.

SpotFleetRole

The service-linked role that Spot Fleet needs to launch instances on your behalf.

UseOptimalInstanceClasses

Whether or not to use batch's optimal instance type.

Methods

AddInstanceClass(InstanceClass)

Add an instance class to this compute environment.

AddInstanceType(InstanceType)

Add an instance type to this compute environment.

Properties

AllocationStrategy

The allocation strategy to use if not enough instances of the best fitting instance type can be allocated.

AllocationStrategy? AllocationStrategy { get; }
Property Value

AllocationStrategy?

Remarks

Default: - BEST_FIT_PROGRESSIVE if not using Spot instances, SPOT_PRICE_CAPACITY_OPTIMIZED if using Spot instances.

Images

Configure which AMIs this Compute Environment can launch.

IEcsMachineImage[]? Images { get; }
Property Value

IEcsMachineImage[]

Remarks

Leave this undefined to allow Batch to choose the latest AMIs it supports for each instance that it launches.

Default: - ECS_AL2 compatible AMI ids for non-GPU instances, ECS_AL2_NVIDIA compatible AMI ids for GPU instances

InstanceClasses

The instance classes that this Compute Environment can launch.

InstanceClass[] InstanceClasses { get; }
Property Value

InstanceClass[]

Remarks

Which one is chosen depends on the AllocationStrategy used. Batch will automatically choose the size.

InstanceRole

The execution Role that instances launched by this Compute Environment will use.

IRole? InstanceRole { get; }
Property Value

IRole

Remarks

Default: - a role will be created

InstanceTypes

The instance types that this Compute Environment can launch.

InstanceType[] InstanceTypes { get; }
Property Value

InstanceType[]

Remarks

Which one is chosen depends on the AllocationStrategy used.

LaunchTemplate

The Launch Template that this Compute Environment will use to provision EC2 Instances.

ILaunchTemplate? LaunchTemplate { get; }
Property Value

ILaunchTemplate

Remarks

Note: if securityGroups is specified on both your launch template and this Compute Environment, **the securityGroups on the Compute Environment override the ones on the launch template.

Default: no launch template

MinvCpus

The minimum vCPUs that an environment should maintain, even if the compute environment is DISABLED.

double? MinvCpus { get; }
Property Value

double?

Remarks

Default: 0

PlacementGroup

The EC2 placement group to associate with your compute resources.

IPlacementGroup? PlacementGroup { get; }
Property Value

IPlacementGroup

Remarks

If you intend to submit multi-node parallel jobs to this 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.

Default: - no placement group

See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html

SpotBidPercentage

The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched.

double? SpotBidPercentage { get; }
Property Value

double?

Remarks

For example, if your maximum percentage is 20%, the Spot price must be less than 20% of the current On-Demand price for that Instance. You always pay the lowest market price and never more than your maximum percentage. For most use cases, Batch recommends leaving this field empty.

Default: - 100%

SpotFleetRole

The service-linked role that Spot Fleet needs to launch instances on your behalf.

IRole? SpotFleetRole { get; }
Property Value

IRole

Remarks

Default: - a new Role will be created

See: https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html

UseOptimalInstanceClasses

Whether or not to use batch's optimal instance type.

bool? UseOptimalInstanceClasses { get; }
Property Value

bool?

Remarks

The optimal instance type is equivalent to adding the C4, M4, and R4 instance classes. You can specify other instance classes (of the same architecture) in addition to the optimal instance classes.

Default: true

Methods

AddInstanceClass(InstanceClass)

Add an instance class to this compute environment.

void AddInstanceClass(InstanceClass instanceClass)
Parameters
instanceClass InstanceClass

AddInstanceType(InstanceType)

Add an instance type to this compute environment.

void AddInstanceType(InstanceType instanceType)
Parameters
instanceType InstanceType
Back to top Generated by DocFX