forked from cloudposse/terraform-aws-rds-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
222 lines (196 loc) · 6.4 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
---
#
# 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-cluster
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-rds-cluster
# Badges to display
badges:
- name: "Build Status"
image: "https://travis-ci.org/cloudposse/terraform-aws-rds-cluster.svg?branch=master"
url: "https://travis-ci.org/cloudposse/terraform-aws-rds-cluster"
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-rds-cluster.svg"
url: "https://github.com/cloudposse/terraform-aws-rds-cluster/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
related:
- name: "terraform-aws-rds"
description: "Terraform module to provision AWS RDS instances"
url: "https://github.com/cloudposse/terraform-aws-rds"
- name: "terraform-aws-rds-cloudwatch-sns-alarms"
description: "Terraform module that configures important RDS alerts using CloudWatch and sends them to an SNS topic"
url: "https://github.com/cloudposse/terraform-aws-rds-cloudwatch-sns-alarms"
# Short description of this project
description: |-
Terraform module to provision an [`RDS Aurora`](https://aws.amazon.com/rds/aurora) cluster for MySQL or Postgres.
# How to use this project
usage: |-
Basic [example](examples/basic)
```hcl
module "rds_cluster_aurora_postgres" {
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
name = "postgres"
engine = "aurora-postgresql"
cluster_family = "aurora-postgresql9.6"
cluster_size = "2"
namespace = "eg"
stage = "dev"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "5432"
instance_type = "db.r4.large"
vpc_id = "vpc-36f54c51"
availability_zones = ["us-east-1a", "us-east-1b"]
security_groups = ["sg-0a6d5a3a"]
subnets = ["subnet-705e3115", "subnet-dab9e2f0"]
zone_id = "Z19EN1IQ979KPE"
}
```
With [cluster parameters](examples/with_cluster_parameters)
```hcl
module "rds_cluster_aurora_mysql" {
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
engine = "aurora"
cluster_family = "aurora-mysql5.7"
cluster_size = "2"
namespace = "eg"
stage = "dev"
name = "db"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
instance_type = "db.t2.small"
vpc_id = "vpc-xxxxxxx"
availability_zones = ["us-east-1a", "us-east-1b"]
security_groups = ["sg-0a6d5a3a"]
subnets = ["subnet-8b03333", "subnet-8b0772a3"]
zone_id = "xxxxxxxx"
cluster_parameters = [
{
name = "character_set_client"
value = "utf8"
},
{
name = "character_set_connection"
value = "utf8"
},
{
name = "character_set_database"
value = "utf8"
},
{
name = "character_set_results"
value = "utf8"
},
{
name = "character_set_server"
value = "utf8"
},
{
name = "collation_connection"
value = "uft8_bin"
},
{
name = "collation_server"
value = "uft8_bin"
},
{
name = "lower_case_table_names"
value = "1"
apply_method = "pending-reboot"
},
{
name = "skip-character-set-client-handshake"
value = "1"
apply_method = "pending-reboot"
},
]
}
```
With [enhanced monitoring](examples/enhanced_monitoring)
```hcl
# create IAM role for monitoring
resource "aws_iam_role" "enhanced_monitoring" {
name = "rds-cluster-example-1"
assume_role_policy = "${data.aws_iam_policy_document.enhanced_monitoring.json}"
}
# Attach Amazon's managed policy for RDS enhanced monitoring
resource "aws_iam_role_policy_attachment" "enhanced_monitoring" {
role = "${aws_iam_role.enhanced_monitoring.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole"
}
# allow rds to assume this role
data "aws_iam_policy_document" "enhanced_monitoring" {
statement {
actions = [
"sts:AssumeRole",
]
effect = "Allow"
principals {
type = "Service"
identifiers = ["monitoring.rds.amazonaws.com"]
}
}
}
module "rds_cluster_aurora_postgres" {
source = "git::https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=master"
engine = "aurora-postgresql"
cluster_family = "aurora-postgresql9.6"
cluster_size = "2"
namespace = "eg"
stage = "dev"
name = "db"
admin_user = "admin1"
admin_password = "Test123456789"
db_name = "dbname"
db_port = "5432"
instance_type = "db.r4.large"
vpc_id = "vpc-xxxxxxx"
availability_zones = ["us-east-1a", "us-east-1b"]
security_groups = ["sg-0a6d5a3a"]
subnets = ["subnet-8b03333", "subnet-8b0772a3"]
zone_id = "xxxxxxxx"
# enable monitoring every 30 seconds
rds_monitoring_interval = "30"
# reference iam role created above
rds_monitoring_role_arn = "${aws_iam_role.enhanced_monitoring.arn}"
}
```
# Example usage
#examples: |-
# Example goes here...
# How to get started quickly
#quickstart: |-
# Here's how to get started...
# Other files to include in this README from the project folder
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Igor Rodionov"
github: "goruha"
- name: "Andriy Knysh"
github: "aknysh"
- name: "Sarkis Varozian"
github: "sarkis"
- name: "Mike Crowe"
github: "mike-zipit"
- name: "Sergey Vasilyev"
github: "s2504s"
- name: "Todor Todorov"
github: "tptodorov"
- name: "Lee Huffman"
github: "leehuffman"