Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/complete-psql-replica/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This example will be very useful for users who are new to a module and want to q

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.13.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.43.0 |

## Modules

Expand Down
38 changes: 20 additions & 18 deletions examples/complete-psql-replica/main.tf
Original file line number Diff line number Diff line change
@@ -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" {}
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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"
}
2 changes: 1 addition & 1 deletion examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This example will be very useful for users who are new to a module and want to q

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.13.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.43.0 |

## Modules

Expand Down
18 changes: 9 additions & 9 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {}
Expand All @@ -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
Expand Down Expand Up @@ -77,7 +77,7 @@ module "kms" {
# Aliases
aliases = ["${local.name}"]

tags = local.additional_aws_tags
tags = local.additional_tags
}


Expand Down Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down