Class: AWSCDK::Batch::ManagedEC2EKSComputeEnvironmentProps

Inherits:
ManagedEC2ComputeEnvironmentProps
  • Object
show all
Defined in:
batch/managed_ec2_eks_compute_environment_props.rb

Overview

Props for a ManagedEc2EksComputeEnvironment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compute_environment_name: nil, enabled: nil, service_role: nil, vpc:, maxv_cpus: nil, replace_compute_environment: nil, security_groups: nil, spot: nil, terminate_on_update: nil, update_timeout: nil, update_to_latest_image_version: nil, vpc_subnets: nil, instance_classes: nil, instance_types: nil, eks_cluster:, kubernetes_namespace:, allocation_strategy: nil, default_instance_classes: nil, images: nil, instance_role: nil, launch_template: nil, minv_cpus: nil, placement_group: nil, spot_bid_percentage: nil, use_optimal_instance_classes: nil) ⇒ ManagedEC2EKSComputeEnvironmentProps

Returns a new instance of ManagedEC2EKSComputeEnvironmentProps.

Parameters:

  • compute_environment_name (String, nil) (defaults to: nil)

    The name of the ComputeEnvironment.

  • enabled (Boolean, nil) (defaults to: nil)

    Whether or not this ComputeEnvironment can accept jobs from a Queue.

  • service_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The role Batch uses to perform actions on your behalf in your account, such as provision instances to run your jobs.

  • vpc (AWSCDK::EC2::IVPC)

    VPC in which this Compute Environment will launch Instances.

  • maxv_cpus (Numeric, nil) (defaults to: nil)

    The maximum vCpus this ManagedComputeEnvironment can scale up to. Each vCPU is equivalent to 1024 CPU shares.

  • replace_compute_environment (Boolean, nil) (defaults to: nil)

    Specifies whether this Compute Environment is replaced if an update is made that requires replacing its instances.

  • security_groups (Array<AWSCDK::EC2::ISecurityGroup>, nil) (defaults to: nil)

    The security groups this Compute Environment will launch instances in.

  • spot (Boolean, nil) (defaults to: nil)

    Whether or not to use spot instances.

  • terminate_on_update (Boolean, nil) (defaults to: nil)

    Whether or not any running jobs will be immediately terminated when an infrastructure update occurs.

  • update_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    Only meaningful if terminateOnUpdate is false.

  • update_to_latest_image_version (Boolean, nil) (defaults to: nil)

    Whether or not the AMI is updated to the latest one supported by Batch when an infrastructure update occurs.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    The VPC Subnets this Compute Environment will launch instances in.

  • instance_classes (Array<AWSCDK::EC2::InstanceClass>, nil) (defaults to: nil)

    The instance classes that this Compute Environment can launch.

  • instance_types (Array<AWSCDK::EC2::InstanceType>, nil) (defaults to: nil)

    The instance types that this Compute Environment can launch.

  • eks_cluster (AWSCDK::EKS::ICluster)

    The cluster that backs this Compute Environment. Required for Compute Environments running Kubernetes jobs.

  • kubernetes_namespace (String)

    The namespace of the Cluster.

  • allocation_strategy (AWSCDK::Batch::AllocationStrategy, nil) (defaults to: nil)

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

  • default_instance_classes (Array<AWSCDK::Batch::DefaultInstanceClass>, nil) (defaults to: nil)

    Use batch's default instance types.

  • images (Array<AWSCDK::Batch::EKSMachineImage>, nil) (defaults to: nil)

    Configure which AMIs this Compute Environment can launch.

  • instance_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

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

  • launch_template (AWSCDK::EC2::ILaunchTemplate, nil) (defaults to: nil)

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

  • minv_cpus (Numeric, nil) (defaults to: nil)

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

  • placement_group (AWSCDK::Interfaces::AWSEC2::IPlacementGroupRef, nil) (defaults to: nil)

    The EC2 placement group to associate with your compute resources.

  • spot_bid_percentage (Numeric, nil) (defaults to: nil)

    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.

  • use_optimal_instance_classes (Boolean, nil) (defaults to: nil)

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



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 32

def initialize(compute_environment_name: nil, enabled: nil, service_role: nil, vpc:, maxv_cpus: nil, replace_compute_environment: nil, security_groups: nil, spot: nil, terminate_on_update: nil, update_timeout: nil, update_to_latest_image_version: nil, vpc_subnets: nil, instance_classes: nil, instance_types: nil, eks_cluster:, kubernetes_namespace:, allocation_strategy: nil, default_instance_classes: nil, images: nil, instance_role: nil, launch_template: nil, minv_cpus: nil, placement_group: nil, spot_bid_percentage: nil, use_optimal_instance_classes: nil)
  @compute_environment_name = compute_environment_name
  Jsii::Type.check_type(@compute_environment_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "computeEnvironmentName") unless @compute_environment_name.nil?
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil?
  @service_role = service_role
  Jsii::Type.check_type(@service_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "serviceRole") unless @service_role.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @maxv_cpus = maxv_cpus
  Jsii::Type.check_type(@maxv_cpus, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxvCpus") unless @maxv_cpus.nil?
  @replace_compute_environment = replace_compute_environment
  Jsii::Type.check_type(@replace_compute_environment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "replaceComputeEnvironment") unless @replace_compute_environment.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @spot = spot
  Jsii::Type.check_type(@spot, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "spot") unless @spot.nil?
  @terminate_on_update = terminate_on_update
  Jsii::Type.check_type(@terminate_on_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "terminateOnUpdate") unless @terminate_on_update.nil?
  @update_timeout = update_timeout
  Jsii::Type.check_type(@update_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "updateTimeout") unless @update_timeout.nil?
  @update_to_latest_image_version = update_to_latest_image_version
  Jsii::Type.check_type(@update_to_latest_image_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "updateToLatestImageVersion") unless @update_to_latest_image_version.nil?
  @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets
  Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil?
  @instance_classes = instance_classes
  Jsii::Type.check_type(@instance_classes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSW5zdGFuY2VDbGFzcyJ9LCJraW5kIjoiYXJyYXkifX0=")), "instanceClasses") unless @instance_classes.nil?
  @instance_types = instance_types
  Jsii::Type.check_type(@instance_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSW5zdGFuY2VUeXBlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "instanceTypes") unless @instance_types.nil?
  @eks_cluster = eks_cluster
  Jsii::Type.check_type(@eks_cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklDbHVzdGVyIn0=")), "eksCluster")
  @kubernetes_namespace = kubernetes_namespace
  Jsii::Type.check_type(@kubernetes_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kubernetesNamespace")
  @allocation_strategy = allocation_strategy
  Jsii::Type.check_type(@allocation_strategy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guQWxsb2NhdGlvblN0cmF0ZWd5In0=")), "allocationStrategy") unless @allocation_strategy.nil?
  @default_instance_classes = default_instance_classes
  Jsii::Type.check_type(@default_instance_classes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5EZWZhdWx0SW5zdGFuY2VDbGFzcyJ9LCJraW5kIjoiYXJyYXkifX0=")), "defaultInstanceClasses") unless @default_instance_classes.nil?
  @images = images.is_a?(Array) ? images.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Batch::EKSMachineImage.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : images
  Jsii::Type.check_type(@images, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5Fa3NNYWNoaW5lSW1hZ2UifSwia2luZCI6ImFycmF5In19")), "images") unless @images.nil?
  @instance_role = instance_role
  Jsii::Type.check_type(@instance_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "instanceRole") unless @instance_role.nil?
  @launch_template = launch_template
  Jsii::Type.check_type(@launch_template, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklMYXVuY2hUZW1wbGF0ZSJ9")), "launchTemplate") unless @launch_template.nil?
  @minv_cpus = minv_cpus
  Jsii::Type.check_type(@minv_cpus, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minvCpus") unless @minv_cpus.nil?
  @placement_group = placement_group
  Jsii::Type.check_type(@placement_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19lYzIuSVBsYWNlbWVudEdyb3VwUmVmIn0=")), "placementGroup") unless @placement_group.nil?
  @spot_bid_percentage = spot_bid_percentage
  Jsii::Type.check_type(@spot_bid_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "spotBidPercentage") unless @spot_bid_percentage.nil?
  @use_optimal_instance_classes = use_optimal_instance_classes
  Jsii::Type.check_type(@use_optimal_instance_classes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "useOptimalInstanceClasses") unless @use_optimal_instance_classes.nil?
end

Instance Attribute Details

#allocation_strategyAWSCDK::Batch::AllocationStrategy? (readonly)

Note:

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

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



227
228
229
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 227

def allocation_strategy
  @allocation_strategy
end

#compute_environment_nameString? (readonly)

Note:

Default: - generated by CloudFormation

The name of the ComputeEnvironment.

Returns:

  • (String, nil)


89
90
91
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 89

def compute_environment_name
  @compute_environment_name
end

#default_instance_classesArray<AWSCDK::Batch::DefaultInstanceClass>? (readonly)

Note:

Default: - choose from instanceTypes and instanceClasses

Use batch's default instance types.

A simpler way to choose up-to-date instance classes based on region instead of specifying exact instance classes.



236
237
238
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 236

def default_instance_classes
  @default_instance_classes
end

#eks_clusterAWSCDK::EKS::ICluster (readonly)

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.



218
219
220
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 218

def eks_cluster
  @eks_cluster
end

#enabledBoolean? (readonly)

Note:

Default: true

Whether or not this ComputeEnvironment can accept jobs from a Queue.

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 minv_cpus.

To ensure you aren't billed for unused capacity, set minv_cpus to 0.

Returns:

  • (Boolean, nil)


105
106
107
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 105

def enabled
  @enabled
end

#imagesArray<AWSCDK::Batch::EKSMachineImage>? (readonly)

Note:

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. If the '@aws-cdk/aws-batch:defaultToAL2023' feature flag is set, EKS_AL2023 / ECS_AL2023 will be used instead.

Configure which AMIs this Compute Environment can launch.

Returns:



241
242
243
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 241

def images
  @images
end

#instance_classesArray<AWSCDK::EC2::InstanceClass>? (readonly)

Note:

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

The instance classes that this Compute Environment can launch.

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

Returns:



199
200
201
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 199

def instance_classes
  @instance_classes
end

#instance_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - a role will be created

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

Returns:



246
247
248
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 246

def instance_role
  @instance_role
end

#instance_typesArray<AWSCDK::EC2::InstanceType>? (readonly)

Note:

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

The instance types that this Compute Environment can launch.

Which one is chosen depends on the AllocationStrategy used.

Returns:



206
207
208
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 206

def instance_types
  @instance_types
end

#kubernetes_namespaceString (readonly)

The namespace of the Cluster.

Returns:

  • (String)


222
223
224
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 222

def kubernetes_namespace
  @kubernetes_namespace
end

#launch_templateAWSCDK::EC2::ILaunchTemplate? (readonly)

Note:

Default: - no launch template

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

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



256
257
258
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 256

def launch_template
  @launch_template
end

#maxv_cpusNumeric? (readonly)

Note:

Default: 256

The maximum vCpus this ManagedComputeEnvironment can scale up to. Each vCPU is equivalent to 1024 CPU shares.

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 instance_types or instance_classes.

Returns:

  • (Numeric, nil)


124
125
126
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 124

def maxv_cpus
  @maxv_cpus
end

#minv_cpusNumeric? (readonly)

Note:

Default: 0

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

Returns:

  • (Numeric, nil)


261
262
263
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 261

def minv_cpus
  @minv_cpus
end

#placement_groupAWSCDK::Interfaces::AWSEC2::IPlacementGroupRef? (readonly)

Note:

Default: - no placement group

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.



272
273
274
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 272

def placement_group
  @placement_group
end

#replace_compute_environmentBoolean? (readonly)

Note:

Default: false

Specifies whether this Compute Environment is replaced if an update is made that requires replacing its instances.

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:



142
143
144
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 142

def replace_compute_environment
  @replace_compute_environment
end

#security_groupsArray<AWSCDK::EC2::ISecurityGroup>? (readonly)

Note:

Default: new security groups will be created

The security groups this Compute Environment will launch instances in.

Returns:



147
148
149
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 147

def security_groups
  @security_groups
end

#service_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - a serviceRole will be created for managed CEs, none for unmanaged CEs

The role Batch uses to perform actions on your behalf in your account, such as provision instances to run your jobs.

Returns:



110
111
112
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 110

def service_role
  @service_role
end

#spotBoolean? (readonly)

Note:

Default: false

Whether or not to use spot instances.

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.

Returns:

  • (Boolean, nil)


156
157
158
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 156

def spot
  @spot
end

#spot_bid_percentageNumeric? (readonly)

Note:

Default: - 100%

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

Returns:

  • (Numeric, nil)


284
285
286
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 284

def spot_bid_percentage
  @spot_bid_percentage
end

#terminate_on_updateBoolean? (readonly)

Note:

Default: false

Whether or not any running jobs will be immediately terminated when an infrastructure update occurs.

If this is enabled, any terminated jobs may be retried, depending on the job's retry policy.



165
166
167
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 165

def terminate_on_update
  @terminate_on_update
end

#update_timeoutAWSCDK::Duration? (readonly)

Note:

Default: 30 minutes

Only meaningful if terminateOnUpdate is false.

If so, when an infrastructure update is triggered, any running jobs will be allowed to run until update_timeout has expired.



175
176
177
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 175

def update_timeout
  @update_timeout
end

#update_to_latest_image_versionBoolean? (readonly)

Note:

Default: false

Whether or not the AMI is updated to the latest one supported by Batch when an infrastructure update occurs.

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.

Returns:

  • (Boolean, nil)

See Also:



186
187
188
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 186

def update_to_latest_image_version
  @update_to_latest_image_version
end

#use_optimal_instance_classesBoolean? (readonly)

Note:

Default: true

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.

Returns:

  • (Boolean, nil)


293
294
295
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 293

def use_optimal_instance_classes
  @use_optimal_instance_classes
end

#vpcAWSCDK::EC2::IVPC (readonly)

VPC in which this Compute Environment will launch Instances.

Returns:



114
115
116
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 114

def vpc
  @vpc
end

#vpc_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: new subnets will be created

The VPC Subnets this Compute Environment will launch instances in.



191
192
193
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 191

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 295

def self.jsii_properties
  {
    :compute_environment_name => "computeEnvironmentName",
    :enabled => "enabled",
    :service_role => "serviceRole",
    :vpc => "vpc",
    :maxv_cpus => "maxvCpus",
    :replace_compute_environment => "replaceComputeEnvironment",
    :security_groups => "securityGroups",
    :spot => "spot",
    :terminate_on_update => "terminateOnUpdate",
    :update_timeout => "updateTimeout",
    :update_to_latest_image_version => "updateToLatestImageVersion",
    :vpc_subnets => "vpcSubnets",
    :instance_classes => "instanceClasses",
    :instance_types => "instanceTypes",
    :eks_cluster => "eksCluster",
    :kubernetes_namespace => "kubernetesNamespace",
    :allocation_strategy => "allocationStrategy",
    :default_instance_classes => "defaultInstanceClasses",
    :images => "images",
    :instance_role => "instanceRole",
    :launch_template => "launchTemplate",
    :minv_cpus => "minvCpus",
    :placement_group => "placementGroup",
    :spot_bid_percentage => "spotBidPercentage",
    :use_optimal_instance_classes => "useOptimalInstanceClasses",
  }
end

Instance Method Details

#to_jsiiObject



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
# File 'batch/managed_ec2_eks_compute_environment_props.rb', line 325

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "computeEnvironmentName" => @compute_environment_name,
    "enabled" => @enabled,
    "serviceRole" => @service_role,
    "vpc" => @vpc,
    "maxvCpus" => @maxv_cpus,
    "replaceComputeEnvironment" => @replace_compute_environment,
    "securityGroups" => @security_groups,
    "spot" => @spot,
    "terminateOnUpdate" => @terminate_on_update,
    "updateTimeout" => @update_timeout,
    "updateToLatestImageVersion" => @update_to_latest_image_version,
    "vpcSubnets" => @vpc_subnets,
    "instanceClasses" => @instance_classes,
    "instanceTypes" => @instance_types,
    "eksCluster" => @eks_cluster,
    "kubernetesNamespace" => @kubernetes_namespace,
    "allocationStrategy" => @allocation_strategy,
    "defaultInstanceClasses" => @default_instance_classes,
    "images" => @images,
    "instanceRole" => @instance_role,
    "launchTemplate" => @launch_template,
    "minvCpus" => @minv_cpus,
    "placementGroup" => @placement_group,
    "spotBidPercentage" => @spot_bid_percentage,
    "useOptimalInstanceClasses" => @use_optimal_instance_classes,
  })
  result.compact
end