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.

CloudFormation
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.

CloudFormation
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`.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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.

CloudFormation
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`.

CloudFormation
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`.

CloudFormation