Class: AWSCDK::Batch::UnmanagedComputeEnvironmentProps

Inherits:
ComputeEnvironmentProps
  • Object
show all
Defined in:
batch/unmanaged_compute_environment_props.rb

Overview

Represents an UnmanagedComputeEnvironment.

Batch will not provision instances on your behalf in this ComputeEvironment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compute_environment_name: nil, enabled: nil, service_role: nil, unmanagedv_cpus: nil) ⇒ UnmanagedComputeEnvironmentProps

Returns a new instance of UnmanagedComputeEnvironmentProps.

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.

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

    The vCPUs this Compute Environment provides. Used only by the scheduler to schedule jobs in Queues that use FairshareSchedulingPolicys.



14
15
16
17
18
19
20
21
22
23
# File 'batch/unmanaged_compute_environment_props.rb', line 14

def initialize(compute_environment_name: nil, enabled: nil, service_role: nil, unmanagedv_cpus: 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?
  @unmanagedv_cpus = unmanagedv_cpus
  Jsii::Type.check_type(@unmanagedv_cpus, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "unmanagedvCpus") unless @unmanagedv_cpus.nil?
end

Instance Attribute Details

#compute_environment_nameString? (readonly)

Note:

Default: - generated by CloudFormation

The name of the ComputeEnvironment.

Returns:

  • (String, nil)


29
30
31
# File 'batch/unmanaged_compute_environment_props.rb', line 29

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)


45
46
47
# File 'batch/unmanaged_compute_environment_props.rb', line 45

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:



50
51
52
# File 'batch/unmanaged_compute_environment_props.rb', line 50

def service_role
  @service_role
end

#unmanagedv_cpusNumeric? (readonly)

Note:

Default: 0

The vCPUs this Compute Environment provides. Used only by the scheduler to schedule jobs in Queues that use FairshareSchedulingPolicys.

If this parameter is not provided on a fairshare queue, no capacity is reserved; that is, the FairshareSchedulingPolicy is ignored.

Returns:

  • (Numeric, nil)


58
59
60
# File 'batch/unmanaged_compute_environment_props.rb', line 58

def unmanagedv_cpus
  @unmanagedv_cpus
end

Class Method Details

.jsii_propertiesObject



60
61
62
63
64
65
66
67
# File 'batch/unmanaged_compute_environment_props.rb', line 60

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

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
# File 'batch/unmanaged_compute_environment_props.rb', line 69

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