Class: AWSCDK::Batch::ComputeEnvironmentProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
batch/compute_environment_props.rb

Overview

Props common to all ComputeEnvironments.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compute_environment_name: nil, enabled: nil, service_role: nil) ⇒ ComputeEnvironmentProps

Returns a new instance of ComputeEnvironmentProps.

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.



10
11
12
13
14
15
16
17
# File 'batch/compute_environment_props.rb', line 10

def initialize(compute_environment_name: nil, enabled: nil, service_role: 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?
end

Instance Attribute Details

#compute_environment_nameString? (readonly)

Note:

Default: - generated by CloudFormation

The name of the ComputeEnvironment.

Returns:

  • (String, nil)


23
24
25
# File 'batch/compute_environment_props.rb', line 23

def compute_environment_name
  @compute_environment_name
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)


39
40
41
# File 'batch/compute_environment_props.rb', line 39

def enabled
  @enabled
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:



44
45
46
# File 'batch/compute_environment_props.rb', line 44

def service_role
  @service_role
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
52
# File 'batch/compute_environment_props.rb', line 46

def self.jsii_properties
  {
    :compute_environment_name => "computeEnvironmentName",
    :enabled => "enabled",
    :service_role => "serviceRole",
  }
end

Instance Method Details

#to_jsiiObject



54
55
56
57
58
59
60
61
62
# File 'batch/compute_environment_props.rb', line 54

def to_jsii
  result = {}
  result.merge!({
    "computeEnvironmentName" => @compute_environment_name,
    "enabled" => @enabled,
    "serviceRole" => @service_role,
  })
  result.compact
end