Skip to content

Commit 289c768

Browse files
authored
Merge pull request #43 from synapsestudios/areida/ca-cert-authority-update
Set CA cert authority value for aurora cluster
2 parents da7f91a + d940978 commit 289c768

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ You can do this by commenting out the entire module, running a terraform apply,
5757
| <a name="input_alb_security_group_id"></a> [alb\_security\_group\_id](#input\_alb\_security\_group\_id) | Security Group ID for the ALB | `string` | n/a | yes |
5858
| <a name="input_assign_public_ip"></a> [assign\_public\_ip](#input\_assign\_public\_ip) | Whether or not to assign a public IP to the task | `bool` | `false` | no |
5959
| <a name="input_azs"></a> [azs](#input\_azs) | Availability zones | `list(string)` | n/a | yes |
60+
| <a name="input_ca_cert_identifier"></a> [ca\_cert\_identifier](#input\_ca\_cert\_identifier) | Identifier of the CA certificate for the DB instance | `string` | `null` | no |
6061
| <a name="input_cluster_arn"></a> [cluster\_arn](#input\_cluster\_arn) | ECS cluster to deploy into | `string` | n/a | yes |
6162
| <a name="input_command"></a> [command](#input\_command) | Container startup command (Use null if container\_definitions is set) | `list(string)` | n/a | yes |
6263
| <a name="input_container_definitions"></a> [container\_definitions](#input\_container\_definitions) | A list of valid container definitions provided as a single valid JSON document. By default, this module will generate a container definition for you. If you need to provide your own or have multiple, you can do so here. | `string` | `null` | no |
@@ -73,6 +74,7 @@ You can do this by commenting out the entire module, running a terraform apply,
7374
| <a name="input_hostname"></a> [hostname](#input\_hostname) | Hostname to use for listener rule | `string` | n/a | yes |
7475
| <a name="input_listener_arn"></a> [listener\_arn](#input\_listener\_arn) | ALB listener ARN to add listener rule to | `string` | n/a | yes |
7576
| <a name="input_load_balancer_container_name"></a> [load\_balancer\_container\_name](#input\_load\_balancer\_container\_name) | Container name to use for load balancer target group forwarder | `string` | `null` | no |
77+
| <a name="input_rds_cluster_engine_version"></a> [rds\_cluster\_engine\_version](#input\_rds\_cluster\_engine\_version) | Database engine version | `string` | `"14.6"` | no |
7678
| <a name="input_service_name"></a> [service\_name](#input\_service\_name) | Service directory in the application git repo | `string` | n/a | yes |
7779
| <a name="input_subnets"></a> [subnets](#input\_subnets) | List of subnet names the service will reside on. | `list(string)` | n/a | yes |
7880
| <a name="input_task_cpu"></a> [task\_cpu](#input\_task\_cpu) | Task CPU | `number` | `1024` | no |

db.tf

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ module "database" {
88
name = var.service_name
99
vpc_id = var.vpc_id
1010
database_name = var.db_name
11+
ca_cert_identifier = var.ca_cert_identifier
12+
engine_version = var.rds_cluster_engine_version
1113
}

rds_cluster/main.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "random_id" "final_snapshot_suffix" {
66
resource "aws_rds_cluster" "this" {
77
cluster_identifier_prefix = var.name
88
engine = "aurora-postgresql"
9-
engine_version = "14.6"
9+
engine_version = var.engine_version
1010
database_name = var.database_name
1111
skip_final_snapshot = false
1212
final_snapshot_identifier = "${var.name}-final-${random_id.final_snapshot_suffix.hex}"
@@ -58,13 +58,14 @@ resource "aws_secretsmanager_secret_version" "connection_string" {
5858
resource "aws_rds_cluster_instance" "this" {
5959
count = var.instance_count
6060
engine = "aurora-postgresql"
61-
engine_version = "14.6"
61+
engine_version = var.engine_version
6262
identifier_prefix = "${var.name}-${count.index + 1}"
6363
performance_insights_enabled = true
6464
cluster_identifier = aws_rds_cluster.this.id
6565
instance_class = var.instance_class
6666
db_subnet_group_name = aws_db_subnet_group.this.name
6767
tags = var.tags
68+
ca_cert_identifier = var.ca_cert_identifier
6869
}
6970

7071
resource "aws_db_subnet_group" "this" {

rds_cluster/variables.tf

+12
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ variable "instance_class" {
4444
type = string
4545
description = "Instance class"
4646
}
47+
48+
variable "ca_cert_identifier" {
49+
type = string
50+
description = "Identifier of the CA certificate for the DB instance"
51+
default = null
52+
}
53+
54+
variable "engine_version" {
55+
type = string
56+
description = "Database engine version"
57+
default = "14.6"
58+
}

variables.tf

+12
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,15 @@ variable "assign_public_ip" {
140140
description = "Whether or not to assign a public IP to the task"
141141
default = false
142142
}
143+
144+
variable "ca_cert_identifier" {
145+
type = string
146+
description = "Identifier of the CA certificate for the DB instance"
147+
default = null
148+
}
149+
150+
variable "rds_cluster_engine_version" {
151+
type = string
152+
description = "Database engine version"
153+
default = "14.6"
154+
}

0 commit comments

Comments
 (0)