A collection of configuration templates for AWS CloudWatch resources (including CloudWatch Logs, Alarms, Synthetics, Cross-Account Observability, and Application Insights) as well as security controls for monitoring and protecting AWS CloudWatch configuration such as Config Rules, CloudWatch Alarms, EventBridge Rules, IAM policies, and more.

CloudWatch
CloudWatch Billing Alarm with SNS Notification

This CloudFormation template creates a CloudWatch Alarm that triggers when the AWS bill reaches the specified threshold. It also creates an SNS topic to send email notifications when the alarm is triggered.

CloudFormationTerraform
CloudWatch Subscription Filter with Delivery to Kinesis

This template creates a subscription filter and associates it with the specified log group. The subscription filter sends log events that are associated with the `Root` user to a Kinesis data stream.

CloudFormationTerraform
CloudWatch Metric Filter Example

This template creates a metric filter that sends a value of `1` to the `404Count` metric whenever the status code field includes a `404` value. The metric filter is associated with the log group `myLogGroup`.

CloudFormationTerraform
CloudWatch Alarm Based on an Anomaly Detector

This template creates an alarm that is based on an anomaly detector. It creates an AWS::CloudWatch::AnomalyDetector resource with the specified properties, including the MetricName, Namespace, and Stat. It then creates an AWS::CloudWatch::Alarm resource with the specified properties, including the AlarmDescription, AlarmName, ComparisonOperator, EvaluationPeriods, Metrics, ThresholdMetricId, and TreatMissingData.

CloudFormationTerraform
CloudWatch Metric Stream

This template creates a metric stream that streams only the metrics in the `AWS/ELB` and `AWS/EC2` namespaces. It specifies the output format as JSON and sets the Firehose ARN and Role ARN.

CloudFormationTerraform
CloudWatch Logs Destination

This template creates a CloudWatch Logs destination. The destination is named 'TestDestination' and is associated with a role named 'LogKinesisRole'. The destination is configured to send log events to an Amazon Kinesis data stream named 'TestStream'. The destination policy allows the 'logs.amazonaws.com' principal to perform the 'logs:PutSubscriptionFilter' action on the destination.

CloudFormationTerraform
CloudWatch Logs Resource Policy

This template creates or updates a resource policy that allows other AWS services to put log events to this account. An account can have up to 10 resource policies per AWS Region.

CloudFormationTerraform
AWS CloudWatch Composite Alarm Example

Creates a CloudWatch Composite Alarm that triggers based on the state of other alarms.

Terraform
CloudWatch Dashboard for EC2 CPU Utilization and Static Text

Creates a CloudWatch dashboard with a widget for monitoring CPU utilization of an EC2 instance and a text widget.

Terraform
EC2 CPU Utilization Alarm

Creates a CloudWatch Metric Alarm for monitoring EC2 CPU utilization to trigger if it meets or exceeds a threshold.

Terraform
CloudWatch Metric Stream to Kinesis Firehose

This template sets up a CloudWatch Metric Stream that filters and sends specific AWS/EC2 and AWS/EBS metrics to an Amazon Kinesis Firehose delivery stream, which then stores the data in an S3 bucket.

Terraform
CloudWatch Metric Stream with Additional Statistics

This template configures a CloudWatch Metric Stream to include additional statistics for the CPUUtilization metric from the AWS/EC2 namespace.

Terraform
Application Insights
Application Insights Application with DEFAULT Mode Component Configuration

This template creates an Application Insights application with DEFAULT mode component configuration. It creates an application and sets `ComponentConfigurationMode` to `DEFAULT` and `Tier` to `SQL_SERVER` for the `my_component` component. The component is configured with the recommended monitoring settings for the `SQL_SERVER` tier.

CloudFormationTerraform
Application Insights Application with Detailed Settings

This template creates an Application Insights application with detailed settings. It enables CloudWatch Events notification and OpsCenter, tags the application with two tags, creates two custom instance group components, and creates two log pattern sets. It also sets `AutoConfigurationEnabled` to `true` to configure all components with the recommended monitoring settings for the `DEFAULT` tier.

CloudFormationTerraform
Application Insights Application with All Components in the Account

This template creates an Application Insights application that includes all of the components in the account. It sets `GroupingType` to `ACCOUNT_BASED` to create an account level-based application that includes all of the supported resources in the account. It also sets `AutoConfigurationEnabled` to `true` to configure all components with the recommended monitoring settings for the `DEFAULT` tier.

CloudFormationTerraform
Application Insights Application with Recommended Monitoring Settings

This template creates an Application Insights application with all components configured with recommended monitoring settings. It sets `AutoConfigurationEnabled` to `true` to configure all components with the recommended monitoring settings for the `DEFAULT` tier.

CloudFormationTerraform
Application Insights Application with CUSTOM Mode Component Configuration

This template creates an Application Insights application with CUSTOM mode component configuration. It creates an application and sets `ComponentConfigurationMode` to `CUSTOM` for the `my_component` component. The component is configured with custom settings specified in `CustomComponentConfiguration`.

CloudFormationTerraform
Application Insights Application with DEFAULT_WITH_OVERWRITE Mode Component Configuration

This template creates an Application Insights application with DEFAULT_WITH_OVERWRITE mode component configuration. It creates an application and sets `ComponentConfigurationMode` to `DEFAULT_WITH_OVERWRITE` and `Tier` to `DOT_NET_CORE` for the `my_component` component. The component is configured with the recommended monitoring settings for the `DOT_NET_CORE` tier, with overwritten configuration settings specified in `DefaultOverwriteComponentConfiguration`.

CloudFormationTerraform
CloudWatch Evidently
AWS Evidently Feature with Default Variation

Configures an AWS Evidently feature with multiple variations and specifies a default variation.

Terraform
AWS Evidently Feature with Entity Overrides

Sets up an AWS Evidently feature with entity overrides to specify which variation a particular entity receives.

Terraform
AWS Evidently Feature with Evaluation Strategy

Implements an AWS Evidently feature with a specific evaluation strategy and entity overrides.

Terraform
Basic AWS Evidently Launch Template

A basic configuration for an AWS Evidently Launch resource with a single group and scheduled split.

Terraform
AWS Evidently Launch Template with Description

Configures an AWS Evidently Launch resource with a description and a single group.

Terraform
AWS Evidently Launch Template with Multiple Groups

Defines an AWS Evidently Launch resource with multiple groups and a scheduled split configuration.

Terraform
AWS Evidently Launch Template with Metric Monitors

Configures an AWS Evidently Launch resource with metric monitors and a scheduled split.

Terraform
AWS Evidently Launch Template with Randomization Salt

Sets up an AWS Evidently Launch resource with a randomization salt and a single group.

Terraform
AWS Evidently Launch Template with Multiple Steps

Configures an AWS Evidently Launch resource with multiple groups and multiple steps in the scheduled split.

Terraform
AWS Evidently Launch Template with Segment Overrides

Implements an AWS Evidently Launch resource with segment overrides for detailed control over variations.

Terraform