Class: AWSCDK::CodeBuild::FleetProps

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

Overview

Construction properties of a CodeBuild Fleet.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_capacity:, compute_type:, environment_type:, compute_configuration: nil, fleet_name: nil, overflow_behavior: nil, role: nil, security_groups: nil, subnet_selection: nil, vpc: nil) ⇒ FleetProps

Returns a new instance of FleetProps.

Parameters:

  • base_capacity (Numeric)

    The number of machines allocated to the compute fleet. Defines the number of builds that can run in parallel.

  • compute_type (AWSCDK::CodeBuild::FleetComputeType)

    The instance type of the compute fleet.

  • environment_type (AWSCDK::CodeBuild::EnvironmentType)

    The build environment (operating system/architecture/accelerator) type made available to projects using this fleet.

  • compute_configuration (AWSCDK::CodeBuild::ComputeConfiguration, nil) (defaults to: nil)

    The compute configuration of the compute fleet.

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

    The name of the Fleet.

  • overflow_behavior (AWSCDK::CodeBuild::FleetOverflowBehavior, nil) (defaults to: nil)

    The compute fleet overflow behavior.

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

    Service Role assumed by Fleet instances.

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

    What security groups to associate with the fleet's network interfaces. If none are provided, one will be created automatically.

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

    Where to place the network interfaces within the VPC.

  • vpc (AWSCDK::EC2::IVPC, nil) (defaults to: nil)

    VPC network to place fleet instance network interfaces.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'code_build/fleet_props.rb', line 17

def initialize(base_capacity:, compute_type:, environment_type:, compute_configuration: nil, fleet_name: nil, overflow_behavior: nil, role: nil, security_groups: nil, subnet_selection: nil, vpc: nil)
  @base_capacity = base_capacity
  Jsii::Type.check_type(@base_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "baseCapacity")
  @compute_type = compute_type
  Jsii::Type.check_type(@compute_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkZsZWV0Q29tcHV0ZVR5cGUifQ==")), "computeType")
  @environment_type = environment_type
  Jsii::Type.check_type(@environment_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkVudmlyb25tZW50VHlwZSJ9")), "environmentType")
  @compute_configuration = compute_configuration.is_a?(Hash) ? ::AWSCDK::CodeBuild::ComputeConfiguration.new(**compute_configuration.transform_keys(&:to_sym)) : compute_configuration
  Jsii::Type.check_type(@compute_configuration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkNvbXB1dGVDb25maWd1cmF0aW9uIn0=")), "computeConfiguration") unless @compute_configuration.nil?
  @fleet_name = fleet_name
  Jsii::Type.check_type(@fleet_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fleetName") unless @fleet_name.nil?
  @overflow_behavior = overflow_behavior
  Jsii::Type.check_type(@overflow_behavior, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkZsZWV0T3ZlcmZsb3dCZWhhdmlvciJ9")), "overflowBehavior") unless @overflow_behavior.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @subnet_selection = subnet_selection.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**subnet_selection.transform_keys(&:to_sym)) : subnet_selection
  Jsii::Type.check_type(@subnet_selection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "subnetSelection") unless @subnet_selection.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil?
end

Instance Attribute Details

#base_capacityNumeric (readonly)

The number of machines allocated to the compute fleet. Defines the number of builds that can run in parallel.

Minimum value of 1.

Returns:

  • (Numeric)


45
46
47
# File 'code_build/fleet_props.rb', line 45

def base_capacity
  @base_capacity
end

#compute_configurationAWSCDK::CodeBuild::ComputeConfiguration? (readonly)

Note:

Default: - do not specify compute configuration

The compute configuration of the compute fleet.

This is only permitted if compute_type is set to ATTRIBUTE_BASED or CUSTOM_INSTANCE_TYPE. In such cases, this is required.



63
64
65
# File 'code_build/fleet_props.rb', line 63

def compute_configuration
  @compute_configuration
end

#compute_typeAWSCDK::CodeBuild::FleetComputeType (readonly)

The instance type of the compute fleet.



50
51
52
# File 'code_build/fleet_props.rb', line 50

def compute_type
  @compute_type
end

#environment_typeAWSCDK::CodeBuild::EnvironmentType (readonly)

The build environment (operating system/architecture/accelerator) type made available to projects using this fleet.



54
55
56
# File 'code_build/fleet_props.rb', line 54

def environment_type
  @environment_type
end

#fleet_nameString? (readonly)

Note:

Default: - CloudFormation generated name

The name of the Fleet.

Returns:

  • (String, nil)


68
69
70
# File 'code_build/fleet_props.rb', line 68

def fleet_name
  @fleet_name
end

#overflow_behaviorAWSCDK::CodeBuild::FleetOverflowBehavior? (readonly)

Note:

Default: undefined - AWS CodeBuild default behavior is QUEUE

The compute fleet overflow behavior.

For overflow behavior QUEUE, overflow builds need to wait on the existing fleet instances to become available.

For overflow behavior ON_DEMAND, overflow builds run on CodeBuild on-demand.



77
78
79
# File 'code_build/fleet_props.rb', line 77

def overflow_behavior
  @overflow_behavior
end

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

Note:

Default: - A role will be created if any permissions are granted

Service Role assumed by Fleet instances.

This Role is not used by Project builds running on Fleet instances; Project builds assume the role on Project instead.

Returns:



85
86
87
# File 'code_build/fleet_props.rb', line 85

def role
  @role
end

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

Note:

Default: - A security group will be automatically created.

What security groups to associate with the fleet's network interfaces. If none are provided, one will be created automatically.

Only used if vpc is supplied.

Returns:



92
93
94
# File 'code_build/fleet_props.rb', line 92

def security_groups
  @security_groups
end

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

Note:

Default: - private subnets if available else public subnets

Where to place the network interfaces within the VPC.

To access AWS services, your fleet needs to be in one of the following types of subnets:

  1. Subnets with access to the internet (of type PRIVATE_WITH_EGRESS).
  2. Private subnets unconnected to the internet, but with VPC endpoints for the necessary services.

If you don't specify a subnet selection, the default behavior is to use PRIVATE_WITH_EGRESS subnets first if they exist, then PRIVATE_WITHOUT_EGRESS, and finally PUBLIC subnets. If your VPC doesn't have PRIVATE_WITH_EGRESS subnets but you need AWS service access, add VPC Endpoints to your private subnets.



107
108
109
# File 'code_build/fleet_props.rb', line 107

def subnet_selection
  @subnet_selection
end

#vpcAWSCDK::EC2::IVPC? (readonly)

Note:

Default: - No VPC is specified.

VPC network to place fleet instance network interfaces.

Specify this if the fleet needs to access resources in a VPC.

Returns:



114
115
116
# File 'code_build/fleet_props.rb', line 114

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'code_build/fleet_props.rb', line 116

def self.jsii_properties
  {
    :base_capacity => "baseCapacity",
    :compute_type => "computeType",
    :environment_type => "environmentType",
    :compute_configuration => "computeConfiguration",
    :fleet_name => "fleetName",
    :overflow_behavior => "overflowBehavior",
    :role => "role",
    :security_groups => "securityGroups",
    :subnet_selection => "subnetSelection",
    :vpc => "vpc",
  }
end

Instance Method Details

#to_jsiiObject



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'code_build/fleet_props.rb', line 131

def to_jsii
  result = {}
  result.merge!({
    "baseCapacity" => @base_capacity,
    "computeType" => @compute_type,
    "environmentType" => @environment_type,
    "computeConfiguration" => @compute_configuration,
    "fleetName" => @fleet_name,
    "overflowBehavior" => @overflow_behavior,
    "role" => @role,
    "securityGroups" => @security_groups,
    "subnetSelection" => @subnet_selection,
    "vpc" => @vpc,
  })
  result.compact
end