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

com.pulumi.aws.kendra.kotlin.Faq.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.kendra.kotlin

import com.pulumi.aws.kendra.kotlin.outputs.FaqS3Path
import com.pulumi.aws.kendra.kotlin.outputs.FaqS3Path.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.Map

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

    public var args: FaqArgs = FaqArgs()

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

/**
 * Resource for managing an AWS Kendra FAQ.
 * ## Example Usage
 * ### Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.kendra.Faq("example", {
 *     indexId: exampleAwsKendraIndex.id,
 *     name: "Example",
 *     roleArn: exampleAwsIamRole.arn,
 *     s3Path: {
 *         bucket: exampleAwsS3Bucket.id,
 *         key: exampleAwsS3Object.key,
 *     },
 *     tags: {
 *         Name: "Example Kendra Faq",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.kendra.Faq("example",
 *     index_id=example_aws_kendra_index["id"],
 *     name="Example",
 *     role_arn=example_aws_iam_role["arn"],
 *     s3_path={
 *         "bucket": example_aws_s3_bucket["id"],
 *         "key": example_aws_s3_object["key"],
 *     },
 *     tags={
 *         "Name": "Example Kendra Faq",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Kendra.Faq("example", new()
 *     {
 *         IndexId = exampleAwsKendraIndex.Id,
 *         Name = "Example",
 *         RoleArn = exampleAwsIamRole.Arn,
 *         S3Path = new Aws.Kendra.Inputs.FaqS3PathArgs
 *         {
 *             Bucket = exampleAwsS3Bucket.Id,
 *             Key = exampleAwsS3Object.Key,
 *         },
 *         Tags =
 *         {
 *             { "Name", "Example Kendra Faq" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kendra"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := kendra.NewFaq(ctx, "example", &kendra.FaqArgs{
 * 			IndexId: pulumi.Any(exampleAwsKendraIndex.Id),
 * 			Name:    pulumi.String("Example"),
 * 			RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
 * 			S3Path: &kendra.FaqS3PathArgs{
 * 				Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
 * 				Key:    pulumi.Any(exampleAwsS3Object.Key),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"Name": pulumi.String("Example Kendra Faq"),
 * 			},
 * 		})
 * 		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.kendra.Faq;
 * import com.pulumi.aws.kendra.FaqArgs;
 * import com.pulumi.aws.kendra.inputs.FaqS3PathArgs;
 * 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 Faq("example", FaqArgs.builder()
 *             .indexId(exampleAwsKendraIndex.id())
 *             .name("Example")
 *             .roleArn(exampleAwsIamRole.arn())
 *             .s3Path(FaqS3PathArgs.builder()
 *                 .bucket(exampleAwsS3Bucket.id())
 *                 .key(exampleAwsS3Object.key())
 *                 .build())
 *             .tags(Map.of("Name", "Example Kendra Faq"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:kendra:Faq
 *     properties:
 *       indexId: ${exampleAwsKendraIndex.id}
 *       name: Example
 *       roleArn: ${exampleAwsIamRole.arn}
 *       s3Path:
 *         bucket: ${exampleAwsS3Bucket.id}
 *         key: ${exampleAwsS3Object.key}
 *       tags:
 *         Name: Example Kendra Faq
 * ```
 * 
 * ### With File Format
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.kendra.Faq("example", {
 *     indexId: exampleAwsKendraIndex.id,
 *     name: "Example",
 *     fileFormat: "CSV",
 *     roleArn: exampleAwsIamRole.arn,
 *     s3Path: {
 *         bucket: exampleAwsS3Bucket.id,
 *         key: exampleAwsS3Object.key,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.kendra.Faq("example",
 *     index_id=example_aws_kendra_index["id"],
 *     name="Example",
 *     file_format="CSV",
 *     role_arn=example_aws_iam_role["arn"],
 *     s3_path={
 *         "bucket": example_aws_s3_bucket["id"],
 *         "key": example_aws_s3_object["key"],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Kendra.Faq("example", new()
 *     {
 *         IndexId = exampleAwsKendraIndex.Id,
 *         Name = "Example",
 *         FileFormat = "CSV",
 *         RoleArn = exampleAwsIamRole.Arn,
 *         S3Path = new Aws.Kendra.Inputs.FaqS3PathArgs
 *         {
 *             Bucket = exampleAwsS3Bucket.Id,
 *             Key = exampleAwsS3Object.Key,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kendra"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := kendra.NewFaq(ctx, "example", &kendra.FaqArgs{
 * 			IndexId:    pulumi.Any(exampleAwsKendraIndex.Id),
 * 			Name:       pulumi.String("Example"),
 * 			FileFormat: pulumi.String("CSV"),
 * 			RoleArn:    pulumi.Any(exampleAwsIamRole.Arn),
 * 			S3Path: &kendra.FaqS3PathArgs{
 * 				Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
 * 				Key:    pulumi.Any(exampleAwsS3Object.Key),
 * 			},
 * 		})
 * 		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.kendra.Faq;
 * import com.pulumi.aws.kendra.FaqArgs;
 * import com.pulumi.aws.kendra.inputs.FaqS3PathArgs;
 * 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 Faq("example", FaqArgs.builder()
 *             .indexId(exampleAwsKendraIndex.id())
 *             .name("Example")
 *             .fileFormat("CSV")
 *             .roleArn(exampleAwsIamRole.arn())
 *             .s3Path(FaqS3PathArgs.builder()
 *                 .bucket(exampleAwsS3Bucket.id())
 *                 .key(exampleAwsS3Object.key())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:kendra:Faq
 *     properties:
 *       indexId: ${exampleAwsKendraIndex.id}
 *       name: Example
 *       fileFormat: CSV
 *       roleArn: ${exampleAwsIamRole.arn}
 *       s3Path:
 *         bucket: ${exampleAwsS3Bucket.id}
 *         key: ${exampleAwsS3Object.key}
 * ```
 * 
 * ### With Language Code
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.kendra.Faq("example", {
 *     indexId: exampleAwsKendraIndex.id,
 *     name: "Example",
 *     languageCode: "en",
 *     roleArn: exampleAwsIamRole.arn,
 *     s3Path: {
 *         bucket: exampleAwsS3Bucket.id,
 *         key: exampleAwsS3Object.key,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.kendra.Faq("example",
 *     index_id=example_aws_kendra_index["id"],
 *     name="Example",
 *     language_code="en",
 *     role_arn=example_aws_iam_role["arn"],
 *     s3_path={
 *         "bucket": example_aws_s3_bucket["id"],
 *         "key": example_aws_s3_object["key"],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Kendra.Faq("example", new()
 *     {
 *         IndexId = exampleAwsKendraIndex.Id,
 *         Name = "Example",
 *         LanguageCode = "en",
 *         RoleArn = exampleAwsIamRole.Arn,
 *         S3Path = new Aws.Kendra.Inputs.FaqS3PathArgs
 *         {
 *             Bucket = exampleAwsS3Bucket.Id,
 *             Key = exampleAwsS3Object.Key,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kendra"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := kendra.NewFaq(ctx, "example", &kendra.FaqArgs{
 * 			IndexId:      pulumi.Any(exampleAwsKendraIndex.Id),
 * 			Name:         pulumi.String("Example"),
 * 			LanguageCode: pulumi.String("en"),
 * 			RoleArn:      pulumi.Any(exampleAwsIamRole.Arn),
 * 			S3Path: &kendra.FaqS3PathArgs{
 * 				Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
 * 				Key:    pulumi.Any(exampleAwsS3Object.Key),
 * 			},
 * 		})
 * 		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.kendra.Faq;
 * import com.pulumi.aws.kendra.FaqArgs;
 * import com.pulumi.aws.kendra.inputs.FaqS3PathArgs;
 * 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 Faq("example", FaqArgs.builder()
 *             .indexId(exampleAwsKendraIndex.id())
 *             .name("Example")
 *             .languageCode("en")
 *             .roleArn(exampleAwsIamRole.arn())
 *             .s3Path(FaqS3PathArgs.builder()
 *                 .bucket(exampleAwsS3Bucket.id())
 *                 .key(exampleAwsS3Object.key())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:kendra:Faq
 *     properties:
 *       indexId: ${exampleAwsKendraIndex.id}
 *       name: Example
 *       languageCode: en
 *       roleArn: ${exampleAwsIamRole.arn}
 *       s3Path:
 *         bucket: ${exampleAwsS3Bucket.id}
 *         key: ${exampleAwsS3Object.key}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import `aws_kendra_faq` using the unique identifiers of the FAQ and index separated by a slash (`/`). For example:
 * ```sh
 * $ pulumi import aws:kendra/faq:Faq example faq-123456780/idx-8012925589
 * ```
 */
public class Faq internal constructor(
    override val javaResource: com.pulumi.aws.kendra.Faq,
) : KotlinCustomResource(javaResource, FaqMapper) {
    /**
     * ARN of the FAQ.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The Unix datetime that the FAQ was created.
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * When the Status field value is `FAILED`, this contains a message that explains why.
     */
    public val errorMessage: Output
        get() = javaResource.errorMessage().applyValue({ args0 -> args0 })

    /**
     * The identifier of the FAQ.
     */
    public val faqId: Output
        get() = javaResource.faqId().applyValue({ args0 -> args0 })

    public val fileFormat: Output?
        get() = javaResource.fileFormat().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The identifier of the index for a FAQ.
     */
    public val indexId: Output
        get() = javaResource.indexId().applyValue({ args0 -> args0 })

    public val languageCode: Output
        get() = javaResource.languageCode().applyValue({ args0 -> args0 })

    /**
     * The name that should be associated with the FAQ.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The Amazon Resource Name (ARN) of a role with permission to access the S3 bucket that contains the FAQs. For more information, see [IAM Roles for Amazon Kendra](https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html).
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

    /**
     * The S3 location of the FAQ input data. Detailed below.
     */
    public val s3Path: Output
        get() = javaResource.s3Path().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * The status of the FAQ. It is ready to use when the status is ACTIVE.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    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()
        })

    /**
     * The date and time that the FAQ was last updated.
     */
    public val updatedAt: Output
        get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}

public object FaqMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.kendra.Faq::class == javaResource::class

    override fun map(javaResource: Resource): Faq = Faq(javaResource as com.pulumi.aws.kendra.Faq)
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy