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.
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.
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.
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`.
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.
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.
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.
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.
Creates a CloudWatch Composite Alarm that triggers based on the state of other alarms.
Creates a CloudWatch dashboard with a widget for monitoring CPU utilization of an EC2 instance and a text widget.
Creates a CloudWatch Metric Alarm for monitoring EC2 CPU utilization to trigger if it meets or exceeds a threshold.
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.
This template configures a CloudWatch Metric Stream to include additional statistics for the CPUUtilization metric from the AWS/EC2 namespace.
This template creates a query definition for CloudWatch Logs Insights. The query definition has a name and a query string that specifies the fields to include, the sorting order, and the limit of results.
This template creates a log stream named `MyAppLogStream` in the `exampleLogGroup` log group.
This template creates a log group that uses a data protection policy to mask email addresses, and send audit findings to CloudWatch Logs, Kinesis Data Firehose, and Amazon S3.
This template creates a log group that retains events for 7 days and is encrypted with a new KMS key that is created in the template.
Creates a data protection policy for a CloudWatch Log Group to audit and deidentify sensitive data.
Creates a CloudWatch Logs destination and attaches an access policy to it, allowing specified AWS accounts to put subscription filters.
Creates a CloudWatch Log Metric Filter and a Log Group to count access events in a specified log file.
This template creates composite alarms named "HighResourceUsage" and "DeploymentInProgress", and also creates metrics alarms named "HighCPUUsage" and "HighMemoryUsage". "DeploymentInProgress" is an alarm that must be manually set to TRUE or FALSE. The "HighResourceUsage" alarm goes into ALARM state only if both "HighCPUUsage" and "HighMemoryUsage" are in ALARM state, and if "DeploymentInProgress" is FALSE. Only "HighResourceUsage" has the alarm action of notifying SNS. This reduces alarm noise, so that you are alerted only if both CPU usage and memory usage are high, and a deployment is not currently in progress.
This template creates an anomaly detector model for the metric named `JvmMetric` with the dimension value of `UsedMemory`. It excludes a time range from the model training.
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.
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.
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.
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.
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`.
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`.
This template creates a link from the current source account to a sink in another account. Logs and traces are shared over this link, but metrics are not.
This template creates a sink that allows all accounts in a specified organization to create links to share metric and log data.
This template creates a sink that allows the account with the ID `111111111111` to create a link to share metrics, logs, and traces.
This template configures an API Gateway account to use a specific IAM role for CloudWatch logging.
Configures API Gateway method settings to log errors only for a specific method.
Configures API Gateway method settings to log both errors and info for a specific method.
Configures API Gateway method settings for full request and response logging for a specific method.
Creates an AWS CloudWatch Observability Access Manager Sink and attaches a policy to it.
Configures an AWS Evidently feature with multiple variations and specifies a default variation.
Sets up an AWS Evidently feature with entity overrides to specify which variation a particular entity receives.
Implements an AWS Evidently feature with a specific evaluation strategy and entity overrides.
A basic configuration for an AWS Evidently Launch resource with a single group and scheduled split.
Configures an AWS Evidently Launch resource with a description and a single group.
Defines an AWS Evidently Launch resource with multiple groups and a scheduled split configuration.
Configures an AWS Evidently Launch resource with metric monitors and a scheduled split.
Sets up an AWS Evidently Launch resource with a randomization salt and a single group.
Configures an AWS Evidently Launch resource with multiple groups and multiple steps in the scheduled split.
Implements an AWS Evidently Launch resource with segment overrides for detailed control over variations.
A Config rule that checks whether CloudWatch alarms have at least one alarm action, one INSUFFICIENT_DATA action, or one OK action enabled. Optionally, checks whether any of the actions matches one of the specified ARNs.
A Config rule that checks whether the specified resource type has a CloudWatch alarm for the specified metric. For resource type, you can specify EBS volumes, EC2 instances, RDS clusters, or S3 buckets.
A Config rule that checks whether CloudWatch alarms with the given metric name have the specified settings.
A Config rule that checks whether a log group in Amazon CloudWatch Logs is encrypted. The rule is NON_COMPLIANT if CloudWatch Logs has a log group without encryption enabled
A Config rule that checks whether Amazon CloudWatch LogGroup retention period is set to specific number of days. The rule is NON_COMPLIANT if the retention period is not set or is less than the configured retention period.
Checks if Amazon CloudWatch alarms actions are in enabled state. The rule is NON_COMPLIANT if the CloudWatch alarms actions are not in enabled state.