Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set CA cert authority value for aurora cluster #43

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ You can do this by commenting out the entire module, running a terraform apply,
| <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 |
| <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 |
| <a name="input_azs"></a> [azs](#input\_azs) | Availability zones | `list(string)` | n/a | yes |
| <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 |
| <a name="input_cluster_arn"></a> [cluster\_arn](#input\_cluster\_arn) | ECS cluster to deploy into | `string` | n/a | yes |
| <a name="input_command"></a> [command](#input\_command) | Container startup command (Use null if container\_definitions is set) | `list(string)` | n/a | yes |
| <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 |
Expand Down
1 change: 1 addition & 0 deletions db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ module "database" {
name = var.service_name
vpc_id = var.vpc_id
database_name = var.db_name
ca_cert_identifier = var.ca_cert_identifier
}
2 changes: 2 additions & 0 deletions rds_cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ resource "aws_rds_cluster" "this" {
tags = var.tags
db_cluster_parameter_group_name = "default.aurora-postgresql14"
deletion_protection = true
ca_certificate_identifier = var.ca_cert_identifier
areida marked this conversation as resolved.
Show resolved Hide resolved
}

resource "random_password" "password" {
Expand Down Expand Up @@ -65,6 +66,7 @@ resource "aws_rds_cluster_instance" "this" {
instance_class = var.instance_class
db_subnet_group_name = aws_db_subnet_group.this.name
tags = var.tags
ca_cert_identifier = var.ca_cert_identifier
}

resource "aws_db_subnet_group" "this" {
Expand Down
6 changes: 6 additions & 0 deletions rds_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ variable "instance_class" {
type = string
description = "Instance class"
}

variable "ca_cert_identifier" {
type = string
description = "Identifier of the CA certificate for the DB instance"
default = "rds-ca-rsa2048-g1"
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,9 @@ variable "assign_public_ip" {
description = "Whether or not to assign a public IP to the task"
default = false
}

variable "ca_cert_identifier" {
type = string
description = "Identifier of the CA certificate for the DB instance"
default = null
}