Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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.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