From 04a703f6eda4f11d1755e0cc7c88ba5de4842eed Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 28 Aug 2025 05:33:05 -0700 Subject: [PATCH 1/2] feat: expose additional DNS outputs --- README.md | 3 +++ src/README.md | 4 +++- src/outputs.tf | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f31f69..bc4559a 100644 --- a/README.md +++ b/README.md @@ -423,11 +423,14 @@ components: |------|-------------| | [admin\_username](#output\_admin\_username) | Postgres admin username | | [allowed\_security\_groups](#output\_allowed\_security\_groups) | The resulting list of security group IDs that are allowed to connect to the Aurora Postgres cluster. | +| [cluster\_endpoint](#output\_cluster\_endpoint) | Postgres cluster endpoint | | [cluster\_identifier](#output\_cluster\_identifier) | Postgres cluster identifier | | [config\_map](#output\_config\_map) | Map containing information pertinent to a PostgreSQL client configuration. | | [database\_name](#output\_database\_name) | Postgres database name | +| [instance\_endpoints](#output\_instance\_endpoints) | List of Postgres instance endpoints | | [kms\_key\_arn](#output\_kms\_key\_arn) | KMS key ARN for Aurora Postgres | | [master\_hostname](#output\_master\_hostname) | Postgres master hostname | +| [reader\_endpoint](#output\_reader\_endpoint) | Postgres reader endpoint | | [replicas\_hostname](#output\_replicas\_hostname) | Postgres replicas hostname | | [ssm\_key\_paths](#output\_ssm\_key\_paths) | Names (key paths) of all SSM parameters stored for this cluster | diff --git a/src/README.md b/src/README.md index abbde19..c1ac599 100644 --- a/src/README.md +++ b/src/README.md @@ -371,11 +371,14 @@ components: |------|-------------| | [admin\_username](#output\_admin\_username) | Postgres admin username | | [allowed\_security\_groups](#output\_allowed\_security\_groups) | The resulting list of security group IDs that are allowed to connect to the Aurora Postgres cluster. | +| [cluster\_endpoint](#output\_cluster\_endpoint) | Postgres cluster endpoint | | [cluster\_identifier](#output\_cluster\_identifier) | Postgres cluster identifier | | [config\_map](#output\_config\_map) | Map containing information pertinent to a PostgreSQL client configuration. | | [database\_name](#output\_database\_name) | Postgres database name | +| [instance\_endpoints](#output\_instance\_endpoints) | List of Postgres instance endpoints | | [kms\_key\_arn](#output\_kms\_key\_arn) | KMS key ARN for Aurora Postgres | | [master\_hostname](#output\_master\_hostname) | Postgres master hostname | +| [reader\_endpoint](#output\_reader\_endpoint) | Postgres reader endpoint | | [replicas\_hostname](#output\_replicas\_hostname) | Postgres replicas hostname | | [ssm\_key\_paths](#output\_ssm\_key\_paths) | Names (key paths) of all SSM parameters stored for this cluster | @@ -391,4 +394,3 @@ components: [](https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse-terraform-components/aws-aurora-postgres&utm_content=) - diff --git a/src/outputs.tf b/src/outputs.tf index 3e199f3..d13b5a7 100644 --- a/src/outputs.tf +++ b/src/outputs.tf @@ -19,6 +19,21 @@ output "replicas_hostname" { description = "Postgres replicas hostname" } +output "cluster_endpoint" { + value = module.aurora_postgres_cluster.endpoint + description = "Postgres cluster endpoint" +} + +output "reader_endpoint" { + value = module.aurora_postgres_cluster.reader_endpoint + description = "Postgres reader endpoint" +} + +output "instance_endpoints" { + value = module.aurora_postgres_cluster.instance_endpoints + description = "List of Postgres instance endpoints" +} + output "cluster_identifier" { value = module.aurora_postgres_cluster.cluster_identifier description = "Postgres cluster identifier" From 0bba0d9bbd04646ac67d919cb1e16d352176b56e Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 28 Aug 2025 06:37:45 -0700 Subject: [PATCH 2/2] feat: upgrade aurora module --- README.md | 1 + src/README.md | 1 + src/cluster-regional.tf | 3 ++- src/variables.tf | 10 ++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc4559a..4da717f 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,7 @@ components: | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | | [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Whether to enable Performance Insights | `bool` | `false` | no | | [publicly\_accessible](#input\_publicly\_accessible) | Set true to make this database accessible from the public internet | `bool` | `false` | no | +| [promotion\_tier](#input\_promotion_tier) | Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.

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 | `number` | `0` | no | | [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` | `60` | no | | [reader\_dns\_name\_part](#input\_reader\_dns\_name\_part) | Part of DNS name added to module and cluster name for DNS for cluster reader | `string` | `"reader"` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | diff --git a/src/README.md b/src/README.md index c1ac599..d66c19a 100644 --- a/src/README.md +++ b/src/README.md @@ -348,6 +348,7 @@ components: | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | | [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Whether to enable Performance Insights | `bool` | `false` | no | | [publicly\_accessible](#input\_publicly\_accessible) | Set true to make this database accessible from the public internet | `bool` | `false` | no | +| [promotion\_tier](#input\_promotion_tier) | Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.

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 | `number` | `0` | no | | [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` | `60` | no | | [reader\_dns\_name\_part](#input\_reader\_dns\_name\_part) | Part of DNS name added to module and cluster name for DNS for cluster reader | `string` | `"reader"` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | diff --git a/src/cluster-regional.tf b/src/cluster-regional.tf index 23e5338..a914f1e 100644 --- a/src/cluster-regional.tf +++ b/src/cluster-regional.tf @@ -5,7 +5,7 @@ # https://www.terraform.io/docs/providers/aws/r/rds_cluster.html module "aurora_postgres_cluster" { source = "cloudposse/rds-cluster/aws" - version = "1.18.0" + version = "2.1.1" cluster_type = "regional" engine = var.engine @@ -14,6 +14,7 @@ module "aurora_postgres_cluster" { cluster_family = var.cluster_family instance_type = var.instance_type cluster_size = var.cluster_size + promotion_tier = var.promotion_tier admin_user = local.admin_user admin_password = local.admin_password diff --git a/src/variables.tf b/src/variables.tf index 1bc2277..6992e19 100644 --- a/src/variables.tf +++ b/src/variables.tf @@ -205,6 +205,16 @@ variable "rds_monitoring_interval" { default = 60 } +variable "promotion_tier" { + type = number + default = 0 + description = <<-EOT + Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer. + + 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 + EOT +} + variable "autoscaling_enabled" { type = bool default = false