Class: AWSCDK::Pipelines::CodeBuildOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pipelines/code_build_options.rb

Overview

Options for customizing a single CodeBuild project.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build_environment: nil, cache: nil, file_system_locations: nil, logging: nil, partial_build_spec: nil, role_policy: nil, security_groups: nil, subnet_selection: nil, timeout: nil, vpc: nil) ⇒ CodeBuildOptions

Returns a new instance of CodeBuildOptions.

Parameters:



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

def initialize(build_environment: nil, cache: nil, file_system_locations: nil, logging: nil, partial_build_spec: nil, role_policy: nil, security_groups: nil, subnet_selection: nil, timeout: nil, vpc: nil)
  @build_environment = build_environment.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildEnvironment.new(**build_environment.transform_keys(&:to_sym)) : build_environment
  Jsii::Type.check_type(@build_environment, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkRW52aXJvbm1lbnQifQ==")), "buildEnvironment") unless @build_environment.nil?
  @cache = cache
  Jsii::Type.check_type(@cache, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkNhY2hlIn0=")), "cache") unless @cache.nil?
  @file_system_locations = file_system_locations
  Jsii::Type.check_type(@file_system_locations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuSUZpbGVTeXN0ZW1Mb2NhdGlvbiJ9LCJraW5kIjoiYXJyYXkifX0=")), "fileSystemLocations") unless @file_system_locations.nil?
  @logging = logging.is_a?(Hash) ? ::AWSCDK::CodeBuild::LoggingOptions.new(**logging.transform_keys(&:to_sym)) : logging
  Jsii::Type.check_type(@logging, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkxvZ2dpbmdPcHRpb25zIn0=")), "logging") unless @logging.nil?
  @partial_build_spec = partial_build_spec
  Jsii::Type.check_type(@partial_build_spec, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkU3BlYyJ9")), "partialBuildSpec") unless @partial_build_spec.nil?
  @role_policy = role_policy
  Jsii::Type.check_type(@role_policy, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pYW0uUG9saWN5U3RhdGVtZW50In0sImtpbmQiOiJhcnJheSJ9fQ==")), "rolePolicy") unless @role_policy.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?
  @timeout = timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil?
end

Instance Attribute Details

#build_environmentAWSCDK::CodeBuild::BuildEnvironment? (readonly)

Note:

Default: - Non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0

Partial build environment, will be combined with other build environments that apply.



44
45
46
# File 'pipelines/code_build_options.rb', line 44

def build_environment
  @build_environment
end

#cacheAWSCDK::CodeBuild::Cache? (readonly)

Note:

Default: - No cache

Caching strategy to use.

Returns:



49
50
51
# File 'pipelines/code_build_options.rb', line 49

def cache
  @cache
end

#file_system_locationsArray<AWSCDK::CodeBuild::IFileSystemLocation>? (readonly)

Note:

Default: - no file system locations

ProjectFileSystemLocation objects for CodeBuild build projects.

A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System. Requires a vpc to be set and privileged to be set to true.



58
59
60
# File 'pipelines/code_build_options.rb', line 58

def file_system_locations
  @file_system_locations
end

#loggingAWSCDK::CodeBuild::LoggingOptions? (readonly)

Note:

Default: - no log configuration is set

Information about logs for CodeBuild projects.

A CodeBuild project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.



65
66
67
# File 'pipelines/code_build_options.rb', line 65

def logging
  @logging
end

#partial_build_specAWSCDK::CodeBuild::BuildSpec? (readonly)

Note:

Default: - No initial BuildSpec

Partial buildspec, will be combined with other buildspecs that apply.

The BuildSpec must be available inline--it cannot reference a file on disk.



73
74
75
# File 'pipelines/code_build_options.rb', line 73

def partial_build_spec
  @partial_build_spec
end

#role_policyArray<AWSCDK::IAM::PolicyStatement>? (readonly)

Note:

Default: - No policy statements added to CodeBuild Project Role

Policy statements to add to role.

Returns:



78
79
80
# File 'pipelines/code_build_options.rb', line 78

def role_policy
  @role_policy
end

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

Note:

Default: - Security group will be automatically created.

Which security group(s) to associate with the project network interfaces.

Only used if 'vpc' is supplied.

Returns:



85
86
87
# File 'pipelines/code_build_options.rb', line 85

def security_groups
  @security_groups
end

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

Note:

Default: - All private subnets.

Which subnets to use.

Only used if 'vpc' is supplied.



92
93
94
# File 'pipelines/code_build_options.rb', line 92

def subnet_selection
  @subnet_selection
end

#timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.hours(1)

The number of minutes after which AWS CodeBuild stops the build if it's not complete.

For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.

Returns:



100
101
102
# File 'pipelines/code_build_options.rb', line 100

def timeout
  @timeout
end

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

Note:

Default: - No VPC

The VPC where to create the CodeBuild network interfaces in.

Returns:



105
106
107
# File 'pipelines/code_build_options.rb', line 105

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'pipelines/code_build_options.rb', line 107

def self.jsii_properties
  {
    :build_environment => "buildEnvironment",
    :cache => "cache",
    :file_system_locations => "fileSystemLocations",
    :logging => "logging",
    :partial_build_spec => "partialBuildSpec",
    :role_policy => "rolePolicy",
    :security_groups => "securityGroups",
    :subnet_selection => "subnetSelection",
    :timeout => "timeout",
    :vpc => "vpc",
  }
end

Instance Method Details

#to_jsiiObject



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'pipelines/code_build_options.rb', line 122

def to_jsii
  result = {}
  result.merge!({
    "buildEnvironment" => @build_environment,
    "cache" => @cache,
    "fileSystemLocations" => @file_system_locations,
    "logging" => @logging,
    "partialBuildSpec" => @partial_build_spec,
    "rolePolicy" => @role_policy,
    "securityGroups" => @security_groups,
    "subnetSelection" => @subnet_selection,
    "timeout" => @timeout,
    "vpc" => @vpc,
  })
  result.compact
end