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

com.pulumi.awsnative.synthetics.kotlin.CanaryArgs.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.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.synthetics.kotlin

import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.awsnative.synthetics.CanaryArgs.builder
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryArtifactConfigArgs
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryArtifactConfigArgsBuilder
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryCodeArgs
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryCodeArgsBuilder
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryRunConfigArgs
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryRunConfigArgsBuilder
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryScheduleArgs
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryScheduleArgsBuilder
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryVisualReferenceArgs
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryVisualReferenceArgsBuilder
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryVpcConfigArgs
import com.pulumi.awsnative.synthetics.kotlin.inputs.CanaryVpcConfigArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::Synthetics::Canary
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * @property artifactConfig Provide artifact configuration
 * @property artifactS3Location Provide the s3 bucket output location for test results
 * @property code Provide the canary script source
 * @property deleteLambdaResourcesOnCanaryDeletion Deletes associated lambda resources created by Synthetics if set to True. Default is False
 * @property executionRoleArn Lambda Execution role used to run your canaries
 * @property failureRetentionPeriod Retention period of failed canary runs represented in number of days
 * @property name Name of the canary.
 * @property runConfig Provide canary run configuration
 * @property runtimeVersion Runtime version of Synthetics Library
 * @property schedule Frequency to run your canaries
 * @property startCanaryAfterCreation Runs canary if set to True. Default is False
 * @property successRetentionPeriod Retention period of successful canary runs represented in number of days
 * @property tags The list of key-value pairs that are associated with the canary.
 * @property visualReference Visual reference configuration for visual testing
 * @property vpcConfig Provide VPC Configuration if enabled.
 */
public data class CanaryArgs(
    public val artifactConfig: Output? = null,
    public val artifactS3Location: Output? = null,
    public val code: Output? = null,
    public val deleteLambdaResourcesOnCanaryDeletion: Output? = null,
    public val executionRoleArn: Output? = null,
    public val failureRetentionPeriod: Output? = null,
    public val name: Output? = null,
    public val runConfig: Output? = null,
    public val runtimeVersion: Output? = null,
    public val schedule: Output? = null,
    public val startCanaryAfterCreation: Output? = null,
    public val successRetentionPeriod: Output? = null,
    public val tags: Output>? = null,
    public val visualReference: Output? = null,
    public val vpcConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.synthetics.CanaryArgs =
        com.pulumi.awsnative.synthetics.CanaryArgs.builder()
            .artifactConfig(artifactConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .artifactS3Location(artifactS3Location?.applyValue({ args0 -> args0 }))
            .code(code?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .deleteLambdaResourcesOnCanaryDeletion(
                deleteLambdaResourcesOnCanaryDeletion?.applyValue({ args0 ->
                    args0
                }),
            )
            .executionRoleArn(executionRoleArn?.applyValue({ args0 -> args0 }))
            .failureRetentionPeriod(failureRetentionPeriod?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .runConfig(runConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .runtimeVersion(runtimeVersion?.applyValue({ args0 -> args0 }))
            .schedule(schedule?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .startCanaryAfterCreation(startCanaryAfterCreation?.applyValue({ args0 -> args0 }))
            .successRetentionPeriod(successRetentionPeriod?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .visualReference(visualReference?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .vpcConfig(vpcConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [CanaryArgs].
 */
@PulumiTagMarker
public class CanaryArgsBuilder internal constructor() {
    private var artifactConfig: Output? = null

    private var artifactS3Location: Output? = null

    private var code: Output? = null

    private var deleteLambdaResourcesOnCanaryDeletion: Output? = null

    private var executionRoleArn: Output? = null

    private var failureRetentionPeriod: Output? = null

    private var name: Output? = null

    private var runConfig: Output? = null

    private var runtimeVersion: Output? = null

    private var schedule: Output? = null

    private var startCanaryAfterCreation: Output? = null

    private var successRetentionPeriod: Output? = null

    private var tags: Output>? = null

    private var visualReference: Output? = null

    private var vpcConfig: Output? = null

    /**
     * @param value Provide artifact configuration
     */
    @JvmName("obuwxnxdtqfmomoi")
    public suspend fun artifactConfig(`value`: Output) {
        this.artifactConfig = value
    }

    /**
     * @param value Provide the s3 bucket output location for test results
     */
    @JvmName("lrumagbajnwnapgs")
    public suspend fun artifactS3Location(`value`: Output) {
        this.artifactS3Location = value
    }

    /**
     * @param value Provide the canary script source
     */
    @JvmName("ofeudcbdqjvnljig")
    public suspend fun code(`value`: Output) {
        this.code = value
    }

    /**
     * @param value Deletes associated lambda resources created by Synthetics if set to True. Default is False
     */
    @JvmName("bhqjdhirulrucxpe")
    public suspend fun deleteLambdaResourcesOnCanaryDeletion(`value`: Output) {
        this.deleteLambdaResourcesOnCanaryDeletion = value
    }

    /**
     * @param value Lambda Execution role used to run your canaries
     */
    @JvmName("njexktsxtytmvorv")
    public suspend fun executionRoleArn(`value`: Output) {
        this.executionRoleArn = value
    }

    /**
     * @param value Retention period of failed canary runs represented in number of days
     */
    @JvmName("ttehumksxbcncrhq")
    public suspend fun failureRetentionPeriod(`value`: Output) {
        this.failureRetentionPeriod = value
    }

    /**
     * @param value Name of the canary.
     */
    @JvmName("rlnjuemkkwgjtugm")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Provide canary run configuration
     */
    @JvmName("brqkcsqbtrivyisx")
    public suspend fun runConfig(`value`: Output) {
        this.runConfig = value
    }

    /**
     * @param value Runtime version of Synthetics Library
     */
    @JvmName("fpmosgutvpsphwjg")
    public suspend fun runtimeVersion(`value`: Output) {
        this.runtimeVersion = value
    }

    /**
     * @param value Frequency to run your canaries
     */
    @JvmName("ffhfpcbebhsdjatn")
    public suspend fun schedule(`value`: Output) {
        this.schedule = value
    }

    /**
     * @param value Runs canary if set to True. Default is False
     */
    @JvmName("wpmyogwjbepqrfni")
    public suspend fun startCanaryAfterCreation(`value`: Output) {
        this.startCanaryAfterCreation = value
    }

    /**
     * @param value Retention period of successful canary runs represented in number of days
     */
    @JvmName("gnmqddsacepbmskg")
    public suspend fun successRetentionPeriod(`value`: Output) {
        this.successRetentionPeriod = value
    }

    /**
     * @param value The list of key-value pairs that are associated with the canary.
     */
    @JvmName("ndlikilbausbwsad")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    @JvmName("lltmpssbstusfate")
    public suspend fun tags(vararg values: Output) {
        this.tags = Output.all(values.asList())
    }

    /**
     * @param values The list of key-value pairs that are associated with the canary.
     */
    @JvmName("nifdgqjxqphntvtx")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value Visual reference configuration for visual testing
     */
    @JvmName("dblbqsbaarnjdrpf")
    public suspend fun visualReference(`value`: Output) {
        this.visualReference = value
    }

    /**
     * @param value Provide VPC Configuration if enabled.
     */
    @JvmName("vqrdtpifxvfeuyqk")
    public suspend fun vpcConfig(`value`: Output) {
        this.vpcConfig = value
    }

    /**
     * @param value Provide artifact configuration
     */
    @JvmName("wgkkgqimrruwwghs")
    public suspend fun artifactConfig(`value`: CanaryArtifactConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.artifactConfig = mapped
    }

    /**
     * @param argument Provide artifact configuration
     */
    @JvmName("qsyugcjxqteexavv")
    public suspend fun artifactConfig(argument: suspend CanaryArtifactConfigArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryArtifactConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.artifactConfig = mapped
    }

    /**
     * @param value Provide the s3 bucket output location for test results
     */
    @JvmName("bleyujvdjjlrvpka")
    public suspend fun artifactS3Location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.artifactS3Location = mapped
    }

    /**
     * @param value Provide the canary script source
     */
    @JvmName("xxqdlelsscessmvr")
    public suspend fun code(`value`: CanaryCodeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.code = mapped
    }

    /**
     * @param argument Provide the canary script source
     */
    @JvmName("ytmijrwlwkdxuokj")
    public suspend fun code(argument: suspend CanaryCodeArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryCodeArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.code = mapped
    }

    /**
     * @param value Deletes associated lambda resources created by Synthetics if set to True. Default is False
     */
    @JvmName("nlmedgjywklfvbns")
    public suspend fun deleteLambdaResourcesOnCanaryDeletion(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deleteLambdaResourcesOnCanaryDeletion = mapped
    }

    /**
     * @param value Lambda Execution role used to run your canaries
     */
    @JvmName("sraseddhljxrguwb")
    public suspend fun executionRoleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.executionRoleArn = mapped
    }

    /**
     * @param value Retention period of failed canary runs represented in number of days
     */
    @JvmName("lgotcpikwdebltur")
    public suspend fun failureRetentionPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failureRetentionPeriod = mapped
    }

    /**
     * @param value Name of the canary.
     */
    @JvmName("pgmcrexdkcahfjdj")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Provide canary run configuration
     */
    @JvmName("ajhckkujemrmyoas")
    public suspend fun runConfig(`value`: CanaryRunConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runConfig = mapped
    }

    /**
     * @param argument Provide canary run configuration
     */
    @JvmName("vehxvrambpeduesp")
    public suspend fun runConfig(argument: suspend CanaryRunConfigArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryRunConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.runConfig = mapped
    }

    /**
     * @param value Runtime version of Synthetics Library
     */
    @JvmName("wsjgfbrqciorwrfx")
    public suspend fun runtimeVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runtimeVersion = mapped
    }

    /**
     * @param value Frequency to run your canaries
     */
    @JvmName("cjtaaooaerkabuxw")
    public suspend fun schedule(`value`: CanaryScheduleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schedule = mapped
    }

    /**
     * @param argument Frequency to run your canaries
     */
    @JvmName("atjckffviafwoata")
    public suspend fun schedule(argument: suspend CanaryScheduleArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryScheduleArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.schedule = mapped
    }

    /**
     * @param value Runs canary if set to True. Default is False
     */
    @JvmName("phqcdjgqgbpnowge")
    public suspend fun startCanaryAfterCreation(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startCanaryAfterCreation = mapped
    }

    /**
     * @param value Retention period of successful canary runs represented in number of days
     */
    @JvmName("skoyymavvschadjl")
    public suspend fun successRetentionPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.successRetentionPeriod = mapped
    }

    /**
     * @param value The list of key-value pairs that are associated with the canary.
     */
    @JvmName("xyaypiifmlediwwt")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument The list of key-value pairs that are associated with the canary.
     */
    @JvmName("eojfhsgvhwgaylwn")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The list of key-value pairs that are associated with the canary.
     */
    @JvmName("unhwkmpcfshrvahf")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The list of key-value pairs that are associated with the canary.
     */
    @JvmName("kixuuvoyummrkllc")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values The list of key-value pairs that are associated with the canary.
     */
    @JvmName("nxkpbkdjtgyxncdr")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Visual reference configuration for visual testing
     */
    @JvmName("vjdeapiydeiascbi")
    public suspend fun visualReference(`value`: CanaryVisualReferenceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.visualReference = mapped
    }

    /**
     * @param argument Visual reference configuration for visual testing
     */
    @JvmName("gwxrtldxphmscutg")
    public suspend fun visualReference(argument: suspend CanaryVisualReferenceArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryVisualReferenceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.visualReference = mapped
    }

    /**
     * @param value Provide VPC Configuration if enabled.
     */
    @JvmName("abcepykttbxtilei")
    public suspend fun vpcConfig(`value`: CanaryVpcConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcConfig = mapped
    }

    /**
     * @param argument Provide VPC Configuration if enabled.
     */
    @JvmName("hqqhrmelrweprrrx")
    public suspend fun vpcConfig(argument: suspend CanaryVpcConfigArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryVpcConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.vpcConfig = mapped
    }

    internal fun build(): CanaryArgs = CanaryArgs(
        artifactConfig = artifactConfig,
        artifactS3Location = artifactS3Location,
        code = code,
        deleteLambdaResourcesOnCanaryDeletion = deleteLambdaResourcesOnCanaryDeletion,
        executionRoleArn = executionRoleArn,
        failureRetentionPeriod = failureRetentionPeriod,
        name = name,
        runConfig = runConfig,
        runtimeVersion = runtimeVersion,
        schedule = schedule,
        startCanaryAfterCreation = startCanaryAfterCreation,
        successRetentionPeriod = successRetentionPeriod,
        tags = tags,
        visualReference = visualReference,
        vpcConfig = vpcConfig,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy