Skip to content

Amazon CloudWatch Synthetics now allows attaching custom dependencies to canaries using AWS Lambda Layers

2 minute read
Content level: Intermediate
0

Whats New announcement

Amazon CloudWatch Synthetics utilizes AWS Lambda functions to periodically run modular, lightweight scripts called canaries that monitor your endpoints and APIs from the outside-in. Starting today, you can add custom dependencies to your canary by attaching a Lambda Layer in addition to the pre-installed dependencies and runtimes (like Puppeteer or Selenium) to your canary. Lambda Layers usually contain library dependencies, a custom runtime, or configuration files and offer several advantages, including sharing of common libraries such as authentication or logging across multiple canaries thereby reducing the overall canary script size and improving maintainability of the canary script code. You are now able to update one Lambda Layer which eliminates the need to update every canary script code to update your dependencies or custom libraries.

It’s easy to get started with attaching a Lambda Layer to your canary. You can provide a custom Lambda Layer Amazon Resource Name (ARN) when creating or updating a canary through the AWS API or CloudFormation. CloudWatch Synthetics will validate the layer exists and attach it to your canary’s Lambda function. Your canary scripts will then import and use any dependencies provided by your custom layer at the time of execution. For more information about how to use this feature, refer to AWS documentation. The capability is available in all the commercial AWS Regions.