Canary
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
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)",
},
});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=aws.synthetics.CanaryScheduleArgs(
expression="rate(0 minute)",
))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)",
},
});
});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
})
}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());
}
}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:
$ pulumi import aws:synthetics/canary:Canary some some-canaryProperties
ARN of the IAM role to be used to run the canary. see AWS Docs for permissions needs for IAM Role.
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.