Canary

class Canary : KotlinCustomResource

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

Properties

Link copied to clipboard
val arn: Output<String>

Amazon Resource Name (ARN) of the Canary.

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

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

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

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

Link copied to clipboard
val engineArn: Output<String>

ARN of the Lambda function that is used as your canary's engine.

Link copied to clipboard

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

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>

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 id: Output<String>
Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Configuration block for individual canary runs. Detailed below.

Link copied to clipboard
val runtimeVersion: Output<String>

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>?

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>?

S3 key of your script. Conflicts with zip_file.

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

S3 version ID of your script. Conflicts with zip_file.

Link copied to clipboard

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

ARN of the Lambda layer where Synthetics stores the canary script code.

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

Whether to run or stop the canary.

Link copied to clipboard
val status: Output<String>

Canary status.

Link copied to clipboard

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>>?

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 tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard

Structure that contains information about when the canary was created, modified, and most recently run. see Timeline.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

Configuration block. Detailed below.

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

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.