Skip to content

Commit

Permalink
Update README (#1)
Browse files Browse the repository at this point in the history
* Update related links

* Address CR comments
  • Loading branch information
osterman authored Jul 13, 2018
1 parent 4d822ef commit 3e91f6a
Show file tree
Hide file tree
Showing 8 changed files with 371 additions and 24 deletions.
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
*.tfstate
*.tfstate.*
**/*.pem
# Compiled files
**/*.tfstate
**/*.tfstate.backup
**/*.terraform.tfstate*
# Module directory
.idea
*.iml
**/.terraform
**/terraform.tfstate
**/terraform.tfstate.backup

dev.auto.tfvars
*.zip
build-harness
.build-harness
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
addons:
apt:
packages:
- git
- make
- curl

install:
- make init

script:
- make terraform/install
- make terraform/get-plugins
- make terraform/get-modules
- make terraform/lint
- make terraform/validate
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SHELL := /bin/bash

# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/targets.md docs/terraform.md

-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)

## Lint terraform code
lint:
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
214 changes: 198 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
# terraform-aws-rds-alerts
<!-- This file was automatically generated by the `build-harness`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->

[![Cloud Posse](https://cloudposse.com/logo-300x69.svg)](https://cloudposse.com)

# terraform-aws-rds-cloudwatch-sns-alarms

[![Build Status](https://travis-ci.org/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms.svg)](https://github.com/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms/releases) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)


Terraform module that configures important RDS alerts using CloudWatch and sends them to an SNS topic.

Create a set of sane RDS CloudWatch alerts for monitoring the health of an RDS instance.


---

This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps.


It's 100% Open Source and licensed under the [APACHE2](LICENSE).





## Usage


| area | metric | comparison operator | threshold | rationale |
|---------|------------------|----------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Storage | BurstBalance | `<` | 20 % | 20 % of credits allow you to burst for a few minutes which gives you enough time to a) fix the inefficiency, b) add capacity or c) switch to io1 storage type. |
Expand All @@ -12,7 +36,13 @@ Create a set of sane RDS CloudWatch alerts for monitoring the health of an RDS i
| Memory | FreeableMemory | `<` | 64 MB | This number is calculated from our experience with RDS workloads. |
| Memory | SwapUsage | `>` | 256 MB | Sometimes you can not entirely avoid swapping. But once the database accesses paged memory, it will slow down. |

## Example



## Examples


See the [`examples/`](examples/) directory for working examples.

```hcl
resource "aws_db_instance" "default" {
Expand All @@ -26,24 +56,176 @@ resource "aws_db_instance" "default" {
username = "foo"
password = "foobarbaz"
parameter_group_name = "default.mysql5.7"
apply_immediately = "true"
skip_final_snapshot = "true"
apply_immediately = "true"
skip_final_snapshot = "true"
}
module "rds_alarms" {
source = "github::https://github.com/bitflight-public/terraform-aws-rds-alerts.git?ref=master"
source = "github::https://github.com/cloudposse/terraform-aws-rds-alerts.git?ref=master"
db_instance_id = "${aws_db_instance.default.id}"
}
```

## Variables
| Name | Description | Required |
|------------------------------|------------------------------------------------------------------------------------------|----------|
| db_instance_id | The instance ID of the RDS database instance that you want to monitor. | Yes |
| burst_balance_threshold | The minimum percent of General Purpose SSD (gp2) burst-bucket I/O credits available. | No |
| cpu_utilization_threshold | The maximum percentage of CPU utilization. | No |
| cpu_credit_balance_threshold | The minimum number of CPU credits (t2 instances only) available. | No |
| disk_queue_depth_threshold | The maximum number of outstanding IOs (read/write requests) waiting to access the disk. | No |
| freeable_memory_threshold | The minimum amount of available random access memory in Byte. | No |
| free_storage_space_threshold | The minimum amount of available storage space in Byte. | No |
| swap_usage_threshold | The maximum amount of swap space used on the DB instance in Byte. | No |



## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| burst_balance_threshold | The minimum percent of General Purpose SSD (gp2) burst-bucket I/O credits available. | string | `20` | no |
| cpu_credit_balance_threshold | The minimum number of CPU credits (t2 instances only) available. | string | `20` | no |
| cpu_utilization_threshold | The maximum percentage of CPU utilization. | string | `80` | no |
| db_instance_id | The instance ID of the RDS database instance that you want to monitor. | string | - | yes |
| disk_queue_depth_threshold | The maximum number of outstanding IOs (read/write requests) waiting to access the disk. | string | `64` | no |
| free_storage_space_threshold | The minimum amount of available storage space in Byte. | string | `2000000000` | no |
| freeable_memory_threshold | The minimum amount of available random access memory in Byte. | string | `64000000` | no |
| swap_usage_threshold | The maximum amount of swap space used on the DB instance in Byte. | string | `256000000` | no |

## Outputs

| Name | Description |
|------|-------------|
| sns_topic_arn | The ARN of the SNS topic |

## Makefile Targets
```
Available targets:
help This help screen
help/all Display help for all targets
lint Lint terraform code
```



## Related Projects

Check out these related projects.

- [terraform-aws-ec2-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-ec2-cloudwatch-sns-alarms) - Terraform module that configures CloudWatch SNS alerts for EC2 instances
- [terraform-aws-ecs-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms) - Terraform module for creating ECS service level alerts that go to an SNS endpoint
- [terraform-aws-efs-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-efs-cloudwatch-sns-alarms) - Terraform module that configures CloudWatch SNS alerts for EFS
- [terraform-aws-elasticache-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-elasticache-cloudwatch-sns-alarms) - Terraform module that configures CloudWatch SNS alerts for ElastiCache
- [terraform-aws-lambda-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-lambda-cloudwatch-sns-alarms) - Terraform module for creating a set of Lambda alarms and outputting to an endpoint
- [terraform-aws-sqs-cloudwatch-sns-alarms](https://github.com/cloudposse/terraform-aws-sqs-cloudwatch-sns-alarms) - Terraform module for creating alarms for SQS and notifying endpoints



## Help

**Got a question?**

File a GitHub [issue](https://github.com/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms/issues), send us an [email][email] or join our [Slack Community][slack].

## Commerical Support

Work directly with our team of DevOps experts via email, slack, and video conferencing.

We provide *commercial support* for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a fulltime engineer.

[![E-Mail](https://img.shields.io/badge/[email protected])](mailto:[email protected])

- **Questions.** We'll use a Shared Slack channel between your team and ours.
- **Troubleshooting.** We'll help you triage why things aren't working.
- **Code Reviews.** We'll review your Pull Requests and provide constructive feedback.
- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
- **Build New Terraform Modules.** We'll develop original modules to provision infrastructure.
- **Cloud Architecture.** We'll assist with your cloud strategy and design.
- **Implementation.** We'll provide hands on support to implement our reference architectures.


## Community Forum

Get access to our [Open Source Community Forum][slack] on Slack. It's **FREE** to join for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build *sweet* infrastructure.

## Contributing

### Bug Reports & Feature Requests

Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms/issues) to report any bugs or file feature requests.

### Developing

If you are interested in being a contributor and want to get involved in developing this project or [help out](https://github.com/orgs/cloudposse/projects/3) with our other projects, we would love to hear from you! Shoot us an [email](mailto:[email protected]).

In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

1. **Fork** the repo on GitHub
2. **Clone** the project to your own machine
3. **Commit** changes to your own branch
4. **Push** your work back up to your fork
5. Submit a **Pull Request** so that we can review your changes

**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!


## Copyright

Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com)



## License

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

See [LICENSE](LICENSE) for full details.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.


## Trademarks

All other trademarks referenced herein are the property of their respective owners.

## About

This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know at <[email protected]>

[![Cloud Posse](https://cloudposse.com/logo-300x69.svg)](https://cloudposse.com)

We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We love [Open Source Software](https://github.com/cloudposse/)!

We offer paid support on all of our projects.

Check out [our other projects][github], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.

[docs]: https://docs.cloudposse.com/
[website]: https://cloudposse.com/
[github]: https://github.com/cloudposse/
[jobs]: https://cloudposse.com/jobs/
[hire]: https://cloudposse.com/contact/
[slack]: https://slack.cloudposse.com/
[linkedin]: https://www.linkedin.com/company/cloudposse
[twitter]: https://twitter.com/cloudposse/
[email]: mailto:[email protected]


### Contributors

| [![Jamie Nelson][Jamie-BitFlight_avatar]][Jamie-BitFlight_homepage]<br/>[Jamie Nelson][Jamie-BitFlight_homepage] | [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] |
|---|---|

[Jamie-BitFlight_homepage]: https://github.com/Jamie-BitFlight
[Jamie-BitFlight_avatar]: https://github.com/Jamie-BitFlight.png?size=150
[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://github.com/osterman.png?size=150


107 changes: 107 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: terraform-aws-rds-cloudwatch-sns-alarms

# License of this project
license: "APACHE2"

# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-rds-cloudwatch-sns-alarms

# Badges to display
badges:
- name: "Build Status"
image: "https://travis-ci.org/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms.svg?branch=master"
url: "https://travis-ci.org/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms.svg"
url: "https://github.com/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms/releases"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"

# Short description of this project
description: |-
Terraform module that configures important RDS alerts using CloudWatch and sends them to an SNS topic.
Create a set of sane RDS CloudWatch alerts for monitoring the health of an RDS instance.
usage: |-
| area | metric | comparison operator | threshold | rationale |
|---------|------------------|----------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Storage | BurstBalance | `<` | 20 % | 20 % of credits allow you to burst for a few minutes which gives you enough time to a) fix the inefficiency, b) add capacity or c) switch to io1 storage type. |
| Storage | DiskQueueDepth | `>` | 64 | This number is calculated from our experience with RDS workloads. |
| Storage | FreeStorageSpace | `<` | 2 GB | 2 GB usually provides enough time to a) fix why so much space is consumed or b) add capacity. You can also modify this value to 10% of your database capacity. |
| CPU | CPUUtilization | `>` | 80 % | Queuing theory tells us the latency increases exponentially with utilization. In practice, we see higher latency when utilization exceeds 80% and unacceptable high latency with utilization above 90% |
| CPU | CPUCreditBalance | `<` | 20 | One credit equals 1 minute of 100% usage of a vCPU. 20 credits should give you enough time to a) fix the inefficiency, b) add capacity or c) don't use t2 type. |
| Memory | FreeableMemory | `<` | 64 MB | This number is calculated from our experience with RDS workloads. |
| Memory | SwapUsage | `>` | 256 MB | Sometimes you can not entirely avoid swapping. But once the database accesses paged memory, it will slow down. |
examples: |-
See the [`examples/`](examples/) directory for working examples.
```hcl
resource "aws_db_instance" "default" {
allocated_storage = 10
storage_type = "gp2"
engine = "mysql"
engine_version = "5.7"
instance_class = "db.t2.micro"
identifier_prefix = "rds-server-example"
name = "mydb"
username = "foo"
password = "foobarbaz"
parameter_group_name = "default.mysql5.7"
apply_immediately = "true"
skip_final_snapshot = "true"
}
module "rds_alarms" {
source = "github::https://github.com/cloudposse/terraform-aws-rds-alerts.git?ref=master"
db_instance_id = "${aws_db_instance.default.id}"
}
```
# Other files to include in this README from the project folder
include:
- "docs/terraform.md"
- "docs/targets.md"

related:
- name: "terraform-aws-ec2-cloudwatch-sns-alarms"
description: "Terraform module that configures CloudWatch SNS alerts for EC2 instances"
url: "https://github.com/cloudposse/terraform-aws-ec2-cloudwatch-sns-alarms"

- name: "terraform-aws-ecs-cloudwatch-sns-alarms"
description: "Terraform module for creating ECS service level alerts that go to an SNS endpoint"
url: "https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms"

- name: "terraform-aws-efs-cloudwatch-sns-alarms"
description: "Terraform module that configures CloudWatch SNS alerts for EFS"
url: "https://github.com/cloudposse/terraform-aws-efs-cloudwatch-sns-alarms"

- name: "terraform-aws-elasticache-cloudwatch-sns-alarms"
description: "Terraform module that configures CloudWatch SNS alerts for ElastiCache"
url: "https://github.com/cloudposse/terraform-aws-elasticache-cloudwatch-sns-alarms"

- name: "terraform-aws-lambda-cloudwatch-sns-alarms"
description: "Terraform module for creating a set of Lambda alarms and outputting to an endpoint"
url: "https://github.com/cloudposse/terraform-aws-lambda-cloudwatch-sns-alarms"

- name: "terraform-aws-sqs-cloudwatch-sns-alarms"
description: "Terraform module for creating alarms for SQS and notifying endpoints"
url: "https://github.com/cloudposse/terraform-aws-sqs-cloudwatch-sns-alarms"

# Contributors to this project
contributors:
- name: "Jamie Nelson"
github: "Jamie-BitFlight"
- name: "Erik Osterman"
github: "osterman"
Loading

0 comments on commit 3e91f6a

Please sign in to comment.