Resource: aws_synthetics_canary

Provides a Synthetics Canary resource.

Example Usage

resource "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)"
  }
}

Argument Reference

The following arguments are required:

The following arguments are optional:

artifact_config

s3_encryption

schedule

run_config

vpc_config

If this canary tests an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

vpc_config

timeline

Import

In Terraform v1.5.0 and later, use an import block to import Synthetics Canaries using the name. For example:

import {
  to = aws_synthetics_canary.some
  id = "some-canary"
}

Using terraform import, import Synthetics Canaries using the name. For example:

% terraform import aws_synthetics_canary.some some-canary