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

com.pulumi.aws.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.synthetics.kotlin

import com.pulumi.aws.synthetics.CanaryArgs.builder
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryArtifactConfigArgs
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryArtifactConfigArgsBuilder
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryRunConfigArgs
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryRunConfigArgsBuilder
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryScheduleArgs
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryScheduleArgsBuilder
import com.pulumi.aws.synthetics.kotlin.inputs.CanaryVpcConfigArgs
import com.pulumi.aws.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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a Synthetics Canary resource.
 * > **NOTE:** When you create a canary, AWS creates supporting implicit resources. See the Amazon CloudWatch Synthetics documentation on [DeleteCanary](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DeleteCanary.html) for a full list. Neither AWS nor this provider deletes these implicit resources automatically when the canary is deleted. Before deleting a canary, ensure you have all the information about the canary that you need to delete the implicit resources using the AWS Console, or AWS CLI.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const some = new aws.synthetics.Canary("some", {
 *     name: "some-canary",
 *     artifactS3Location: "s3://some-bucket/",
 *     executionRoleArn: "some-role",
 *     handler: "exports.handler",
 *     zipFile: "test-fixtures/lambdatest.zip",
 *     runtimeVersion: "syn-1.0",
 *     schedule: {
 *         expression: "rate(0 minute)",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * some = aws.synthetics.Canary("some",
 *     name="some-canary",
 *     artifact_s3_location="s3://some-bucket/",
 *     execution_role_arn="some-role",
 *     handler="exports.handler",
 *     zip_file="test-fixtures/lambdatest.zip",
 *     runtime_version="syn-1.0",
 *     schedule={
 *         "expression": "rate(0 minute)",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var some = new Aws.Synthetics.Canary("some", new()
 *     {
 *         Name = "some-canary",
 *         ArtifactS3Location = "s3://some-bucket/",
 *         ExecutionRoleArn = "some-role",
 *         Handler = "exports.handler",
 *         ZipFile = "test-fixtures/lambdatest.zip",
 *         RuntimeVersion = "syn-1.0",
 *         Schedule = new Aws.Synthetics.Inputs.CanaryScheduleArgs
 *         {
 *             Expression = "rate(0 minute)",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/synthetics"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := synthetics.NewCanary(ctx, "some", &synthetics.CanaryArgs{
 * 			Name:               pulumi.String("some-canary"),
 * 			ArtifactS3Location: pulumi.String("s3://some-bucket/"),
 * 			ExecutionRoleArn:   pulumi.String("some-role"),
 * 			Handler:            pulumi.String("exports.handler"),
 * 			ZipFile:            pulumi.String("test-fixtures/lambdatest.zip"),
 * 			RuntimeVersion:     pulumi.String("syn-1.0"),
 * 			Schedule: &synthetics.CanaryScheduleArgs{
 * 				Expression: pulumi.String("rate(0 minute)"),
 * 			},
 * 		})
 * 		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.synthetics.Canary;
 * import com.pulumi.aws.synthetics.CanaryArgs;
 * import com.pulumi.aws.synthetics.inputs.CanaryScheduleArgs;
 * 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 some = new Canary("some", CanaryArgs.builder()
 *             .name("some-canary")
 *             .artifactS3Location("s3://some-bucket/")
 *             .executionRoleArn("some-role")
 *             .handler("exports.handler")
 *             .zipFile("test-fixtures/lambdatest.zip")
 *             .runtimeVersion("syn-1.0")
 *             .schedule(CanaryScheduleArgs.builder()
 *                 .expression("rate(0 minute)")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   some:
 *     type: aws:synthetics:Canary
 *     properties:
 *       name: some-canary
 *       artifactS3Location: s3://some-bucket/
 *       executionRoleArn: some-role
 *       handler: exports.handler
 *       zipFile: test-fixtures/lambdatest.zip
 *       runtimeVersion: syn-1.0
 *       schedule:
 *         expression: rate(0 minute)
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Synthetics Canaries using the `name`. For example:
 * ```sh
 * $ pulumi import aws:synthetics/canary:Canary some some-canary
 * ```
 * @property artifactConfig configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config.
 * @property artifactS3Location Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.
 * @property deleteLambda Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`.
 * @property executionRoleArn ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role.
 * @property failureRetentionPeriod Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
 * @property handler Entry point to use for the source code when running the canary. This value must end with the string `.handler` .
 * @property name Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore.
 * @property runConfig Configuration block for individual canary runs. Detailed below.
 * @property runtimeVersion Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`.
 * @property s3Bucket Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zip_file`.**
 * @property s3Key S3 key of your script. **Conflicts with `zip_file`.**
 * @property s3Version S3 version ID of your script. **Conflicts with `zip_file`.**
 * @property schedule Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below.
 * The following arguments are optional:
 * @property startCanary Whether to run or stop the canary.
 * @property successRetentionPeriod Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
 * @property tags 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.
 * @property vpcConfig Configuration block. Detailed below.
 * @property zipFile ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3_bucket`, `s3_key`, and `s3_version`.**
 */
public data class CanaryArgs(
    public val artifactConfig: Output? = null,
    public val artifactS3Location: Output? = null,
    public val deleteLambda: Output? = null,
    public val executionRoleArn: Output? = null,
    public val failureRetentionPeriod: Output? = null,
    public val handler: Output? = null,
    public val name: Output? = null,
    public val runConfig: Output? = null,
    public val runtimeVersion: Output? = null,
    public val s3Bucket: Output? = null,
    public val s3Key: Output? = null,
    public val s3Version: Output? = null,
    public val schedule: Output? = null,
    public val startCanary: Output? = null,
    public val successRetentionPeriod: Output? = null,
    public val tags: Output>? = null,
    public val vpcConfig: Output? = null,
    public val zipFile: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.synthetics.CanaryArgs =
        com.pulumi.aws.synthetics.CanaryArgs.builder()
            .artifactConfig(artifactConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .artifactS3Location(artifactS3Location?.applyValue({ args0 -> args0 }))
            .deleteLambda(deleteLambda?.applyValue({ args0 -> args0 }))
            .executionRoleArn(executionRoleArn?.applyValue({ args0 -> args0 }))
            .failureRetentionPeriod(failureRetentionPeriod?.applyValue({ args0 -> args0 }))
            .handler(handler?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .runConfig(runConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .runtimeVersion(runtimeVersion?.applyValue({ args0 -> args0 }))
            .s3Bucket(s3Bucket?.applyValue({ args0 -> args0 }))
            .s3Key(s3Key?.applyValue({ args0 -> args0 }))
            .s3Version(s3Version?.applyValue({ args0 -> args0 }))
            .schedule(schedule?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .startCanary(startCanary?.applyValue({ args0 -> args0 }))
            .successRetentionPeriod(successRetentionPeriod?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .vpcConfig(vpcConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .zipFile(zipFile?.applyValue({ args0 -> args0 })).build()
}

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

    private var artifactS3Location: Output? = null

    private var deleteLambda: Output? = null

    private var executionRoleArn: Output? = null

    private var failureRetentionPeriod: Output? = null

    private var handler: Output? = null

    private var name: Output? = null

    private var runConfig: Output? = null

    private var runtimeVersion: Output? = null

    private var s3Bucket: Output? = null

    private var s3Key: Output? = null

    private var s3Version: Output? = null

    private var schedule: Output? = null

    private var startCanary: Output? = null

    private var successRetentionPeriod: Output? = null

    private var tags: Output>? = null

    private var vpcConfig: Output? = null

    private var zipFile: Output? = null

    /**
     * @param value configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config.
     */
    @JvmName("xexxrlaexkvcelsf")
    public suspend fun artifactConfig(`value`: Output) {
        this.artifactConfig = value
    }

    /**
     * @param value Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.
     */
    @JvmName("tnvvemamyomxpgho")
    public suspend fun artifactS3Location(`value`: Output) {
        this.artifactS3Location = value
    }

    /**
     * @param value Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`.
     */
    @JvmName("buapcinsbnjcjjgh")
    public suspend fun deleteLambda(`value`: Output) {
        this.deleteLambda = value
    }

    /**
     * @param value ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role.
     */
    @JvmName("fbbjjdptxesjkvcv")
    public suspend fun executionRoleArn(`value`: Output) {
        this.executionRoleArn = value
    }

    /**
     * @param value Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
     */
    @JvmName("xcveuirbsoxifhvu")
    public suspend fun failureRetentionPeriod(`value`: Output) {
        this.failureRetentionPeriod = value
    }

    /**
     * @param value Entry point to use for the source code when running the canary. This value must end with the string `.handler` .
     */
    @JvmName("uhvpbaaxltuoltjf")
    public suspend fun handler(`value`: Output) {
        this.handler = value
    }

    /**
     * @param value Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore.
     */
    @JvmName("hwakikunrlhelkob")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Configuration block for individual canary runs. Detailed below.
     */
    @JvmName("kcuwdbrwjuoowcrt")
    public suspend fun runConfig(`value`: Output) {
        this.runConfig = value
    }

    /**
     * @param value Runtime version to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`.
     */
    @JvmName("hryavwupvfsrblfp")
    public suspend fun runtimeVersion(`value`: Output) {
        this.runtimeVersion = value
    }

    /**
     * @param value Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zip_file`.**
     */
    @JvmName("iwyufqjmsijyrkrk")
    public suspend fun s3Bucket(`value`: Output) {
        this.s3Bucket = value
    }

    /**
     * @param value S3 key of your script. **Conflicts with `zip_file`.**
     */
    @JvmName("dafmbcykjnpvcawc")
    public suspend fun s3Key(`value`: Output) {
        this.s3Key = value
    }

    /**
     * @param value S3 version ID of your script. **Conflicts with `zip_file`.**
     */
    @JvmName("lqqpljkpiufujdfj")
    public suspend fun s3Version(`value`: Output) {
        this.s3Version = value
    }

    /**
     * @param value Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below.
     * The following arguments are optional:
     */
    @JvmName("bwmaybmletycvqtq")
    public suspend fun schedule(`value`: Output) {
        this.schedule = value
    }

    /**
     * @param value Whether to run or stop the canary.
     */
    @JvmName("ilxxildbomopgoal")
    public suspend fun startCanary(`value`: Output) {
        this.startCanary = value
    }

    /**
     * @param value Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
     */
    @JvmName("jakyegywtvcjjfjr")
    public suspend fun successRetentionPeriod(`value`: Output) {
        this.successRetentionPeriod = value
    }

    /**
     * @param value 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.
     */
    @JvmName("coagdomqkjvvdgrt")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Configuration block. Detailed below.
     */
    @JvmName("ecfjktufqglvsoet")
    public suspend fun vpcConfig(`value`: Output) {
        this.vpcConfig = value
    }

    /**
     * @param value ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3_bucket`, `s3_key`, and `s3_version`.**
     */
    @JvmName("jakgdrsfigigrkix")
    public suspend fun zipFile(`value`: Output) {
        this.zipFile = value
    }

    /**
     * @param value configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config.
     */
    @JvmName("nywdavifbmqnptum")
    public suspend fun artifactConfig(`value`: CanaryArtifactConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.artifactConfig = mapped
    }

    /**
     * @param argument configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config.
     */
    @JvmName("ofpcxemufuthgput")
    public suspend fun artifactConfig(argument: suspend CanaryArtifactConfigArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryArtifactConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.artifactConfig = mapped
    }

    /**
     * @param value Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.
     */
    @JvmName("eddnrhvqhcvtgmuk")
    public suspend fun artifactS3Location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.artifactS3Location = mapped
    }

    /**
     * @param value Specifies whether to also delete the Lambda functions and layers used by this canary. The default is `false`.
     */
    @JvmName("exgidsddjqcvendu")
    public suspend fun deleteLambda(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deleteLambda = mapped
    }

    /**
     * @param value ARN of the IAM role to be used to run the canary. see [AWS Docs](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_CreateCanary.html#API_CreateCanary_RequestSyntax) for permissions needs for IAM Role.
     */
    @JvmName("bwsukdsfybpmglqd")
    public suspend fun executionRoleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.executionRoleArn = mapped
    }

    /**
     * @param value Number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
     */
    @JvmName("ywvoablyqliecjdn")
    public suspend fun failureRetentionPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failureRetentionPeriod = mapped
    }

    /**
     * @param value Entry point to use for the source code when running the canary. This value must end with the string `.handler` .
     */
    @JvmName("sgwggwahltpotqvo")
    public suspend fun handler(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.handler = mapped
    }

    /**
     * @param value Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore.
     */
    @JvmName("orbotpamnblanxli")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Configuration block for individual canary runs. Detailed below.
     */
    @JvmName("yeubdbckqywmpxcq")
    public suspend fun runConfig(`value`: CanaryRunConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runConfig = mapped
    }

    /**
     * @param argument Configuration block for individual canary runs. Detailed below.
     */
    @JvmName("egkaxedjaamrycbl")
    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 to use for the canary. Versions change often so consult the [Amazon CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html) for the latest valid versions. Values include `syn-python-selenium-1.0`, `syn-nodejs-puppeteer-3.0`, `syn-nodejs-2.2`, `syn-nodejs-2.1`, `syn-nodejs-2.0`, and `syn-1.0`.
     */
    @JvmName("iokvqsqyltxvrjqp")
    public suspend fun runtimeVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runtimeVersion = mapped
    }

    /**
     * @param value Full bucket name which is used if your canary script is located in S3. The bucket must already exist. **Conflicts with `zip_file`.**
     */
    @JvmName("qrjrculbttnxwbrv")
    public suspend fun s3Bucket(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.s3Bucket = mapped
    }

    /**
     * @param value S3 key of your script. **Conflicts with `zip_file`.**
     */
    @JvmName("kwithejrgvigvnay")
    public suspend fun s3Key(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.s3Key = mapped
    }

    /**
     * @param value S3 version ID of your script. **Conflicts with `zip_file`.**
     */
    @JvmName("udqalfaoshlyxmgb")
    public suspend fun s3Version(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.s3Version = mapped
    }

    /**
     * @param value Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below.
     * The following arguments are optional:
     */
    @JvmName("unbnjuyplqsgwque")
    public suspend fun schedule(`value`: CanaryScheduleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schedule = mapped
    }

    /**
     * @param argument Configuration block providing how often the canary is to run and when these test runs are to stop. Detailed below.
     * The following arguments are optional:
     */
    @JvmName("eusedbalinmhijoa")
    public suspend fun schedule(argument: suspend CanaryScheduleArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryScheduleArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.schedule = mapped
    }

    /**
     * @param value Whether to run or stop the canary.
     */
    @JvmName("bnwhhwabnorgoabd")
    public suspend fun startCanary(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startCanary = mapped
    }

    /**
     * @param value Number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
     */
    @JvmName("nbeudpqqjjxgkcfw")
    public suspend fun successRetentionPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.successRetentionPeriod = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("uawwkipnboxddqow")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values 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.
     */
    @JvmName("ugdtkgyqnjwlmosl")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Configuration block. Detailed below.
     */
    @JvmName("mxunpqpkqchempkf")
    public suspend fun vpcConfig(`value`: CanaryVpcConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcConfig = mapped
    }

    /**
     * @param argument Configuration block. Detailed below.
     */
    @JvmName("nrwxxwtycfdmrask")
    public suspend fun vpcConfig(argument: suspend CanaryVpcConfigArgsBuilder.() -> Unit) {
        val toBeMapped = CanaryVpcConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.vpcConfig = mapped
    }

    /**
     * @param value ZIP file that contains the script, if you input your canary script directly into the canary instead of referring to an S3 location. It can be up to 225KB. **Conflicts with `s3_bucket`, `s3_key`, and `s3_version`.**
     */
    @JvmName("wtiescoqwtaidhxb")
    public suspend fun zipFile(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zipFile = mapped
    }

    internal fun build(): CanaryArgs = CanaryArgs(
        artifactConfig = artifactConfig,
        artifactS3Location = artifactS3Location,
        deleteLambda = deleteLambda,
        executionRoleArn = executionRoleArn,
        failureRetentionPeriod = failureRetentionPeriod,
        handler = handler,
        name = name,
        runConfig = runConfig,
        runtimeVersion = runtimeVersion,
        s3Bucket = s3Bucket,
        s3Key = s3Key,
        s3Version = s3Version,
        schedule = schedule,
        startCanary = startCanary,
        successRetentionPeriod = successRetentionPeriod,
        tags = tags,
        vpcConfig = vpcConfig,
        zipFile = zipFile,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy