Skip to content

Commit

Permalink
fix for CKV2_AWS_27
Browse files Browse the repository at this point in the history
  • Loading branch information
kunduso committed Sep 11, 2024
1 parent b77a7cc commit ce4fb11
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ resource "aws_db_subnet_group" "rds" {
subnet_ids = [for subnet in aws_subnet.db : subnet.id]
}

#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group
resource "aws_db_parameter_group" "postgres" {
name = var.name
family = "postgres16"
parameter {
name = "log_statement"
value = "all"
}
parameter {
name = "log_min_duration_statement"
value = "1"
}
parameter {
name = "rds.forcs_ssl"
value = "1"
}
parameter {
name = "ssl"
value = "1"
}
}
#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance
resource "aws_db_instance" "postgresql" {

Check failure on line 29 in rds.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_161: "Ensure RDS database has IAM authentication enabled"

Check failure on line 29 in rds.tf

View workflow job for this annotation

GitHub Actions / scan

CKV_AWS_118: "Ensure that enhanced monitoring is enabled for Amazon RDS instances"

Check failure on line 29 in rds.tf

View workflow job for this annotation

GitHub Actions / scan

CKV2_AWS_69: "Ensure AWS RDS database instance configured with encryption in transit"
allocated_storage = 100
Expand All @@ -16,7 +37,7 @@ resource "aws_db_instance" "postgresql" {
skip_final_snapshot = true # Change to false if you want a final snapshot
db_subnet_group_name = aws_db_subnet_group.rds.id
storage_encrypted = true
parameter_group_name = "default.postgres16"
parameter_group_name = aws_db_parameter_group.postgres.name #"default.postgres16"
multi_az = true
vpc_security_group_ids = [aws_security_group.rds.id]
auto_minor_version_upgrade = true
Expand Down

0 comments on commit ce4fb11

Please sign in to comment.