Skip to content

Commit badcb52

Browse files
jfcozRoseSecurity
andauthored
Reader independent scaling (#256)
* add reader_independent_scaling input allow to scale reader independently from primary using promotion_tier >= 2 https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling * use promotion_tier * Update variables.tf Co-authored-by: RoseSecurity <72598486+RoseSecurity@users.noreply.github.com> --------- Co-authored-by: RoseSecurity <72598486+RoseSecurity@users.noreply.github.com>
1 parent fb2d468 commit badcb52

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ Available targets:
446446
| <a name="input_performance_insights_enabled"></a> [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Whether to enable Performance Insights | `bool` | `false` | no |
447447
| <a name="input_performance_insights_kms_key_id"></a> [performance\_insights\_kms\_key\_id](#input\_performance\_insights\_kms\_key\_id) | The ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true | `string` | `""` | no |
448448
| <a name="input_performance_insights_retention_period"></a> [performance\_insights\_retention\_period](#input\_performance\_insights\_retention\_period) | Amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years) | `number` | `null` | no |
449+
| <a name="input_promotion_tier"></a> [reader\_independent\_scaling](#input\_reader\_independent\_scaling) | Failover priority. 2 or more allow independent scaling | `number` | `0` | no |
449450
| <a name="input_publicly_accessible"></a> [publicly\_accessible](#input\_publicly\_accessible) | Set to true if you want your cluster to be publicly accessible (such as via QuickSight) | `bool` | `false` | no |
450451
| <a name="input_rds_cluster_parameter_group_name"></a> [rds\_cluster\_parameter\_group\_name](#input\_rds\_cluster\_parameter\_group\_name) | The name to give to the created `aws_rds_cluster_parameter_group` resource.<br/>If omitted, the module will generate a name. | `string` | `""` | no |
451452
| <a name="input_rds_monitoring_interval"></a> [rds\_monitoring\_interval](#input\_rds\_monitoring\_interval) | The interval, in seconds, between points when enhanced monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60 | `number` | `0` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
| <a name="input_performance_insights_enabled"></a> [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Whether to enable Performance Insights | `bool` | `false` | no |
133133
| <a name="input_performance_insights_kms_key_id"></a> [performance\_insights\_kms\_key\_id](#input\_performance\_insights\_kms\_key\_id) | The ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true | `string` | `""` | no |
134134
| <a name="input_performance_insights_retention_period"></a> [performance\_insights\_retention\_period](#input\_performance\_insights\_retention\_period) | Amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years) | `number` | `null` | no |
135+
| <a name="input_promotion_tier"></a> [reader\_independent\_scaling](#input\_reader\_independent\_scaling) | Failover priority. 2 or more allow independent scaling | `number` | `0` | no |
135136
| <a name="input_publicly_accessible"></a> [publicly\_accessible](#input\_publicly\_accessible) | Set to true if you want your cluster to be publicly accessible (such as via QuickSight) | `bool` | `false` | no |
136137
| <a name="input_rds_cluster_parameter_group_name"></a> [rds\_cluster\_parameter\_group\_name](#input\_rds\_cluster\_parameter\_group\_name) | The name to give to the created `aws_rds_cluster_parameter_group` resource.<br>If omitted, the module will generate a name. | `string` | `""` | no |
137138
| <a name="input_rds_monitoring_interval"></a> [rds\_monitoring\_interval](#input\_rds\_monitoring\_interval) | The interval, in seconds, between points when enhanced monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60 | `number` | `0` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ resource "aws_rds_cluster_instance" "default" {
368368
preferred_maintenance_window = var.maintenance_window
369369
copy_tags_to_snapshot = var.copy_tags_to_snapshot
370370
ca_cert_identifier = var.ca_cert_identifier
371+
promotion_tier = var.promotion_tier
371372

372373
dynamic "timeouts" {
373374
for_each = var.timeouts_configuration

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,15 @@ variable "performance_insights_retention_period" {
378378
default = null
379379
}
380380

381+
variable "promotion_tier" {
382+
type = number
383+
default = 0
384+
description = <<-EOT
385+
Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.
386+
387+
Readers in promotion tiers 0 and 1 scale at the same time as the writer. Readers in promotion tiers 2–15 scale independently from the writer. For more information, see: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling
388+
EOT
389+
}
381390
variable "autoscaling_enabled" {
382391
type = bool
383392
default = false

0 commit comments

Comments
 (0)