Class: AWSCDK::CodeBuild::ComputeConfiguration

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
code_build/compute_configuration.rb

Overview

The compute configuration for the fleet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(disk: nil, instance_type: nil, machine_type: nil, memory: nil, v_cpu: nil) ⇒ ComputeConfiguration

Returns a new instance of ComputeConfiguration.

Parameters:

  • disk (AWSCDK::Size, nil) (defaults to: nil)

    When using ATTRIBUTE_BASED, the amount of disk space of the instance type included in your fleet.

  • instance_type (AWSCDK::EC2::InstanceType, nil) (defaults to: nil)

    When using CUSTOM_INSTANCE_TYPE, the EC2 instance type to use for fleet instances.

  • machine_type (AWSCDK::CodeBuild::MachineType, nil) (defaults to: nil)

    When using ATTRIBUTE_BASED, the machine type of the instance type included in your fleet.

  • memory (AWSCDK::Size, nil) (defaults to: nil)

    When using ATTRIBUTE_BASED, the amount of memory of the instance type included in your fleet.

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

    When using ATTRIBUTE_BASED, the number of vCPUs of the instance type included in your fleet.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'code_build/compute_configuration.rb', line 12

def initialize(disk: nil, instance_type: nil, machine_type: nil, memory: nil, v_cpu: nil)
  @disk = disk
  Jsii::Type.check_type(@disk, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "disk") unless @disk.nil?
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "instanceType") unless @instance_type.nil?
  @machine_type = machine_type
  Jsii::Type.check_type(@machine_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLk1hY2hpbmVUeXBlIn0=")), "machineType") unless @machine_type.nil?
  @memory = memory
  Jsii::Type.check_type(@memory, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memory") unless @memory.nil?
  @v_cpu = v_cpu
  Jsii::Type.check_type(@v_cpu, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "vCpu") unless @v_cpu.nil?
end

Instance Attribute Details

#diskAWSCDK::Size? (readonly)

Note:

Default: - No requirement, the actual value will be based on the other selected configuration properties

When using ATTRIBUTE_BASED, the amount of disk space of the instance type included in your fleet.

When using CUSTOM_INSTANCE_TYPE, the additional amount of disk space to provision over the 64GB included by default.

Returns:



33
34
35
# File 'code_build/compute_configuration.rb', line 33

def disk
  @disk
end

#instance_typeAWSCDK::EC2::InstanceType? (readonly)

Note:

Default: none

When using CUSTOM_INSTANCE_TYPE, the EC2 instance type to use for fleet instances.

Not all instance types are supported by CodeBuild. If you use a disallowed type, the CloudFormation deployment will fail.



42
43
44
# File 'code_build/compute_configuration.rb', line 42

def instance_type
  @instance_type
end

#machine_typeAWSCDK::CodeBuild::MachineType? (readonly)

Note:

Default: - No requirement, the actual value will be based on the other selected configuration properties

When using ATTRIBUTE_BASED, the machine type of the instance type included in your fleet.



47
48
49
# File 'code_build/compute_configuration.rb', line 47

def machine_type
  @machine_type
end

#memoryAWSCDK::Size? (readonly)

Note:

Default: - No requirement, the actual value will be based on the other selected configuration properties

When using ATTRIBUTE_BASED, the amount of memory of the instance type included in your fleet.

Returns:



52
53
54
# File 'code_build/compute_configuration.rb', line 52

def memory
  @memory
end

#v_cpuNumeric? (readonly)

Note:

Default: - No requirement, the actual value will be based on the other selected configuration properties

When using ATTRIBUTE_BASED, the number of vCPUs of the instance type included in your fleet.

Returns:

  • (Numeric, nil)


57
58
59
# File 'code_build/compute_configuration.rb', line 57

def v_cpu
  @v_cpu
end

Class Method Details

.jsii_propertiesObject



59
60
61
62
63
64
65
66
67
# File 'code_build/compute_configuration.rb', line 59

def self.jsii_properties
  {
    :disk => "disk",
    :instance_type => "instanceType",
    :machine_type => "machineType",
    :memory => "memory",
    :v_cpu => "vCpu",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!({
    "disk" => @disk,
    "instanceType" => @instance_type,
    "machineType" => @machine_type,
    "memory" => @memory,
    "vCpu" => @v_cpu,
  })
  result.compact
end