com.pulumi.awsnative.kendra.kotlin.Index.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.kendra.kotlin
import com.pulumi.awsnative.kendra.kotlin.enums.IndexEdition
import com.pulumi.awsnative.kendra.kotlin.enums.IndexUserContextPolicy
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexCapacityUnitsConfiguration
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexDocumentMetadataConfiguration
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexServerSideEncryptionConfiguration
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexUserTokenConfiguration
import com.pulumi.awsnative.kotlin.outputs.Tag
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
import com.pulumi.awsnative.kendra.kotlin.enums.IndexEdition.Companion.toKotlin as indexEditionToKotlin
import com.pulumi.awsnative.kendra.kotlin.enums.IndexUserContextPolicy.Companion.toKotlin as indexUserContextPolicyToKotlin
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexCapacityUnitsConfiguration.Companion.toKotlin as indexCapacityUnitsConfigurationToKotlin
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexDocumentMetadataConfiguration.Companion.toKotlin as indexDocumentMetadataConfigurationToKotlin
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexServerSideEncryptionConfiguration.Companion.toKotlin as indexServerSideEncryptionConfigurationToKotlin
import com.pulumi.awsnative.kendra.kotlin.outputs.IndexUserTokenConfiguration.Companion.toKotlin as indexUserTokenConfigurationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* 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.kendra.Index(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Index(builtJavaResource)
}
}
/**
* A Kendra index
*/
public class Index internal constructor(
override val javaResource: com.pulumi.awsnative.kendra.Index,
) : KotlinCustomResource(javaResource, IndexMapper) {
/**
* The Amazon Resource Name (ARN) of the index. For example: `arn:aws:kendra:us-west-2:111122223333:index/0123456789abcdef` .
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The identifier for the index. For example: `f4aeaa10-8056-4b2c-a343-522ca0f41234` .
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* Capacity units
*/
public val capacityUnits: Output?
get() = javaResource.capacityUnits().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> indexCapacityUnitsConfigurationToKotlin(args0) })
}).orElse(null)
})
/**
* A description for the index
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Document metadata configurations
*/
public val documentMetadataConfigurations: Output>?
get() = javaResource.documentMetadataConfigurations().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
indexDocumentMetadataConfigurationToKotlin(args0)
})
})
}).orElse(null)
})
/**
* Indicates whether the index is a Enterprise Edition index or a Developer Edition index. Valid values are `DEVELOPER_EDITION` and `ENTERPRISE_EDITION` .
*/
public val edition: Output
get() = javaResource.edition().applyValue({ args0 ->
args0.let({ args0 ->
indexEditionToKotlin(args0)
})
})
/**
* The name of the index.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* An IAM role that gives Amazon Kendra permissions to access your Amazon CloudWatch logs and metrics. This is also the role used when you use the [BatchPutDocument](https://docs.aws.amazon.com/kendra/latest/dg/BatchPutDocument.html) operation to index documents from an Amazon S3 bucket.
*/
public val roleArn: Output
get() = javaResource.roleArn().applyValue({ args0 -> args0 })
/**
* Server side encryption configuration
*/
public val serverSideEncryptionConfiguration: Output?
get() = javaResource.serverSideEncryptionConfiguration().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
indexServerSideEncryptionConfigurationToKotlin(args0)
})
}).orElse(null)
})
/**
* Tags for labeling the index
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The user context policy.
* ATTRIBUTE_FILTER
* - All indexed content is searchable and displayable for all users. If you want to filter search results on user context, you can use the attribute filters of `_user_id` and `_group_ids` or you can provide user and group information in `UserContext` .
* USER_TOKEN
* - Enables token-based user access control to filter search results on user context. All documents with no access control and all documents accessible to the user will be searchable and displayable.
*/
public val userContextPolicy: Output?
get() = javaResource.userContextPolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> indexUserContextPolicyToKotlin(args0) })
}).orElse(null)
})
/**
* Defines the type of user token used for the index.
*/
public val userTokenConfigurations: Output>?
get() = javaResource.userTokenConfigurations().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
indexUserTokenConfigurationToKotlin(args0)
})
})
}).orElse(null)
})
}
public object IndexMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.kendra.Index::class == javaResource::class
override fun map(javaResource: Resource): Index = Index(
javaResource as
com.pulumi.awsnative.kendra.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()
}