Interface IManagedEc2EcsComputeEnvironment
A ManagedComputeEnvironment that uses ECS orchestration on EC2 instances.
Inherited Members
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IManagedEc2EcsComputeEnvironment : IManagedComputeEnvironment, IComputeEnvironment, IResource, IConnectable, ITaggable
Syntax (vb)
Public Interface IManagedEc2EcsComputeEnvironment
Inherits IManagedComputeEnvironment, IComputeEnvironment, IResource, IConstruct, IDependable, 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.
virtual Nullable<AllocationStrategy> AllocationStrategy { get; }
Property Value
System.Nullable<AllocationStrategy>
Remarks
Default: - BEST_FIT_PROGRESSIVE
if not using Spot instances,
SPOT_CAPACITY_OPTIMIZED
if using Spot instances.
Images
Configure which AMIs this Compute Environment can launch.
virtual IEcsMachineImage[] Images { get; }
Property Value
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
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.
virtual IRole InstanceRole { get; }
Property Value
Remarks
Default: - a role will be created
InstanceTypes
The instance types that this Compute Environment can launch.
InstanceType[] InstanceTypes { get; }
Property Value
Remarks
Which one is chosen depends on the AllocationStrategy
used.
LaunchTemplate
The Launch Template that this Compute Environment will use to provision EC2 Instances.
virtual ILaunchTemplate LaunchTemplate { get; }
Property Value
Remarks
Note: if securityGroups
is specified on both your
launch template and this Compute Environment, **the
securityGroup
s 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.
virtual Nullable<double> MinvCpus { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 0
PlacementGroup
The EC2 placement group to associate with your compute resources.
virtual IPlacementGroup PlacementGroup { get; }
Property Value
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.
virtual Nullable<double> SpotBidPercentage { get; }
Property Value
System.Nullable<System.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.
virtual IRole SpotFleetRole { get; }
Property Value
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.
virtual Nullable<bool> UseOptimalInstanceClasses { get; }
Property Value
System.Nullable<System.Boolean>
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