> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Optional: AWS Service Quota Monitoring Stack

## Overview

Gitpod provides a CloudFormation template for monitoring AWS service quotas. This monitoring solution helps prevent deployment disruptions by tracking resource usage against AWS service limits.

## Monitored Services

The stack tracks usage thresholds across essential AWS services for Gitpod deployments. The monitored services include:

* EC2
  * On-Demand vCPU usage

## Alert Management

All alerts route to an SNS topic (created automatically by the CloudFormation template), which you can easily use to send alerts to Slack, Teams, or email.

## Alert costs

This monitoring stack should fit within the AWS CloudWatch free tier as it creates only one alarm. The [AWS CloudWatch free tier](https://aws.amazon.com/cloudwatch/pricing/) includes:

* 10 CloudWatch alarm metrics per month
* 10 alarm state changes per month
* Basic monitoring metrics for Amazon EC2 instances

Today, this stack creates just one alarm to monitor EC2 vCPU quota usage, so it should remain within the free tier limits. If you exceed the free tier limits, standard [AWS CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/) applies:

* \~\$0.30 per metric per month
* \$0.10 per alarm metric per month
* Additional costs for SNS notifications (first 1 million SNS requests per month are free)

If you use the Slack or Microsoft Teams integration, [AWS Chatbot](https://aws.amazon.com/chatbot/pricing/) is free for all AWS customers.

## Deployment Requirements

The stack requires only AWS account access for monitoring setup. The Gitpod instance does not need to be operational before deploying the monitoring stack.

## Installation Options

Below you'll find a few different CloudFormation templates that notify in Slack, Teams, or e-mail. You are welcome to use them "as is", or as a reference to create a custom template of your own.

### AWS Chatbot Integration

#### Slack Configuration

1. Set up AWS Chatbot with Slack using the [official guide](https://docs.aws.amazon.com/chatbot/latest/adminguide/slack-setup.html#slack-client-setup)
2. Note your Slack workspace and channel IDs
3. Deploy the stack using this [CloudFormation template](https://github.com/gitpod-io/enterprise-assets/blob/main/examples/cloudformation/cloudwatch-quota-alarm-slack.yaml). The recommended stack name is `gitpod-quota-alerts`.

#### Microsoft Teams Configuration

1. Set up AWS Chatbot with Teams using the [official guide](https://docs.aws.amazon.com/chatbot/latest/adminguide/teams-setup.html#teams-client-setup)
2. Take note of your Teams team and channel IDs
3. Deploy using this [CloudFormation template](https://github.com/gitpod-io/enterprise-assets/blob/main/examples/cloudformation/cloudwatch-quota-alarm-teams.yaml). The recommended stack name is `gitpod-quota-alerts`.

### Email Notifications

The SNS-based alert system supports direct email notifications. This option works well for:

* Direct email alerts
* Integration with email-to-Slack workflows
* Custom routing through email-based notification systems

You can use this [CloudFormation template](https://github.com/gitpod-io/enterprise-assets/blob/main/examples/cloudformation/cloudwatch-quota-alarm-email.yaml) to deploy the stack. The recommended stack name is `gitpod-quota-alerts`.

Note: For Slack integration via email, refer to [Slack's email integration guide](https://slack.com/help/articles/206819278-Send-emails-to-Slack#h_01F4WDZG8RTCTNAMR4KJ7D419V).
