Skip to content

Commit aac49df

Browse files
committed
chore: updates from validating examples
1 parent ffd7a10 commit aac49df

File tree

7 files changed

+39
-36
lines changed

7 files changed

+39
-36
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ No modules.
260260

261261
| Name | Description | Type | Default | Required |
262262
|------|-------------|------|---------|:--------:|
263-
| <a name="input_allow_major_version_upgrade"></a> [allow\_major\_version\_upgrade](#input\_allow\_major\_version\_upgrade) | Enable to allow major engine version upgrades when changing engine versions. Defaults to `false` | `bool` | `null` | no |
263+
| <a name="input_allow_major_version_upgrade"></a> [allow\_major\_version\_upgrade](#input\_allow\_major\_version\_upgrade) | Enable to allow major engine version upgrades when changing engine versions. Defaults to `false` | `bool` | `false` | no |
264264
| <a name="input_allowed_cidr_blocks"></a> [allowed\_cidr\_blocks](#input\_allowed\_cidr\_blocks) | A list of CIDR blocks which are allowed to access the database | `list(string)` | `[]` | no |
265265
| <a name="input_allowed_security_groups"></a> [allowed\_security\_groups](#input\_allowed\_security\_groups) | A list of Security Group ID's to allow access to | `list(string)` | `[]` | no |
266266
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is `false` | `bool` | `null` | no |
@@ -284,7 +284,7 @@ No modules.
284284
| <a name="input_create_random_password"></a> [create\_random\_password](#input\_create\_random\_password) | Determines whether to create random password for RDS primary cluster | `bool` | `true` | no |
285285
| <a name="input_create_security_group"></a> [create\_security\_group](#input\_create\_security\_group) | Determines whether to create security group for RDS cluster | `bool` | `true` | no |
286286
| <a name="input_database_name"></a> [database\_name](#input\_database\_name) | Name for an automatically created database on cluster creation | `string` | `null` | no |
287-
| <a name="input_db_cluster_db_instance_parameter_group_name"></a> [db\_cluster\_db\_instance\_parameter\_group\_name](#input\_db\_cluster\_db\_instance\_parameter\_group\_name) | Instance parameter group to associate with all instances of the DB cluster. The `db_cluster_`db\_instance\_parameter\_group\_name` is only valid in combination with `allow\_major\_version\_upgrade | `string` | `null` | no |
287+
| <a name="input_db_cluster_db_instance_parameter_group_name"></a> [db\_cluster\_db\_instance\_parameter\_group\_name](#input\_db\_cluster\_db\_instance\_parameter\_group\_name) | Instance parameter group to associate with all instances of the DB cluster. The `db_cluster_db_instance_parameter_group_name` is only valid in combination with `allow_major_version_upgrade` | `string` | `null` | no |
288288
| <a name="input_db_cluster_parameter_group_name"></a> [db\_cluster\_parameter\_group\_name](#input\_db\_cluster\_parameter\_group\_name) | A cluster parameter group to associate with the cluster | `string` | `null` | no |
289289
| <a name="input_db_parameter_group_name"></a> [db\_parameter\_group\_name](#input\_db\_parameter\_group\_name) | The name of the DB parameter group to associate with instances | `string` | `null` | no |
290290
| <a name="input_db_subnet_group_name"></a> [db\_subnet\_group\_name](#input\_db\_subnet\_group\_name) | The name of the subnet group name (existing or created) | `string` | `""` | no |
@@ -316,7 +316,7 @@ No modules.
316316
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | The ARN for the KMS encryption key. When specifying `kms_key_id`, `storage_encrypted` needs to be set to `true` | `string` | `null` | no |
317317
| <a name="input_master_password"></a> [master\_password](#input\_master\_password) | Password for the master DB user. Note - when specifying a value here, 'create\_random\_password' should be set to `false` | `string` | `null` | no |
318318
| <a name="input_master_username"></a> [master\_username](#input\_master\_username) | Username for the master DB user | `string` | `"root"` | no |
319-
| <a name="input_monitoring_interval"></a> [monitoring\_interval](#input\_monitoring\_interval) | The interval, in seconds, between points when Enhanced Monitoring metrics are collected for instances. Set to `0` to disble. Default is `0` | `number` | `null` | no |
319+
| <a name="input_monitoring_interval"></a> [monitoring\_interval](#input\_monitoring\_interval) | The interval, in seconds, between points when Enhanced Monitoring metrics are collected for instances. Set to `0` to disble. Default is `0` | `number` | `0` | no |
320320
| <a name="input_monitoring_role_arn"></a> [monitoring\_role\_arn](#input\_monitoring\_role\_arn) | IAM role used by RDS to send enhanced monitoring metrics to CloudWatch | `string` | `""` | no |
321321
| <a name="input_name"></a> [name](#input\_name) | Name used across resources created | `string` | `""` | no |
322322
| <a name="input_performance_insights_enabled"></a> [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Specifies whether Performance Insights is enabled or not | `bool` | `null` | no |

examples/global_cluster/main.tf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ module "aurora_primary" {
130130
engine_version = aws_rds_global_cluster.this.engine_version
131131
global_cluster_identifier = aws_rds_global_cluster.this.id
132132
instance_class = "db.r6g.large"
133+
instances = { for i in range(2) : i => {} }
133134
kms_key_id = aws_kms_key.primary.arn
134135

135-
vpc_id = module.primary_vpc.vpc_id
136-
db_subnet_group_name = module.primary_vpc.database_subnet_group_name
137-
create_security_group = true
138-
allowed_cidr_blocks = module.primary_vpc.private_subnets_cidr_blocks
136+
vpc_id = module.primary_vpc.vpc_id
137+
db_subnet_group_name = module.primary_vpc.database_subnet_group_name
138+
create_db_subnet_group = false
139+
create_security_group = true
140+
allowed_cidr_blocks = module.primary_vpc.private_subnets_cidr_blocks
139141

140142
skip_final_snapshot = true
141143

@@ -155,12 +157,14 @@ module "aurora_secondary" {
155157
global_cluster_identifier = aws_rds_global_cluster.this.id
156158
source_region = local.primary.region
157159
instance_class = "db.r6g.large"
160+
instances = { for i in range(2) : i => {} }
158161
kms_key_id = aws_kms_key.secondary.arn
159162

160-
vpc_id = module.secondary_vpc.vpc_id
161-
db_subnet_group_name = module.secondary_vpc.database_subnet_group_name
162-
create_security_group = true
163-
allowed_cidr_blocks = module.secondary_vpc.private_subnets_cidr_blocks
163+
vpc_id = module.secondary_vpc.vpc_id
164+
db_subnet_group_name = module.secondary_vpc.database_subnet_group_name
165+
create_db_subnet_group = false
166+
create_security_group = true
167+
allowed_cidr_blocks = module.secondary_vpc.private_subnets_cidr_blocks
164168

165169
skip_final_snapshot = true
166170

examples/mysql/main.tf

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module "vpc" {
2626
name = local.name
2727
cidr = "10.99.0.0/18"
2828

29+
enable_dns_support = true
30+
enable_dns_hostnames = true
31+
2932
azs = ["${local.region}a", "${local.region}b", "${local.region}c"]
3033
public_subnets = ["10.99.0.0/24", "10.99.1.0/24", "10.99.2.0/24"]
3134
private_subnets = ["10.99.3.0/24", "10.99.4.0/24", "10.99.5.0/24"]
@@ -44,26 +47,27 @@ module "aurora" {
4447
name = local.name
4548
engine = "aurora-mysql"
4649
engine_version = "5.7.12"
47-
instance_class = "db.r5.large"
4850
instances = {
4951
1 = {
50-
instance_class = "db.r6g.large"
52+
instance_class = "db.r5.large"
5153
publicly_accessible = true
5254
}
5355
2 = {
54-
instance_class = "db.t3.large"
56+
identifier = "mysql-static-1"
57+
instance_class = "db.r5.2xlarge"
5558
}
5659
3 = {
57-
instance_name = "reporting"
58-
instance_class = "db.r5.large"
59-
instance_promotion_tier = 15
60+
identifier = "mysql-excluded-1"
61+
instance_class = "db.r5.xlarge"
62+
promotion_tier = 15
6063
}
6164
}
6265

63-
vpc_id = module.vpc.vpc_id
64-
db_subnet_group_name = module.vpc.database_subnet_group_name
65-
create_security_group = true
66-
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
66+
vpc_id = module.vpc.vpc_id
67+
db_subnet_group_name = module.vpc.database_subnet_group_name
68+
create_db_subnet_group = false
69+
create_security_group = true
70+
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
6771

6872
iam_database_authentication_enabled = true
6973
master_password = random_password.master.result

examples/postgresql/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ module "aurora" {
4747
name = local.name
4848
engine = "aurora-postgresql"
4949
engine_version = "11.12"
50-
instance_class = "db.r5.large"
51-
# instances = { for i in range(3) : i => {} }
5250
instances = {
5351
1 = {
5452
instance_class = "db.r5.2xlarge"

examples/s3_import/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ module "aurora" {
119119
instance_class = "db.r5.large"
120120
instances = { 1 = {} }
121121

122-
vpc_id = module.vpc.vpc_id
123-
db_subnet_group_name = module.vpc.database_subnet_group_name
124-
create_security_group = true
125-
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
122+
vpc_id = module.vpc.vpc_id
123+
db_subnet_group_name = module.vpc.database_subnet_group_name
124+
create_db_subnet_group = false
125+
create_security_group = true
126+
allowed_cidr_blocks = module.vpc.private_subnets_cidr_blocks
126127

127128
iam_database_authentication_enabled = true
128129

main.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ resource "aws_db_subnet_group" "this" {
4141
description = "For Aurora cluster ${var.name}"
4242
subnet_ids = var.subnets
4343

44-
tags = merge(var.tags, {
45-
Name = local.internal_db_subnet_group_name
46-
})
44+
tags = var.tags
4745
}
4846

4947
resource "aws_rds_cluster" "this" {
@@ -232,9 +230,7 @@ resource "aws_iam_role" "rds_enhanced_monitoring" {
232230
force_detach_policies = var.iam_role_force_detach_policies
233231
max_session_duration = var.iam_role_max_session_duration
234232

235-
tags = merge(var.tags, {
236-
Name = var.iam_role_name
237-
})
233+
tags = var.tags
238234
}
239235

240236
resource "aws_iam_role_policy_attachment" "rds_enhanced_monitoring" {

variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ variable "engine_version" {
8787
variable "allow_major_version_upgrade" {
8888
description = "Enable to allow major engine version upgrades when changing engine versions. Defaults to `false`"
8989
type = bool
90-
default = null
90+
default = false
9191
}
9292

9393
variable "enable_http_endpoint" {
@@ -205,7 +205,7 @@ variable "db_cluster_parameter_group_name" {
205205
}
206206

207207
variable "db_cluster_db_instance_parameter_group_name" {
208-
description = "Instance parameter group to associate with all instances of the DB cluster. The `db_cluster_`db_instance_parameter_group_name` is only valid in combination with `allow_major_version_upgrade`"
208+
description = "Instance parameter group to associate with all instances of the DB cluster. The `db_cluster_db_instance_parameter_group_name` is only valid in combination with `allow_major_version_upgrade`"
209209
type = string
210210
default = null
211211
}
@@ -298,7 +298,7 @@ variable "db_parameter_group_name" {
298298
variable "monitoring_interval" {
299299
description = "The interval, in seconds, between points when Enhanced Monitoring metrics are collected for instances. Set to `0` to disble. Default is `0`"
300300
type = number
301-
default = null
301+
default = 0
302302
}
303303

304304
variable "auto_minor_version_upgrade" {

0 commit comments

Comments
 (0)