Skip to content

Commit f2d24ff

Browse files
feat: Remove Enhanced Backups functionality, will be added as standalone module (#14)
* fix: enable deletion protection by default * feat: remove enhanced backups, this should be an own module * fix: For security reasons, we do not use the standard port here. * docs: Remove documentation for the enhanced backup feature * chore: fix indentation * chore: consolidate file organization * fix: increase password length for the master user from 24 to 40 * fix: remove prefix / at aws kms key * chore: file organisation * terraform-docs: automated action * docs: Update docs that enhanced backups don't exists anymore --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent bf3376e commit f2d24ff

File tree

9 files changed

+33
-94
lines changed

9 files changed

+33
-94
lines changed

.terraform-docs.yml

-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ content: |-
3232
```hcl
3333
{{ include "examples/with-rds-proxy/main.tf" }}
3434
```
35-
### with enhanced Backups
36-
```hcl
37-
{{ include "examples/with-enhanced-backups/main.tf" }}
38-
```
3935
4036
output:
4137
file: "README.md"

README.md

+5-23
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,10 @@
3535

3636
# Terraform AWS RDS Aurora Cluster
3737

38-
This Terraform module provides a preconfigured solution for setting up AWS
39-
RDS Aurora clusters in your AWS account. With this module, you can easily
40-
and efficiently create and manage RDS Aurora clusters with advanced features
41-
such as extended backups for daily, weekly, monthly, quarterly, and yearly
42-
intervals. Our team has extensive experience working with AWS RDS Aurora
43-
and has optimized this module to provide the best possible experience for
44-
users.
38+
This Terraform module provides a preconfigured solution for setting up AWS RDS Aurora clusters in your AWS account.
39+
With this module, you can easily and efficiently create and manage RDS Aurora clusters with advanced features. Our
40+
team has extensive experience working with AWS RDS Aurora and has optimized this module to provide the best possible
41+
experience for users.
4542

4643
By using this Terraform module, you can save time and effort in setting
4744
up and managing your RDS Aurora clusters, as well as ensure that your data
@@ -76,9 +73,8 @@ such as extended backups, user management, and autoscaling.
7673
| <a name="input_db_instance_parameter_group_name"></a> [db\_instance\_parameter\_group\_name](#input\_db\_instance\_parameter\_group\_name) | The name of the DB parameter group. | `string` | `null` | no |
7774
| <a name="input_db_instance_parameters"></a> [db\_instance\_parameters](#input\_db\_instance\_parameters) | The name and values of the DB parameters. | <pre>list(object({<br> apply_method = optional(string)<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
7875
| <a name="input_db_proxy_users"></a> [db\_proxy\_users](#input\_db\_proxy\_users) | List of DB Proxy users. | `list(string)` | <pre>[<br> "application_dml",<br> "application_ddl"<br>]</pre> | no |
79-
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | If the DB instance should have deletion protection enabled. | `bool` | `false` | no |
76+
| <a name="input_deletion_protection"></a> [deletion\_protection](#input\_deletion\_protection) | If the DB instance should have deletion protection enabled. | `bool` | `true` | no |
8077
| <a name="input_enable_db_proxy"></a> [enable\_db\_proxy](#input\_enable\_db\_proxy) | Enable DB Proxy. | `bool` | `true` | no |
81-
| <a name="input_enable_enhanced_backups"></a> [enable\_enhanced\_backups](#input\_enable\_enhanced\_backups) | Enable enhanced backups. | `bool` | `true` | no |
8278
| <a name="input_enabled_cloudwatch_logs_exports"></a> [enabled\_cloudwatch\_logs\_exports](#input\_enabled\_cloudwatch\_logs\_exports) | Set of log types to enable for exporting to CloudWatch logs. | `list(string)` | <pre>[<br> "audit",<br> "error",<br> "general",<br> "slowquery"<br>]</pre> | no |
8379
| <a name="input_engine"></a> [engine](#input\_engine) | The engine to use. | `string` | `"aurora-mysql"` | no |
8480
| <a name="input_engine_mode"></a> [engine\_mode](#input\_engine\_mode) | The engine mode to use. | `string` | `"provisioned"` | no |
@@ -139,18 +135,4 @@ module "with-rds-proxy" {
139135
enable_db_proxy = true
140136
}
141137
```
142-
### with enhanced Backups
143-
```hcl
144-
module "with-enhanced-backups" {
145-
source = "../../"
146-
147-
cluster_identifier = "my-cluster"
148-
database_subnet_group_name = "db-subnet-group-name"
149-
instance_class = "db.t4g.medium"
150-
vpc_security_group_ids_rds_cluster = ["sg-1234567890"]
151-
vpc_subnet_ids = ["subnet-12345678", "subnet-87654321"]
152-
153-
enable_enhanced_backups = true
154-
}
155-
```
156138
<!-- END_TF_DOCS -->

examples/with-enhanced-backups/main.tf

-11
This file was deleted.

main.tf

+4-29
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
/**
22
* # Terraform AWS RDS Aurora Cluster
33
*
4-
* This Terraform module provides a preconfigured solution for setting up AWS
5-
* RDS Aurora clusters in your AWS account. With this module, you can easily
6-
* and efficiently create and manage RDS Aurora clusters with advanced features
7-
* such as extended backups for daily, weekly, monthly, quarterly, and yearly
8-
* intervals. Our team has extensive experience working with AWS RDS Aurora
9-
* and has optimized this module to provide the best possible experience for
10-
* users.
4+
* This Terraform module provides a preconfigured solution for setting up AWS RDS Aurora clusters in your AWS account.
5+
* With this module, you can easily and efficiently create and manage RDS Aurora clusters with advanced features. Our
6+
* team has extensive experience working with AWS RDS Aurora and has optimized this module to provide the best possible
7+
* experience for users.
118
*
129
* By using this Terraform module, you can save time and effort in setting
1310
* up and managing your RDS Aurora clusters, as well as ensure that your data
@@ -131,28 +128,6 @@ module "db_event_subscription" {
131128
recipients = var.database_event_recipients
132129
}
133130

134-
module "backup" {
135-
count = var.enable_enhanced_backups ? 1 : 0
136-
137-
source = "github.com/geekcell/terraform-aws-backup?ref=v1"
138-
139-
# Vault name for this backup
140-
vault_name = "${var.cluster_identifier}-rds"
141-
142-
# Backup plan name, most of the time the identifier of the cluster is fine
143-
backup_name = "${var.cluster_identifier}-rds"
144-
145-
# Resources to backup
146-
resources = [
147-
module.rds_cluster.arn
148-
]
149-
150-
# AWS needs to know what kind of services we want to backup
151-
service = "rds"
152-
153-
tags = var.tags
154-
}
155-
156131
module "db_instance_parameter_group" {
157132
count = length(var.db_instance_parameters) > 0 ? 1 : 0
158133

modules/rds_cluster/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
| <a name="input_iam_database_authentication_enabled"></a> [iam\_database\_authentication\_enabled](#input\_iam\_database\_authentication\_enabled) | Specifies whether or not mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. | `bool` | `false` | no |
2828
| <a name="input_iam_roles"></a> [iam\_roles](#input\_iam\_roles) | A List of ARNs for the IAM roles to associate to the RDS Cluster. | `list(string)` | `null` | no |
2929
| <a name="input_iops"></a> [iops](#input\_iops) | The amount of Provisioned IOPS to be initially allocated for each DB instance in the Multi-AZ DB cluster. | `number` | `null` | no |
30-
| <a name="input_port"></a> [port](#input\_port) | The port on which the DB accepts connections. | `number` | `3306` | no |
30+
| <a name="input_port"></a> [port](#input\_port) | The port on which the DB accepts connections. | `number` | `6033` | no |
3131
| <a name="input_preferred_backup_window"></a> [preferred\_backup\_window](#input\_preferred\_backup\_window) | The daily time range (in UTC) during which automated backups are created if they are enabled. | `string` | `"00:00-02:30"` | no |
3232
| <a name="input_preferred_maintenance_window"></a> [preferred\_maintenance\_window](#input\_preferred\_maintenance\_window) | The weekly time range during which system maintenance can occur, in (UTC). | `string` | `"Mon:03:00-Mon:04:30"` | no |
3333
| <a name="input_replication_source_identifier"></a> [replication\_source\_identifier](#input\_replication\_source\_identifier) | ARN of the source DB cluster or DB instance if this DB cluster is created as a Read Replica. | `string` | `null` | no |
@@ -55,8 +55,8 @@
5555

5656
## Resources
5757

58-
- resource.aws_rds_cluster.main (modules/rds_cluster/main.tf#1)
59-
- resource.random_password.master_password (modules/rds_cluster/main.tf#107)
60-
- resource.random_string.master_username (modules/rds_cluster/main.tf#101)
61-
- data source.aws_availability_zones.available (modules/rds_cluster/data.tf#1)
58+
- resource.aws_rds_cluster.main (modules/rds_cluster/main.tf#5)
59+
- resource.random_password.master_password (modules/rds_cluster/main.tf#113)
60+
- resource.random_string.master_username (modules/rds_cluster/main.tf#107)
61+
- data source.aws_availability_zones.available (modules/rds_cluster/main.tf#1)
6262
<!-- END_TF_DOCS -->

modules/rds_cluster/data.tf

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
data "aws_availability_zones" "available" {
2-
state = "available"
3-
}

modules/rds_cluster/main.tf

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
data "aws_availability_zones" "available" {
2+
state = "available"
3+
}
4+
15
resource "aws_rds_cluster" "main" {
26
# Cluster identifier
37
cluster_identifier = var.cluster_identifier
@@ -20,8 +24,10 @@ resource "aws_rds_cluster" "main" {
2024
database_name = var.database_name
2125

2226
# Master-Credentials
23-
master_username = random_string.master_username.result
24-
master_password = random_password.master_password.result
27+
master_username = random_string.master_username.result
28+
master_password = random_password.master_password.result
29+
30+
# IAM authentication
2531
iam_database_authentication_enabled = var.iam_database_authentication_enabled
2632

2733
# Backups
@@ -82,6 +88,14 @@ resource "aws_rds_cluster" "main" {
8288
}
8389
}
8490

91+
module "kms" {
92+
source = "geekcell/kms/aws"
93+
version = ">= 1.0.0, < 2.0.0"
94+
95+
alias = "rds/cluster/${var.cluster_identifier}/storage"
96+
tags = var.tags
97+
}
98+
8599
module "autoscaling" {
86100
count = var.additional_reader_capacity >= 1 ? 1 : 0
87101
source = "../rds_cluster_autoscaling"
@@ -90,21 +104,13 @@ module "autoscaling" {
90104
min_capacity = var.additional_reader_capacity
91105
}
92106

93-
module "kms" {
94-
source = "geekcell/kms/aws"
95-
version = ">= 1.0.0, < 2.0.0"
96-
97-
alias = "/rds/cluster/${var.cluster_identifier}/storage"
98-
tags = var.tags
99-
}
100-
101107
resource "random_string" "master_username" {
102108
length = 12
103109
special = false
104110
numeric = false
105111
}
106112

107113
resource "random_password" "master_password" {
108-
length = 24
114+
length = 40
109115
special = false
110116
}

modules/rds_cluster/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ variable "iops" {
135135
}
136136

137137
variable "port" {
138-
default = 3306
138+
default = 6033
139139
description = "The port on which the DB accepts connections."
140140
type = number
141141
}

variables.tf

+1-7
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,8 @@ variable "db_proxy_users" {
6868
}
6969

7070
variable "deletion_protection" {
71-
default = false
72-
description = "If the DB instance should have deletion protection enabled."
73-
type = bool
74-
}
75-
76-
variable "enable_enhanced_backups" {
7771
default = true
78-
description = "Enable enhanced backups."
72+
description = "If the DB instance should have deletion protection enabled."
7973
type = bool
8074
}
8175

0 commit comments

Comments
 (0)