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

com.pulumi.awsnative.rum.kotlin.AppMonitor.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.rum.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.rum.kotlin.outputs.AppMonitorConfiguration
import com.pulumi.awsnative.rum.kotlin.outputs.AppMonitorCustomEvents
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.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.rum.kotlin.outputs.AppMonitorConfiguration.Companion.toKotlin as appMonitorConfigurationToKotlin
import com.pulumi.awsnative.rum.kotlin.outputs.AppMonitorCustomEvents.Companion.toKotlin as appMonitorCustomEventsToKotlin

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

    public var args: AppMonitorArgs = AppMonitorArgs()

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

/**
 * Resource Type definition for AWS::RUM::AppMonitor
 */
public class AppMonitor internal constructor(
    override val javaResource: com.pulumi.awsnative.rum.AppMonitor,
) : KotlinCustomResource(javaResource, AppMonitorMapper) {
    /**
     * A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include `AppMonitorConfiguration` , you must set up your own authorization method. For more information, see [Authorize your application to send data to AWS](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-get-started-authorization.html) .
     * If you omit this argument, the sample rate used for CloudWatch RUM is set to 10% of the user sessions.
     */
    public val appMonitorConfiguration: Output?
        get() = javaResource.appMonitorConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> appMonitorConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The unique ID of the new app monitor.
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * Specifies whether this app monitor allows the web client to define and send custom events. If you omit this parameter, custom events are `DISABLED` .
     */
    public val customEvents: Output?
        get() = javaResource.customEvents().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    appMonitorCustomEventsToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to CWLlong in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur CWLlong charges. If you omit this parameter, the default is false
     */
    public val cwLogEnabled: Output?
        get() = javaResource.cwLogEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The top-level internet domain name for which your application has administrative authority.
     */
    public val domain: Output
        get() = javaResource.domain().applyValue({ args0 -> args0 })

    /**
     * A name for the app monitor
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Assigns one or more tags (key-value pairs) to the app monitor.
     * Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
     * Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters.
     * You can associate as many as 50 tags with an app monitor.
     * For more information, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) .
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object AppMonitorMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.rum.AppMonitor::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy