Module: AWSCDK::CodeBuild::IBuildImage

Overview

Represents a Docker image used for the CodeBuild Project builds.

Use the concrete subclasses, either: LinuxBuildImage or WindowsBuildImage.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



75
76
77
78
79
80
81
82
83
84
85
86
# File 'code_build/i_build_image.rb', line 75

def self.jsii_overridable_methods
  {
    :default_compute_type => { kind: :property, name: "defaultComputeType", is_optional: false },
    :image_id => { kind: :property, name: "imageId", is_optional: false },
    :type => { kind: :property, name: "type", is_optional: false },
    :image_pull_principal_type => { kind: :property, name: "imagePullPrincipalType", is_optional: true },
    :repository => { kind: :property, name: "repository", is_optional: true },
    :secrets_manager_credentials => { kind: :property, name: "secretsManagerCredentials", is_optional: true },
    :run_script_buildspec => { kind: :method, name: "runScriptBuildspec", is_optional: false },
    :validate => { kind: :method, name: "validate", is_optional: false },
  }
end

Instance Method Details

#default_compute_typeAWSCDK::CodeBuild::ComputeType

The default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.



13
14
15
# File 'code_build/i_build_image.rb', line 13

def default_compute_type()
  jsii_get_property("defaultComputeType")
end

#image_idString

The Docker image identifier that the build environment uses.



21
22
23
# File 'code_build/i_build_image.rb', line 21

def image_id()
  jsii_get_property("imageId")
end

#image_pull_principal_typeAWSCDK::CodeBuild::ImagePullPrincipalType?

Note:

Default: ImagePullPrincipalType.SERVICE_ROLE

The type of principal that CodeBuild will use to pull this build Docker image.



36
37
38
# File 'code_build/i_build_image.rb', line 36

def image_pull_principal_type()
  jsii_get_property("imagePullPrincipalType")
end

#repositoryAWSCDK::ECR::IRepository?

Note:

Default: no repository

An optional ECR repository that the image is hosted in.

Returns:



44
45
46
# File 'code_build/i_build_image.rb', line 44

def repository()
  jsii_get_property("repository")
end

#run_script_buildspec(entrypoint) ⇒ AWSCDK::CodeBuild::BuildSpec

Make a buildspec to run the indicated script.

Parameters:

  • entrypoint (String)

Returns:



60
61
62
63
# File 'code_build/i_build_image.rb', line 60

def run_script_buildspec(entrypoint)
  Jsii::Type.check_type(entrypoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "entrypoint")
  jsii_call_method("runScriptBuildspec", [entrypoint])
end

#secrets_manager_credentialsAWSCDK::SecretsManager::ISecret?

Note:

Default: no credentials will be used

The secretsManagerCredentials for access to a private registry.



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

def secrets_manager_credentials()
  jsii_get_property("secretsManagerCredentials")
end

#typeString

The type of build environment.

Returns:

  • (String)


28
29
30
# File 'code_build/i_build_image.rb', line 28

def type()
  jsii_get_property("type")
end

#validate(build_environment) ⇒ Array<String>

Allows the image a chance to validate whether the passed configuration is correct.

Parameters:

Returns:

  • (Array<String>)


69
70
71
72
73
# File 'code_build/i_build_image.rb', line 69

def validate(build_environment)
  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")
  jsii_call_method("validate", [build_environment])
end