diff --git a/README.md b/README.md index 9a5daae..9790b37 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ module "rds-pg" { environment = "prod" storage_type = "gp3" replica_enable = false + replica_count = 1 kms_key_arn = "arn:aws:kms:region:2222222222:key/f8c8d802-a34b" + storage_type = "gp3" engine_version = "15.2" instance_class = "db.m5.large" master_username = "pguser" @@ -53,7 +55,7 @@ module "rds-pg" { slack_webhook_url = "https://hooks/xxxxxxxx" } ``` -Refer [examples](https://github.com/squareops/terraform-aws-rds-postgresql/tree/main/examples/complete) for more details. +Refer [examples](https://github.com/squareops/terraform-aws-rds-postgresql/tree/main/examples) for more details. ## IAM Permissions The required IAM permissions to create resources from this module can be found [here](https://github.com/squareops/terraform-aws-rds-postgresql/blob/main/IAM.md) diff --git a/examples/complete-psql-replica/README.md b/examples/complete-psql-replica/README.md index 2eef11d..fb5dc83 100644 --- a/examples/complete-psql-replica/README.md +++ b/examples/complete-psql-replica/README.md @@ -20,7 +20,7 @@ This example will be very useful for users who are new to a module and want to q | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.13.1 | +| [aws](#provider\_aws) | >= 3.43.0 | ## Modules diff --git a/examples/complete-psql-replica/main.tf b/examples/complete-psql-replica/main.tf index d5562ec..fabae6c 100644 --- a/examples/complete-psql-replica/main.tf +++ b/examples/complete-psql-replica/main.tf @@ -1,20 +1,21 @@ locals { region = "us-east-2" - environment = "prod" name = "postgresql" + family = "postgres15" + vpc_cidr = "10.20.0.0/16" + environment = "prod" + storage_type = "gp3" + engine_version = "15.2" + instance_class = "db.m5d.large" + replica_enable = true + replica_count = 1 + current_identity = data.aws_caller_identity.current.arn + allowed_security_groups = ["sg-0a680afd35"] additional_tags = { Owner = "Organization_Name" Expires = "Never" Department = "Engineering" } - vpc_cidr = "10.20.0.0/16" - family = "postgres15" - engine_version = "15.2" - current_identity = data.aws_caller_identity.current.arn - allowed_security_groups = ["sg-0a680afd35"] - instance_class = "db.m5d.large" - replica_enable = true - replica_count = 1 } data "aws_caller_identity" "current" {} @@ -25,10 +26,10 @@ module "kms" { deletion_window_in_days = 7 description = "Complete key example showing various configurations available" - enable_key_rotation = false + enable_key_rotation = true is_enabled = true key_usage = "ENCRYPT_DECRYPT" - multi_region = false + multi_region = true # Policy enable_default_policy = true @@ -82,14 +83,15 @@ module "rds-pg" { source = "squareops/rds-postgresql/aws" name = local.name db_name = "postgres" - multi_az = "true" family = local.family - replica_enable = local.replica_enable - replica_count = local.replica_count + multi_az = "true" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.database_subnets ## db subnets environment = local.environment + replica_enable = local.replica_enable + replica_count = local.replica_count kms_key_arn = module.kms.key_arn + storage_type = local.storage_type engine_version = local.engine_version instance_class = local.instance_class master_username = "pguser" @@ -101,11 +103,11 @@ module "rds-pg" { maintenance_window = "Mon:00:00-Mon:03:00" final_snapshot_identifier_prefix = "final" major_engine_version = local.engine_version - deletion_protection = false + deletion_protection = true cloudwatch_metric_alarms_enabled = true alarm_cpu_threshold_percent = 70 disk_free_storage_space = "10000000" # in bytes - slack_username = "" - slack_channel = "" - slack_webhook_url = "" + slack_username = "Admin" + slack_channel = "postgresql-notification" + slack_webhook_url = "https://hooks/xxxxxxxx" } diff --git a/examples/complete/README.md b/examples/complete/README.md index 22cc3d0..5381319 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -20,7 +20,7 @@ This example will be very useful for users who are new to a module and want to q | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.13.1 | +| [aws](#provider\_aws) | >= 3.43.0 | ## Modules diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 76c334b..f667383 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -2,18 +2,18 @@ locals { region = "us-east-2" name = "postgresql" family = "postgres15" + vpc_cidr = "10.20.0.0/16" environment = "prod" engine_version = "15.2" instance_class = "db.m5d.large" - vpc_cidr = "10.20.0.0/16" + storage_type = "gp3" + current_identity = data.aws_caller_identity.current.arn allowed_security_groups = ["sg-0a680afd35"] additional_tags = { Owner = "Organization_Name" Expires = "Never" Department = "Engineering" } - storage_type = "gp3" - current_identity = data.aws_caller_identity.current.arn } data "aws_caller_identity" "current" {} @@ -24,10 +24,10 @@ module "kms" { deletion_window_in_days = 7 description = "Complete key example showing various configurations available" - enable_key_rotation = false + enable_key_rotation = true is_enabled = true key_usage = "ENCRYPT_DECRYPT" - multi_region = false + multi_region = true # Policy enable_default_policy = true @@ -77,7 +77,7 @@ module "kms" { # Aliases aliases = ["${local.name}"] - tags = local.additional_aws_tags + tags = local.additional_tags } @@ -121,7 +121,7 @@ module "rds-pg" { cloudwatch_metric_alarms_enabled = true alarm_cpu_threshold_percent = 70 disk_free_storage_space = "10000000" # in bytes - slack_username = "" - slack_channel = "" - slack_webhook_url = "" + slack_username = "Admin" + slack_channel = "postgresql-notification" + slack_webhook_url = "https://hooks/xxxxxxxx" } diff --git a/main.tf b/main.tf index 6d1aa70..c2907e9 100644 --- a/main.tf +++ b/main.tf @@ -21,7 +21,7 @@ module "db" { subnet_ids = var.subnet_ids kms_key_id = var.kms_key_arn instance_class = var.instance_class - storage_type = var.storage_type + storage_type = var.storage_type engine_version = var.engine_version allocated_storage = var.allocated_storage storage_encrypted = var.storage_encrypted