com.pulumi.aws.quicksight.kotlin.Template.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.quicksight.kotlin
import com.pulumi.aws.quicksight.kotlin.outputs.TemplatePermission
import com.pulumi.aws.quicksight.kotlin.outputs.TemplateSourceEntity
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.aws.quicksight.kotlin.outputs.TemplatePermission.Companion.toKotlin as templatePermissionToKotlin
import com.pulumi.aws.quicksight.kotlin.outputs.TemplateSourceEntity.Companion.toKotlin as templateSourceEntityToKotlin
/**
* Builder for [Template].
*/
@PulumiTagMarker
public class TemplateResourceBuilder internal constructor() {
public var name: String? = null
public var args: TemplateArgs = TemplateArgs()
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 TemplateArgsBuilder.() -> Unit) {
val builder = TemplateArgsBuilder()
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(): Template {
val builtJavaResource = com.pulumi.aws.quicksight.Template(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Template(builtJavaResource)
}
}
/**
* Resource for managing a QuickSight Template.
* ## Example Usage
* ### From Source Template
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.quicksight.Template("example", {
* templateId: "example-id",
* name: "example-name",
* versionDescription: "version",
* sourceEntity: {
* sourceTemplate: {
* arn: source.arn,
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.quicksight.Template("example",
* template_id="example-id",
* name="example-name",
* version_description="version",
* source_entity={
* "source_template": {
* "arn": source["arn"],
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Quicksight.Template("example", new()
* {
* TemplateId = "example-id",
* Name = "example-name",
* VersionDescription = "version",
* SourceEntity = new Aws.Quicksight.Inputs.TemplateSourceEntityArgs
* {
* SourceTemplate = new Aws.Quicksight.Inputs.TemplateSourceEntitySourceTemplateArgs
* {
* Arn = source.Arn,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := quicksight.NewTemplate(ctx, "example", &quicksight.TemplateArgs{
* TemplateId: pulumi.String("example-id"),
* Name: pulumi.String("example-name"),
* VersionDescription: pulumi.String("version"),
* SourceEntity: &quicksight.TemplateSourceEntityArgs{
* SourceTemplate: &quicksight.TemplateSourceEntitySourceTemplateArgs{
* Arn: pulumi.Any(source.Arn),
* },
* },
* })
* 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.quicksight.Template;
* import com.pulumi.aws.quicksight.TemplateArgs;
* import com.pulumi.aws.quicksight.inputs.TemplateSourceEntityArgs;
* import com.pulumi.aws.quicksight.inputs.TemplateSourceEntitySourceTemplateArgs;
* 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 Template("example", TemplateArgs.builder()
* .templateId("example-id")
* .name("example-name")
* .versionDescription("version")
* .sourceEntity(TemplateSourceEntityArgs.builder()
* .sourceTemplate(TemplateSourceEntitySourceTemplateArgs.builder()
* .arn(source.arn())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:quicksight:Template
* properties:
* templateId: example-id
* name: example-name
* versionDescription: version
* sourceEntity:
* sourceTemplate:
* arn: ${source.arn}
* ```
*
* ### With Definition
*
* ```yaml
* resources:
* example:
* type: aws:quicksight:Template
* properties:
* templateId: example-id
* name: example-name
* versionDescription: version
* definition:
* dataSetConfigurations:
* - dataSetSchema:
* columnSchemaLists:
* - name: Column1
* dataType: STRING
* - name: Column2
* dataType: INTEGER
* placeholder: '1'
* sheets:
* - title: Test
* sheetId: Test1
* visuals:
* - barChartVisual:
* visualId: BarChart
* chartConfiguration:
* fieldWells:
* barChartAggregatedFieldWells:
* categories:
* - categoricalDimensionField:
* fieldId: '1'
* column:
* columnName: Column1
* dataSetIdentifier: '1'
* values:
* - numericalMeasureField:
* fieldId: '2'
* column:
* columnName: Column2
* dataSetIdentifier: '1'
* aggregationFunction:
* simpleNumericalAggregation: SUM
* ```
*
* ## Import
* Using `pulumi import`, import a QuickSight Template using the AWS account ID and template ID separated by a comma (`,`). For example:
* ```sh
* $ pulumi import aws:quicksight/template:Template example 123456789012,example-id
* ```
*/
public class Template internal constructor(
override val javaResource: com.pulumi.aws.quicksight.Template,
) : KotlinCustomResource(javaResource, TemplateMapper) {
/**
* ARN of the template.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* AWS account ID.
*/
public val awsAccountId: Output
get() = javaResource.awsAccountId().applyValue({ args0 -> args0 })
/**
* The time that the template was created.
*/
public val createdTime: Output
get() = javaResource.createdTime().applyValue({ args0 -> args0 })
/**
* The time that the template was last updated.
*/
public val lastUpdatedTime: Output
get() = javaResource.lastUpdatedTime().applyValue({ args0 -> args0 })
/**
* Display name for the template.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* A set of resource permissions on the template. Maximum of 64 items. See permissions.
*/
public val permissions: Output>?
get() = javaResource.permissions().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> templatePermissionToKotlin(args0) })
})
}).orElse(null)
})
/**
* The entity that you are using as a source when you create the template (analysis or template). Only one of `definition` or `source_entity` should be configured. See source_entity.
*/
public val sourceEntity: Output?
get() = javaResource.sourceEntity().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
templateSourceEntityToKotlin(args0)
})
}).orElse(null)
})
/**
* Amazon Resource Name (ARN) of an analysis or template that was used to create this template.
*/
public val sourceEntityArn: Output
get() = javaResource.sourceEntityArn().applyValue({ args0 -> args0 })
/**
* The template creation status.
*/
public val status: Output
get() = javaResource.status().applyValue({ args0 -> args0 })
/**
* Key-value map of resource tags. 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