Class: AWSCDK::CodeBuild::BuildEnvironment

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build_image: nil, certificate: nil, compute_type: nil, docker_server: nil, environment_variables: nil, fleet: nil, privileged: nil) ⇒ BuildEnvironment

Returns a new instance of BuildEnvironment.

Parameters:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'code_build/build_environment.rb', line 13

def initialize(build_image: nil, certificate: nil, compute_type: nil, docker_server: nil, environment_variables: nil, fleet: nil, privileged: nil)
  @build_image = build_image
  Jsii::Type.check_type(@build_image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklCdWlsZEltYWdlIn0=")), "buildImage") unless @build_image.nil?
  @certificate = certificate.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildEnvironmentCertificate.new(**certificate.transform_keys(&:to_sym)) : certificate
  Jsii::Type.check_type(@certificate, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkRW52aXJvbm1lbnRDZXJ0aWZpY2F0ZSJ9")), "certificate") unless @certificate.nil?
  @compute_type = compute_type
  Jsii::Type.check_type(@compute_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkNvbXB1dGVUeXBlIn0=")), "computeType") unless @compute_type.nil?
  @docker_server = docker_server.is_a?(Hash) ? ::AWSCDK::CodeBuild::DockerServerOptions.new(**docker_server.transform_keys(&:to_sym)) : docker_server
  Jsii::Type.check_type(@docker_server, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkRvY2tlclNlcnZlck9wdGlvbnMifQ==")), "dockerServer") unless @docker_server.nil?
  @environment_variables = environment_variables.is_a?(Hash) ? environment_variables.transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildEnvironmentVariable.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : environment_variables
  Jsii::Type.check_type(@environment_variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2RlYnVpbGQuQnVpbGRFbnZpcm9ubWVudFZhcmlhYmxlIn0sImtpbmQiOiJtYXAifX0=")), "environmentVariables") unless @environment_variables.nil?
  @fleet = fleet
  Jsii::Type.check_type(@fleet, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklGbGVldCJ9")), "fleet") unless @fleet.nil?
  @privileged = privileged
  Jsii::Type.check_type(@privileged, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "privileged") unless @privileged.nil?
end

Instance Attribute Details

#build_imageAWSCDK::CodeBuild::IBuildImage? (readonly)

Note:

Default: LinuxBuildImage.STANDARD_7_0

The image used for the builds.



34
35
36
# File 'code_build/build_environment.rb', line 34

def build_image
  @build_image
end

#certificateAWSCDK::CodeBuild::BuildEnvironmentCertificate? (readonly)

Note:

Default: - No external certificate is added to the project

The location of the PEM-encoded certificate for the build project.



39
40
41
# File 'code_build/build_environment.rb', line 39

def certificate
  @certificate
end

#compute_typeAWSCDK::CodeBuild::ComputeType? (readonly)

Note:

Default: taken from #buildImage#defaultComputeType

The type of compute to use for this build.

See the ComputeType enum for the possible values.



46
47
48
# File 'code_build/build_environment.rb', line 46

def compute_type
  @compute_type
end

#docker_serverAWSCDK::CodeBuild::DockerServerOptions? (readonly)

Note:

Default: - Doesn't use remote docker server

The Docker server configuration CodeBuild use to build your Docker image.



51
52
53
# File 'code_build/build_environment.rb', line 51

def docker_server
  @docker_server
end

#environment_variablesHash{String => AWSCDK::CodeBuild::BuildEnvironmentVariable}? (readonly)

The environment variables that your builds can use.

Returns:



55
56
57
# File 'code_build/build_environment.rb', line 55

def environment_variables
  @environment_variables
end

#fleetAWSCDK::CodeBuild::IFleet? (readonly)

Note:

Default: - No fleet will be attached to the project, which will remain on-demand.

Fleet resource for a reserved capacity CodeBuild project.

Fleets allow for process builds or tests to run immediately and reduces build durations, by reserving compute resources for your projects.

You will be charged for the resources in the fleet, even if they are idle.



66
67
68
# File 'code_build/build_environment.rb', line 66

def fleet
  @fleet
end

#privilegedBoolean? (readonly)

Note:

Default: false

Indicates how the project builds Docker images.

Specify true to enable running the Docker daemon inside a Docker container. This value must be set to true only if this build project will be used to build Docker images, and the specified build environment image is not one provided by AWS CodeBuild with Docker support. Otherwise, all associated builds that attempt to interact with the Docker daemon will fail.

Returns:

  • (Boolean, nil)


78
79
80
# File 'code_build/build_environment.rb', line 78

def privileged
  @privileged
end

Class Method Details

.jsii_propertiesObject



80
81
82
83
84
85
86
87
88
89
90
# File 'code_build/build_environment.rb', line 80

def self.jsii_properties
  {
    :build_image => "buildImage",
    :certificate => "certificate",
    :compute_type => "computeType",
    :docker_server => "dockerServer",
    :environment_variables => "environmentVariables",
    :fleet => "fleet",
    :privileged => "privileged",
  }
end

Instance Method Details

#to_jsiiObject



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'code_build/build_environment.rb', line 92

def to_jsii
  result = {}
  result.merge!({
    "buildImage" => @build_image,
    "certificate" => @certificate,
    "computeType" => @compute_type,
    "dockerServer" => @docker_server,
    "environmentVariables" => @environment_variables,
    "fleet" => @fleet,
    "privileged" => @privileged,
  })
  result.compact
end