com.pulumi.awsnative.sagemaker.kotlin.Image.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.sagemaker.kotlin
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [Image].
*/
@PulumiTagMarker
public class ImageResourceBuilder internal constructor() {
public var name: String? = null
public var args: ImageArgs = ImageArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend ImageArgsBuilder.() -> Unit) {
val builder = ImageArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Image {
val builtJavaResource = com.pulumi.awsnative.sagemaker.Image(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Image(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::SageMaker::Image
*/
public class Image internal constructor(
override val javaResource: com.pulumi.awsnative.sagemaker.Image,
) : KotlinCustomResource(javaResource, ImageMapper) {
/**
* The Amazon Resource Name (ARN) of the image.
* *Type* : String
* *Length Constraints* : Maximum length of 256.
* *Pattern* : `^arn:aws(-[\w]+)*:sagemaker:.+:[0-9]{12}:image/[a-z0-9]([-.]?[a-z0-9])*$`
*/
public val imageArn: Output
get() = javaResource.imageArn().applyValue({ args0 -> args0 })
/**
* The description of the image.
*/
public val imageDescription: Output?
get() = javaResource.imageDescription().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The display name of the image.
* *Length Constraints* : Minimum length of 1. Maximum length of 128.
* *Pattern* : `^\S(.*\S)?$`
*/
public val imageDisplayName: Output?
get() = javaResource.imageDisplayName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the Image. Must be unique by region in your account.
* *Length Constraints* : Minimum length of 1. Maximum length of 63.
* *Pattern* : `^[a-zA-Z0-9]([-.]?[a-zA-Z0-9]){0,62}$`
*/
public val imageName: Output
get() = javaResource.imageName().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf.
* *Length Constraints* : Minimum length of 20. Maximum length of 2048.
* *Pattern* : `^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$`
*/
public val imageRoleArn: Output
get() = javaResource.imageRoleArn().applyValue({ args0 -> args0 })
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
}
public object ImageMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.sagemaker.Image::class == javaResource::class
override fun map(javaResource: Resource): Image = Image(
javaResource as
com.pulumi.awsnative.sagemaker.Image,
)
}
/**
* @see [Image].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Image].
*/
public suspend fun image(name: String, block: suspend ImageResourceBuilder.() -> Unit): Image {
val builder = ImageResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Image].
* @param name The _unique_ name of the resulting resource.
*/
public fun image(name: String): Image {
val builder = ImageResourceBuilder()
builder.name(name)
return builder.build()
}