importComponent
inline suspend fun ImagebuilderClient.importComponent(crossinline block: ImportComponentRequest.Builder.() -> Unit): ImportComponentResponse
Imports a component and transforms its data into a component document. For the SHELL format, Image Builder wraps your script in a component document with a single step that runs the script.
Samples
// The following example imports a plain shell script as a Linux build component.
val resp = imagebuilderClient.importComponent {
name = "my-example-imported-component"
semanticVersion = "1.0.0"
description = "Installs my application from an imported shell script"
type = ComponentType.fromValue("BUILD")
format = ComponentFormat.fromValue("SHELL")
platform = Platform.fromValue("Linux")
data = "sudo yum update -y\nsudo yum -y install my-app\n"
clientToken = "a1b2c3d4-5678-90ab-cdef-EXAMPLE88888"
}Content copied to clipboard