CanaryArgs

data class CanaryArgs(val artifactConfig: Output<CanaryArtifactConfigArgs>? = null, val artifactS3Location: Output<String>? = null, val deleteLambda: Output<Boolean>? = null, val executionRoleArn: Output<String>? = null, val failureRetentionPeriod: Output<Int>? = null, val handler: Output<String>? = null, val name: Output<String>? = null, val runConfig: Output<CanaryRunConfigArgs>? = null, val runtimeVersion: Output<String>? = null, val s3Bucket: Output<String>? = null, val s3Key: Output<String>? = null, val s3Version: Output<String>? = null, val schedule: Output<CanaryScheduleArgs>? = null, val startCanary: Output<Boolean>? = null, val successRetentionPeriod: Output<Int>? = null, val tags: Output<Map<String, String>>? = null, val vpcConfig: Output<CanaryVpcConfigArgs>? = null, val zipFile: Output<String>? = null) : ConvertibleToJava<CanaryArgs>

Provides a Synthetics Canary resource.

NOTE: When you create a canary, AWS creates supporting implicit resources. See the Amazon CloudWatch Synthetics documentation on DeleteCanary 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

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()
.artifactS3Location("s3://some-bucket/")
.executionRoleArn("some-role")
.handler("exports.handler")
.runtimeVersion("syn-1.0")
.schedule(CanaryScheduleArgs.builder()
.expression("rate(0 minute)")
.build())
.zipFile("test-fixtures/lambdatest.zip")
.build());
}
}

Import

Synthetics Canaries can be imported using the name, e.g.,

$ pulumi import aws:synthetics/canary:Canary some some-canary

Constructors

Link copied to clipboard
constructor(artifactConfig: Output<CanaryArtifactConfigArgs>? = null, artifactS3Location: Output<String>? = null, deleteLambda: Output<Boolean>? = null, executionRoleArn: Output<String>? = null, failureRetentionPeriod: Output<Int>? = null, handler: Output<String>? = null, name: Output<String>? = null, runConfig: Output<CanaryRunConfigArgs>? = null, runtimeVersion: Output<String>? = null, s3Bucket: Output<String>? = null, s3Key: Output<String>? = null, s3Version: Output<String>? = null, schedule: Output<CanaryScheduleArgs>? = null, startCanary: Output<Boolean>? = null, successRetentionPeriod: Output<Int>? = null, tags: Output<Map<String, String>>? = null, vpcConfig: Output<CanaryVpcConfigArgs>? = null, zipFile: Output<String>? = null)

Properties

Link copied to clipboard

configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. See Artifact Config.

Link copied to clipboard
val artifactS3Location: Output<String>? = null

Location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary.

Link copied to clipboard
val deleteLambda: Output<Boolean>? = null

Specifies whether to also delete the Lambda functions and layers used by this canary. The default is false.

Link copied to clipboard
val executionRoleArn: Output<String>? = null

ARN of the IAM role to be used to run the canary. see AWS Docs for permissions needs for IAM Role.

Link copied to clipboard
val failureRetentionPeriod: Output<Int>? = null

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.

Link copied to clipboard
val handler: Output<String>? = null

Entry point to use for the source code when running the canary. This value must end with the string .handler .

Link copied to clipboard
val name: Output<String>? = null

Name for this canary. Has a maximum length of 21 characters. Valid characters are lowercase alphanumeric, hyphen, or underscore.

Link copied to clipboard
val runConfig: Output<CanaryRunConfigArgs>? = null

Configuration block for individual canary runs. Detailed below.

Link copied to clipboard
val runtimeVersion: Output<String>? = null

Runtime version to use for the canary. Versions change often so consult the Amazon CloudWatch documentation 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.

Link copied to clipboard
val s3Bucket: Output<String>? = null

Full bucket name which is used if your canary script is located in S3. The bucket must already exist. Conflicts with zip_file.

Link copied to clipboard
val s3Key: Output<String>? = null

S3 key of your script. Conflicts with zip_file.

Link copied to clipboard
val s3Version: Output<String>? = null

S3 version ID of your script. Conflicts with zip_file.

Link copied to clipboard
val schedule: Output<CanaryScheduleArgs>? = null

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:

Link copied to clipboard
val startCanary: Output<Boolean>? = null

Whether to run or stop the canary.

Link copied to clipboard
val successRetentionPeriod: Output<Int>? = null

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.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

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.

Link copied to clipboard
val vpcConfig: Output<CanaryVpcConfigArgs>? = null

Configuration block. Detailed below.

Link copied to clipboard
val zipFile: Output<String>? = null

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.

Functions

Link copied to clipboard
open override fun toJava(): CanaryArgs