Module: AWSCDK::CodeBuild::IBindableBuildImage

Includes:
IBuildImage
Included in:
LinuxGpuBuildImage
Defined in:
code_build/i_bindable_build_image.rb

Overview

A variant of IBuildImage that allows binding to the project.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'code_build/i_bindable_build_image.rb', line 87

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 },
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(scope, project, options) ⇒ AWSCDK::CodeBuild::BuildImageConfig

Function that allows the build image access to the construct tree.

Parameters:

Returns:



79
80
81
82
83
84
85
# File 'code_build/i_bindable_build_image.rb', line 79

def bind(scope, project, options)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(project, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLklQcm9qZWN0In0=")), "project")
  options = options.is_a?(Hash) ? ::AWSCDK::CodeBuild::BuildImageBindOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29kZWJ1aWxkLkJ1aWxkSW1hZ2VCaW5kT3B0aW9ucyJ9")), "options")
  jsii_call_method("bind", [scope, project, options])
end

#default_compute_typeAWSCDK::CodeBuild::ComputeType

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



11
12
13
# File 'code_build/i_bindable_build_image.rb', line 11

def default_compute_type()
  jsii_get_property("defaultComputeType")
end

#image_idString

The Docker image identifier that the build environment uses.



19
20
21
# File 'code_build/i_bindable_build_image.rb', line 19

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.



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

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:



42
43
44
# File 'code_build/i_bindable_build_image.rb', line 42

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:



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

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.



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

def secrets_manager_credentials()
  jsii_get_property("secretsManagerCredentials")
end

#typeString

The type of build environment.

Returns:

  • (String)


26
27
28
# File 'code_build/i_bindable_build_image.rb', line 26

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>)


67
68
69
70
71
# File 'code_build/i_bindable_build_image.rb', line 67

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