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

com.pulumi.awsnative.resourceexplorer2.kotlin.Index.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.resourceexplorer2.kotlin

import com.pulumi.awsnative.resourceexplorer2.kotlin.enums.IndexState
import com.pulumi.awsnative.resourceexplorer2.kotlin.enums.IndexType
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.Map
import com.pulumi.awsnative.resourceexplorer2.kotlin.enums.IndexState.Companion.toKotlin as indexStateToKotlin
import com.pulumi.awsnative.resourceexplorer2.kotlin.enums.IndexType.Companion.toKotlin as indexTypeToKotlin

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

    public var args: IndexArgs = IndexArgs()

    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 IndexArgsBuilder.() -> Unit) {
        val builder = IndexArgsBuilder()
        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(): Index {
        val builtJavaResource = com.pulumi.awsnative.resourceexplorer2.Index(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Index(builtJavaResource)
    }
}

/**
 * Definition of AWS::ResourceExplorer2::Index Resource Type
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class Index internal constructor(
    override val javaResource: com.pulumi.awsnative.resourceexplorer2.Index,
) : KotlinCustomResource(javaResource, IndexMapper) {
    /**
     * The ARN of the new index for the AWS Region . For example:
     * `arn:aws:resource-explorer-2:us-east-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222`
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Indicates the current state of the index. For example:
     * `CREATING`
     */
    public val indexState: Output
        get() = javaResource.indexState().applyValue({ args0 ->
            args0.let({ args0 ->
                indexStateToKotlin(args0)
            })
        })

    /**
     * The specified tags are attached to only the index created in this AWS Region . The tags don't attach to any of the resources listed in the index.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies the type of the index in this Region. For information about the aggregator index and how it differs from a local index, see [Turning on cross-Region search by creating an aggregator index](https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) in the *AWS Resource Explorer User Guide.* .
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 ->
            args0.let({ args0 ->
                indexTypeToKotlin(args0)
            })
        })
}

public object IndexMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.resourceexplorer2.Index::class == javaResource::class

    override fun map(javaResource: Resource): Index = Index(
        javaResource as
            com.pulumi.awsnative.resourceexplorer2.Index,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy