Interface ManagedEc2EksComputeEnvironmentProps

All Superinterfaces:
ComputeEnvironmentProps, software.amazon.jsii.JsiiSerializable, ManagedComputeEnvironmentProps
All Known Implementing Classes:
ManagedEc2EksComputeEnvironmentProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:23:57.760Z") @Stability(Stable) public interface ManagedEc2EksComputeEnvironmentProps extends software.amazon.jsii.JsiiSerializable, ManagedComputeEnvironmentProps
Props for a ManagedEc2EksComputeEnvironment.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.batch.*;
 import software.amazon.awscdk.services.ec2.*;
 import software.amazon.awscdk.services.eks.*;
 import software.amazon.awscdk.services.iam.*;
 Cluster cluster;
 InstanceType instanceType;
 LaunchTemplate launchTemplate;
 IMachineImage machineImage;
 PlacementGroup placementGroup;
 Role role;
 SecurityGroup securityGroup;
 Subnet subnet;
 SubnetFilter subnetFilter;
 Vpc vpc;
 ManagedEc2EksComputeEnvironmentProps managedEc2EksComputeEnvironmentProps = ManagedEc2EksComputeEnvironmentProps.builder()
         .eksCluster(cluster)
         .kubernetesNamespace("kubernetesNamespace")
         .vpc(vpc)
         // the properties below are optional
         .allocationStrategy(AllocationStrategy.BEST_FIT)
         .computeEnvironmentName("computeEnvironmentName")
         .enabled(false)
         .images(List.of(EksMachineImage.builder()
                 .image(machineImage)
                 .imageType(EksMachineImageType.EKS_AL2)
                 .build()))
         .instanceClasses(List.of(InstanceClass.STANDARD3))
         .instanceRole(role)
         .instanceTypes(List.of(instanceType))
         .launchTemplate(launchTemplate)
         .maxvCpus(123)
         .minvCpus(123)
         .placementGroup(placementGroup)
         .replaceComputeEnvironment(false)
         .securityGroups(List.of(securityGroup))
         .serviceRole(role)
         .spot(false)
         .spotBidPercentage(123)
         .terminateOnUpdate(false)
         .updateTimeout(Duration.minutes(30))
         .updateToLatestImageVersion(false)
         .useOptimalInstanceClasses(false)
         .vpcSubnets(SubnetSelection.builder()
                 .availabilityZones(List.of("availabilityZones"))
                 .onePerAz(false)
                 .subnetFilters(List.of(subnetFilter))
                 .subnetGroupName("subnetGroupName")
                 .subnets(List.of(subnet))
                 .subnetType(SubnetType.PRIVATE_ISOLATED)
                 .build())
         .build();
 
  • Method Details

    • getEksCluster

      @Stability(Stable) @NotNull ICluster getEksCluster()
      The cluster that backs this Compute Environment. Required for Compute Environments running Kubernetes jobs.

      Please ensure that you have followed the steps at

      https://docs.aws.amazon.com/batch/latest/userguide/getting-started-eks.html

      before attempting to deploy a ManagedEc2EksComputeEnvironment that uses this cluster. If you do not follow the steps in the link, the deployment fail with a message that the compute environment did not stabilize.

    • getKubernetesNamespace

      @Stability(Stable) @NotNull String getKubernetesNamespace()
      The namespace of the Cluster.
    • getAllocationStrategy

      @Stability(Stable) @Nullable default AllocationStrategy getAllocationStrategy()
      The allocation strategy to use if not enough instances of the best fitting instance type can be allocated.

      Default: - `BEST_FIT_PROGRESSIVE` if not using Spot instances, `SPOT_CAPACITY_OPTIMIZED` if using Spot instances.

    • getImages

      @Stability(Stable) @Nullable default List<EksMachineImage> getImages()
      Configure which AMIs this Compute Environment can launch.

      Default: If `imageKubernetesVersion` is specified, - EKS_AL2 for non-GPU instances, EKS_AL2_NVIDIA for GPU instances, Otherwise, - ECS_AL2 for non-GPU instances, ECS_AL2_NVIDIA for GPU instances,

    • getInstanceClasses

      @Stability(Stable) @Nullable default List<InstanceClass> getInstanceClasses()
      The instance types that this Compute Environment can launch.

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

      Default: - the instances Batch considers will be used (currently C4, M4, and R4)

    • getInstanceRole

      @Stability(Stable) @Nullable default IRole getInstanceRole()
      The execution Role that instances launched by this Compute Environment will use.

      Default: - a role will be created

    • getInstanceTypes

      @Stability(Stable) @Nullable default List<InstanceType> getInstanceTypes()
      The instance types that this Compute Environment can launch.

      Which one is chosen depends on the AllocationStrategy used.

      Default: - the instances Batch considers will be used (currently C4, M4, and R4)

    • getLaunchTemplate

      @Stability(Stable) @Nullable default ILaunchTemplate getLaunchTemplate()
      The Launch Template that this Compute Environment will use to provision EC2 Instances.

      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

    • getMinvCpus

      @Stability(Stable) @Nullable default Number getMinvCpus()
      The minimum vCPUs that an environment should maintain, even if the compute environment is DISABLED.

      Default: 0

    • getPlacementGroup

      @Stability(Stable) @Nullable default IPlacementGroup getPlacementGroup()
      The EC2 placement group to associate with your compute resources.

      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 Also:
    • getSpotBidPercentage

      @Stability(Stable) @Nullable default Number getSpotBidPercentage()
      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.

      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.

      Implies spot == true if set

      Default: - 100%

    • getUseOptimalInstanceClasses

      @Stability(Stable) @Nullable default Boolean getUseOptimalInstanceClasses()
      Whether or not to use batch's optimal instance type.

      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

    • builder

      @Stability(Stable) static ManagedEc2EksComputeEnvironmentProps.Builder builder()
      Returns:
      a ManagedEc2EksComputeEnvironmentProps.Builder of ManagedEc2EksComputeEnvironmentProps