Skip to content

Commit

Permalink
Feature/aurora public (#17)
Browse files Browse the repository at this point in the history
* Added the option to make the aurora cluster public

* terraform fmt

* terraform-docs: automated update action

Co-authored-by: jrpradojr <[email protected]>
  • Loading branch information
jrpradojr and jrpradojr authored Apr 6, 2022
1 parent 7f4c288 commit 827c37d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
| database\_name | Database Name | `string` | `""` | no |
| db\_parameters | A list of DB parameters (map) to apply | `list(map(string))` | `[]` | no |
| db\_subnet\_group\_id | RDS Subnet Group Name | `string` | n/a | yes |
| db\_subnet\_group\_subnet\_ids | List of Subnet IDs for the RDS Subnet Group | `list(any)` | `[]` | no |
| db\_subnet\_group\_subnet\_ids | List of Subnet IDs for the RDS Subnet Group | `list` | `[]` | no |
| db\_type | Valid values are: rds, aurora or serverless | `string` | n/a | yes |
| deletion\_protection | The database can't be deleted when this value is set to true. | `bool` | `false` | no |
| enabled\_cloudwatch\_logs\_exports | (Optional) Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. Valid values (depending on engine) | `any` | `null` | no |
Expand Down
1 change: 0 additions & 1 deletion _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ variable "db_subnet_group_id" {
}

variable "db_subnet_group_subnet_ids" {
type = list(any)
description = "List of Subnet IDs for the RDS Subnet Group"
default = []
}
Expand Down
4 changes: 2 additions & 2 deletions aurora.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ resource "aws_rds_cluster" "aurora_cluster" {
iam_database_authentication_enabled = var.iam_database_authentication_enabled
vpc_security_group_ids = [aws_security_group.rds_db.id]
db_cluster_parameter_group_name = var.create_cluster_parameter_group == true ? aws_rds_cluster_parameter_group.custom_cluster_pg[count.index].name : ""
apply_immediately = var.apply_immediately
}

resource "aws_rds_cluster_instance" "cluster_instances" {
Expand All @@ -24,7 +25,7 @@ resource "aws_rds_cluster_instance" "cluster_instances" {
engine = aws_rds_cluster.aurora_cluster[0].engine
engine_version = aws_rds_cluster.aurora_cluster[0].engine_version
db_parameter_group_name = var.create_db_parameter_group == true ? aws_db_parameter_group.aurora_custom_db_pg[count.index].name : ""

publicly_accessible = var.publicly_accessible
}

resource "aws_rds_cluster_parameter_group" "custom_cluster_pg" {
Expand All @@ -43,7 +44,6 @@ resource "aws_rds_cluster_parameter_group" "custom_cluster_pg" {
apply_method = lookup(parameter.value, "apply_method", null)
}
}

}

resource "aws_db_parameter_group" "aurora_custom_db_pg" {
Expand Down

0 comments on commit 827c37d

Please sign in to comment.