Skip to content

Commit

Permalink
Adding support for passig cloudwatch exports
Browse files Browse the repository at this point in the history
  • Loading branch information
dunefro committed Sep 25, 2024
1 parent 44cad45 commit cd7cb08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ locals {

truefoundry_db_port = 5432
truefoundry_db_master_username = "root"
truefoundry_db_database_name = "ctl"

tags = merge(
{
Expand Down
4 changes: 2 additions & 2 deletions rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource "aws_db_instance" "truefoundry_db" {
password = var.manage_master_user_password ? null : random_password.truefoundry_db_password[0].result
manage_master_user_password = var.manage_master_user_password ? true : null
master_user_secret_kms_key_id = var.manage_master_user_password ? aws_kms_key.truefoundry_db_master_user_secret_kms_key[0].arn : null
final_snapshot_identifier = var.truefoundry_db_skip_final_snapshot ? null : "${local.truefoundry_db_database_name}-${formatdate("DD-MM-YYYY-hh-mm-ss", timestamp())}"
final_snapshot_identifier = var.truefoundry_db_skip_final_snapshot ? null : "${var.truefoundry_db_database_name}-${formatdate("DD-MM-YYYY-hh-mm-ss", timestamp())}"
backup_retention_period = var.truefoundry_db_backup_retention_period
instance_class = var.truefoundry_db_instance_class
performance_insights_enabled = var.truefoundry_db_enable_insights
Expand All @@ -83,7 +83,7 @@ resource "aws_db_instance" "truefoundry_db" {
iam_database_authentication_enabled = var.iam_database_authentication_enabled
apply_immediately = true
storage_encrypted = var.truefoundry_db_storage_encrypted
enabled_cloudwatch_logs_exports = ["postgresql", "upgrade"]
enabled_cloudwatch_logs_exports = var.truefoundry_cloudwatch_log_exports
storage_type = var.truefoundry_db_storage_type
iops = var.truefoundry_db_storage_iops == 0 ? null : var.truefoundry_db_storage_iops
}
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ variable "truefoundry_db_enable_insights" {
default = false
}

variable "truefoundry_cloudwatch_log_exports" {
description = "Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported"
type = list(string)
default = ["postgresql", "upgrade"]
}
variable "truefoundry_db_multiple_az" {
description = "Enable Multi-az (standby) instances for RDS instances"
type = bool
Expand Down

0 comments on commit cd7cb08

Please sign in to comment.