com.pulumi.aws.sagemaker.kotlin.ImageVersion.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.sagemaker.kotlin
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [ImageVersion].
*/
@PulumiTagMarker
public class ImageVersionResourceBuilder internal constructor() {
public var name: String? = null
public var args: ImageVersionArgs = ImageVersionArgs()
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 ImageVersionArgsBuilder.() -> Unit) {
val builder = ImageVersionArgsBuilder()
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(): ImageVersion {
val builtJavaResource = com.pulumi.aws.sagemaker.ImageVersion(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ImageVersion(builtJavaResource)
}
}
/**
* Provides a SageMaker Image Version resource.
* ## Example Usage
* ### Basic usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const test = new aws.sagemaker.ImageVersion("test", {
* imageName: testAwsSagemakerImage.id,
* baseImage: "012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* test = aws.sagemaker.ImageVersion("test",
* image_name=test_aws_sagemaker_image["id"],
* base_image="012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var test = new Aws.Sagemaker.ImageVersion("test", new()
* {
* ImageName = testAwsSagemakerImage.Id,
* BaseImage = "012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := sagemaker.NewImageVersion(ctx, "test", &sagemaker.ImageVersionArgs{
* ImageName: pulumi.Any(testAwsSagemakerImage.Id),
* BaseImage: pulumi.String("012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.sagemaker.ImageVersion;
* import com.pulumi.aws.sagemaker.ImageVersionArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var test = new ImageVersion("test", ImageVersionArgs.builder()
* .imageName(testAwsSagemakerImage.id())
* .baseImage("012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:sagemaker:ImageVersion
* properties:
* imageName: ${testAwsSagemakerImage.id}
* baseImage: 012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest
* ```
*
* ## Import
* Using `pulumi import`, import SageMaker Image Versions using the `name`. For example:
* ```sh
* $ pulumi import aws:sagemaker/imageVersion:ImageVersion test_image my-code-repo
* ```
*/
public class ImageVersion internal constructor(
override val javaResource: com.pulumi.aws.sagemaker.ImageVersion,
) : KotlinCustomResource(javaResource, ImageVersionMapper) {
/**
* The Amazon Resource Name (ARN) assigned by AWS to this Image Version.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The registry path of the container image on which this image version is based.
*/
public val baseImage: Output
get() = javaResource.baseImage().applyValue({ args0 -> args0 })
/**
* The registry path of the container image that contains this image version.
*/
public val containerImage: Output
get() = javaResource.containerImage().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the image the version is based on.
*/
public val imageArn: Output
get() = javaResource.imageArn().applyValue({ args0 -> args0 })
/**
* The name of the image. Must be unique to your account.
*/
public val imageName: Output
get() = javaResource.imageName().applyValue({ args0 -> args0 })
public val version: Output
get() = javaResource.version().applyValue({ args0 -> args0 })
}
public object ImageVersionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.aws.sagemaker.ImageVersion::class == javaResource::class
override fun map(javaResource: Resource): ImageVersion = ImageVersion(
javaResource as
com.pulumi.aws.sagemaker.ImageVersion,
)
}
/**
* @see [ImageVersion].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ImageVersion].
*/
public suspend fun imageVersion(
name: String,
block: suspend ImageVersionResourceBuilder.() -> Unit,
): ImageVersion {
val builder = ImageVersionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ImageVersion].
* @param name The _unique_ name of the resulting resource.
*/
public fun imageVersion(name: String): ImageVersion {
val builder = ImageVersionResourceBuilder()
builder.name(name)
return builder.build()
}