All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.sagemaker.kotlin.Hub.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.sagemaker.kotlin

import com.pulumi.aws.sagemaker.kotlin.outputs.HubS3StorageConfig
import com.pulumi.aws.sagemaker.kotlin.outputs.HubS3StorageConfig.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.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Builder for [Hub].
 */
@PulumiTagMarker
public class HubResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: HubArgs = HubArgs()

    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 HubArgsBuilder.() -> Unit) {
        val builder = HubArgsBuilder()
        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(): Hub {
        val builtJavaResource = com.pulumi.aws.sagemaker.Hub(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Hub(builtJavaResource)
    }
}

/**
 * Provides a SageMaker Hub resource.
 * ## Example Usage
 * ### Basic usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.sagemaker.Hub("example", {
 *     hubName: "example",
 *     hubDescription: "example",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.sagemaker.Hub("example",
 *     hub_name="example",
 *     hub_description="example")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Sagemaker.Hub("example", new()
 *     {
 *         HubName = "example",
 *         HubDescription = "example",
 *     });
 * });
 * ```
 * ```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.NewHub(ctx, "example", &sagemaker.HubArgs{
 * 			HubName:        pulumi.String("example"),
 * 			HubDescription: pulumi.String("example"),
 * 		})
 * 		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.Hub;
 * import com.pulumi.aws.sagemaker.HubArgs;
 * 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 example = new Hub("example", HubArgs.builder()
 *             .hubName("example")
 *             .hubDescription("example")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:sagemaker:Hub
 *     properties:
 *       hubName: example
 *       hubDescription: example
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import SageMaker Hubs using the `name`. For example:
 * ```sh
 * $ pulumi import aws:sagemaker/hub:Hub test_hub my-code-repo
 * ```
 */
public class Hub internal constructor(
    override val javaResource: com.pulumi.aws.sagemaker.Hub,
) : KotlinCustomResource(javaResource, HubMapper) {
    /**
     * The Amazon Resource Name (ARN) assigned by AWS to this Hub.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * A description of the hub.
     */
    public val hubDescription: Output
        get() = javaResource.hubDescription().applyValue({ args0 -> args0 })

    /**
     * The display name of the hub.
     */
    public val hubDisplayName: Output?
        get() = javaResource.hubDisplayName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the hub.
     */
    public val hubName: Output
        get() = javaResource.hubName().applyValue({ args0 -> args0 })

    /**
     * The searchable keywords for the hub.
     */
    public val hubSearchKeywords: Output>?
        get() = javaResource.hubSearchKeywords().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The Amazon S3 storage configuration for the hub. See S3 Storage Config details below.
     */
    public val s3StorageConfig: Output?
        get() = javaResource.s3StorageConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
     */
    @Deprecated(
        message = """
  Please use `tags` instead.
  """,
    )
    public val tagsAll: Output>
        get() = javaResource.tagsAll().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })
}

public object HubMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.sagemaker.Hub::class == javaResource::class

    override fun map(javaResource: Resource): Hub = Hub(javaResource as com.pulumi.aws.sagemaker.Hub)
}

/**
 * @see [Hub].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Hub].
 */
public suspend fun hub(name: String, block: suspend HubResourceBuilder.() -> Unit): Hub {
    val builder = HubResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Hub].
 * @param name The _unique_ name of the resulting resource.
 */
public fun hub(name: String): Hub {
    val builder = HubResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy