Class: AWSCDK::CodeBuild::CfnFleetProps

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

Overview

Properties for defining a CfnFleet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_capacity: nil, compute_configuration: nil, compute_type: nil, environment_type: nil, fleet_proxy_configuration: nil, fleet_service_role: nil, fleet_vpc_config: nil, image_id: nil, name: nil, overflow_behavior: nil, scaling_configuration: nil, tags: nil) ⇒ CfnFleetProps

Returns a new instance of CfnFleetProps.

Parameters:

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

    The initial number of machines allocated to the compute fleet, which defines the number of builds that can run in parallel.

  • compute_configuration (AWSCDK::IResolvable, AWSCDK::CodeBuild::CfnFleet::ComputeConfigurationProperty, nil) (defaults to: nil)

    The compute configuration of the compute fleet.

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

    Information about the compute resources the compute fleet uses. Available values include:.

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

    The environment type of the compute fleet.

  • fleet_proxy_configuration (AWSCDK::IResolvable, AWSCDK::CodeBuild::CfnFleet::ProxyConfigurationProperty, nil) (defaults to: nil)

    Information about the proxy configurations that apply network access control to your reserved capacity instances.

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

    The service role associated with the compute fleet.

  • fleet_vpc_config (AWSCDK::IResolvable, AWSCDK::CodeBuild::CfnFleet::VPCConfigProperty, nil) (defaults to: nil)

    Information about the VPC configuration that AWS CodeBuild accesses.

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

    The Amazon Machine Image (AMI) of the compute fleet.

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

    The name of the compute fleet.

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

    The compute fleet overflow behavior.

  • scaling_configuration (AWSCDK::IResolvable, AWSCDK::CodeBuild::CfnFleet::ScalingConfigurationInputProperty, nil) (defaults to: nil)

    The scaling configuration of the compute fleet.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    A list of tag key and value pairs associated with this compute fleet.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'code_build/cfn_fleet_props.rb', line 21

def initialize(base_capacity: nil, compute_configuration: nil, compute_type: nil, environment_type: nil, fleet_proxy_configuration: nil, fleet_service_role: nil, fleet_vpc_config: nil, image_id: nil, name: nil, overflow_behavior: nil, scaling_configuration: nil, tags: nil)
  @base_capacity = base_capacity
  Jsii::Type.check_type(@base_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "baseCapacity") unless @base_capacity.nil?
  @compute_configuration = compute_configuration.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnFleet::ComputeConfigurationProperty.new(**compute_configuration.transform_keys(&:to_sym)) : compute_configuration
  Jsii::Type.check_type(@compute_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuRmxlZXQuQ29tcHV0ZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "computeConfiguration") unless @compute_configuration.nil?
  @compute_type = compute_type
  Jsii::Type.check_type(@compute_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "computeType") unless @compute_type.nil?
  @environment_type = environment_type
  Jsii::Type.check_type(@environment_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "environmentType") unless @environment_type.nil?
  @fleet_proxy_configuration = fleet_proxy_configuration.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnFleet::ProxyConfigurationProperty.new(**fleet_proxy_configuration.transform_keys(&:to_sym)) : fleet_proxy_configuration
  Jsii::Type.check_type(@fleet_proxy_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuRmxlZXQuUHJveHlDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "fleetProxyConfiguration") unless @fleet_proxy_configuration.nil?
  @fleet_service_role = fleet_service_role
  Jsii::Type.check_type(@fleet_service_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fleetServiceRole") unless @fleet_service_role.nil?
  @fleet_vpc_config = fleet_vpc_config.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnFleet::VPCConfigProperty.new(**fleet_vpc_config.transform_keys(&:to_sym)) : fleet_vpc_config
  Jsii::Type.check_type(@fleet_vpc_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuRmxlZXQuVnBjQ29uZmlnUHJvcGVydHkifV19fQ==")), "fleetVpcConfig") unless @fleet_vpc_config.nil?
  @image_id = image_id
  Jsii::Type.check_type(@image_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imageId") unless @image_id.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @overflow_behavior = overflow_behavior
  Jsii::Type.check_type(@overflow_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "overflowBehavior") unless @overflow_behavior.nil?
  @scaling_configuration = scaling_configuration.is_a?(Hash) ? ::AWSCDK::CodeBuild::CfnFleet::ScalingConfigurationInputProperty.new(**scaling_configuration.transform_keys(&:to_sym)) : scaling_configuration
  Jsii::Type.check_type(@scaling_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQ2ZuRmxlZXQuU2NhbGluZ0NvbmZpZ3VyYXRpb25JbnB1dFByb3BlcnR5In1dfX0=")), "scalingConfiguration") unless @scaling_configuration.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#base_capacityNumeric? (readonly)

The initial number of machines allocated to the compute fleet, which defines the number of builds that can run in parallel.



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

def base_capacity
  @base_capacity
end

#compute_configurationAWSCDK::IResolvable, ... (readonly)

The compute configuration of the compute fleet.

This is only required if compute_type is set to ATTRIBUTE_BASED_COMPUTE or CUSTOM_INSTANCE_TYPE .



59
60
61
# File 'code_build/cfn_fleet_props.rb', line 59

def compute_configuration
  @compute_configuration
end

#compute_typeString? (readonly)

Information about the compute resources the compute fleet uses. Available values include:.

  • ATTRIBUTE_BASED_COMPUTE : Specify the amount of vCPUs, memory, disk space, and the type of machine.

If you use ATTRIBUTE_BASED_COMPUTE , you must define your attributes by using compute_configuration . AWS CodeBuild will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved capacity environment types in the AWS CodeBuild User Guide .

  • BUILD_GENERAL1_SMALL : Use up to 4 GiB memory and 2 vCPUs for builds.
  • BUILD_GENERAL1_MEDIUM : Use up to 8 GiB memory and 4 vCPUs for builds.
  • BUILD_GENERAL1_LARGE : Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type.
  • BUILD_GENERAL1_XLARGE : Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type.
  • BUILD_GENERAL1_2XLARGE : Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute type supports Docker images up to 100 GB uncompressed.
  • BUILD_LAMBDA_1GB : Use up to 1 GiB memory for builds. Only available for environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER .
  • BUILD_LAMBDA_2GB : Use up to 2 GiB memory for builds. Only available for environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER .
  • BUILD_LAMBDA_4GB : Use up to 4 GiB memory for builds. Only available for environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER .
  • BUILD_LAMBDA_8GB : Use up to 8 GiB memory for builds. Only available for environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER .
  • BUILD_LAMBDA_10GB : Use up to 10 GiB memory for builds. Only available for environment type LINUX_LAMBDA_CONTAINER and ARM_LAMBDA_CONTAINER .

If you use BUILD_GENERAL1_SMALL :

  • For environment type LINUX_CONTAINER , you can use up to 4 GiB memory and 2 vCPUs for builds.
  • For environment type LINUX_GPU_CONTAINER , you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core GPU for builds.
  • For environment type ARM_CONTAINER , you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for builds.

If you use BUILD_GENERAL1_LARGE :

  • For environment type LINUX_CONTAINER , you can use up to 16 GiB memory and 8 vCPUs for builds.
  • For environment type LINUX_GPU_CONTAINER , you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds.
  • For environment type ARM_CONTAINER , you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for builds.

For more information, see On-demand environment types in the AWS CodeBuild User Guide.



93
94
95
# File 'code_build/cfn_fleet_props.rb', line 93

def compute_type
  @compute_type
end

#environment_typeString? (readonly)

The environment type of the compute fleet.

  • The environment type ARM_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), EU (Frankfurt), and South America (São Paulo).
  • The environment type ARM_EC2 is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai).
  • The environment type LINUX_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai).
  • The environment type LINUX_EC2 is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai).
  • The environment type LINUX_GPU_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), and Asia Pacific (Sydney).
  • The environment type MAC_ARM is available only in regions US East (Ohio), US East (N. Virginia), US West (Oregon), Europe (Frankfurt), and Asia Pacific (Sydney).
  • The environment type WINDOWS_EC2 is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), South America (São Paulo), and Asia Pacific (Mumbai).
  • The environment type WINDOWS_SERVER_2019_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), Asia Pacific (Sydney), Asia Pacific (Tokyo), Asia Pacific (Mumbai) and EU (Ireland).
  • The environment type WINDOWS_SERVER_2022_CONTAINER is available only in regions US East (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), EU (Frankfurt), Asia Pacific (Sydney), Asia Pacific (Singapore), Asia Pacific (Tokyo), South America (São Paulo) and Asia Pacific (Mumbai).

For more information, see Build environment compute types in the AWS CodeBuild user guide .



110
111
112
# File 'code_build/cfn_fleet_props.rb', line 110

def environment_type
  @environment_type
end

#fleet_proxy_configurationAWSCDK::IResolvable, ... (readonly)

Information about the proxy configurations that apply network access control to your reserved capacity instances.



115
116
117
# File 'code_build/cfn_fleet_props.rb', line 115

def fleet_proxy_configuration
  @fleet_proxy_configuration
end

#fleet_service_roleString? (readonly)

The service role associated with the compute fleet.

For more information, see Allow a user to add a permission policy for a fleet service role in the AWS CodeBuild User Guide .



122
123
124
# File 'code_build/cfn_fleet_props.rb', line 122

def fleet_service_role
  @fleet_service_role
end

#fleet_vpc_configAWSCDK::IResolvable, ... (readonly)

Information about the VPC configuration that AWS CodeBuild accesses.



127
128
129
# File 'code_build/cfn_fleet_props.rb', line 127

def fleet_vpc_config
  @fleet_vpc_config
end

#image_idString? (readonly)

The Amazon Machine Image (AMI) of the compute fleet.



132
133
134
# File 'code_build/cfn_fleet_props.rb', line 132

def image_id
  @image_id
end

#nameString? (readonly)

The name of the compute fleet.



137
138
139
# File 'code_build/cfn_fleet_props.rb', line 137

def name
  @name
end

#overflow_behaviorString? (readonly)

The compute fleet overflow behavior.

  • For overflow behavior QUEUE , your overflow builds need to wait on the existing fleet instance to become available.
  • For overflow behavior ON_DEMAND , your overflow builds run on CodeBuild on-demand.

If you choose to set your overflow behavior to on-demand while creating a VPC-connected fleet, make sure that you add the required VPC permissions to your project service role. For more information, see Example policy statement to allow CodeBuild access to AWS services required to create a VPC network interface .



147
148
149
# File 'code_build/cfn_fleet_props.rb', line 147

def overflow_behavior
  @overflow_behavior
end

#scaling_configurationAWSCDK::IResolvable, ... (readonly)

The scaling configuration of the compute fleet.



152
153
154
# File 'code_build/cfn_fleet_props.rb', line 152

def scaling_configuration
  @scaling_configuration
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

A list of tag key and value pairs associated with this compute fleet.

These tags are available for use by AWS services that support AWS CodeBuild compute fleet tags.



159
160
161
# File 'code_build/cfn_fleet_props.rb', line 159

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'code_build/cfn_fleet_props.rb', line 161

def self.jsii_properties
  {
    :base_capacity => "baseCapacity",
    :compute_configuration => "computeConfiguration",
    :compute_type => "computeType",
    :environment_type => "environmentType",
    :fleet_proxy_configuration => "fleetProxyConfiguration",
    :fleet_service_role => "fleetServiceRole",
    :fleet_vpc_config => "fleetVpcConfig",
    :image_id => "imageId",
    :name => "name",
    :overflow_behavior => "overflowBehavior",
    :scaling_configuration => "scalingConfiguration",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'code_build/cfn_fleet_props.rb', line 178

def to_jsii
  result = {}
  result.merge!({
    "baseCapacity" => @base_capacity,
    "computeConfiguration" => @compute_configuration,
    "computeType" => @compute_type,
    "environmentType" => @environment_type,
    "fleetProxyConfiguration" => @fleet_proxy_configuration,
    "fleetServiceRole" => @fleet_service_role,
    "fleetVpcConfig" => @fleet_vpc_config,
    "imageId" => @image_id,
    "name" => @name,
    "overflowBehavior" => @overflow_behavior,
    "scalingConfiguration" => @scaling_configuration,
    "tags" => @tags,
  })
  result.compact
end