Skip to content

Commit

Permalink
Update readme to describe input variables, release number
Browse files Browse the repository at this point in the history
  • Loading branch information
poornima-krishnasamy committed Jun 17, 2020
1 parent 528dd56 commit 1cce090
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ See [this example](example/rds.tf)
| db_engine | Database engine used | string | `postgres` | no |
| db_engine_version | The engine version to use | string | `10.4` | no |
| db_instance_class | The instance type of the RDS instance | string | `db.t2.small` | no |
| db_backup_retention_period | The days to retain backups. Must be 1 or greater to be a source for a Read Replica | string | `7` | yes
| db_backup_retention_period | The days to retain backups. Must be 1 or greater to be a source for a Read Replica. Must be 0 for read replica db | string | `7` | yes
| db_iops | The amount of provisioned IOPS. Setting this implies a storage_type of io1 | string | `0` | ** Required if 'db_storage_type' is set to io1 ** |
| db_name | The name of the database to be created on the instance (if empty, it will be the generated random identifier) | string | | no |
| rds_name | Name of the RDS | string | if not present a name will be generated | no |
| force_ssl | Enforce SSL connections | boolean | `true` | no |
| performance_insights_enabled | Enable performance insights in RDS | boolean | `false` | no |
| snapshot_identifier | Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console. | string | | no |
| providers | provider (and region) creating the resources | arrays of string | default provider | no |
| rds_family | rds configuration version | string | `postgres10` | no |
| apply_method | Indicates when to apply parameter updates | string | `immediate` | no |
| ca_cert_identifier | Specifies the identifier of the CA certificate for the DB instance | string | `rds-ca-2019` | no |
| db_parameter | Parameter block with name, value and apply_method | list | [ { name = "rds.force_ssl", value = "1", apply_method = "immediate" }] | yes |
| replicate_source_db | Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate. | string | <source DB db_identifier> | no
| skip_final_snapshot | If false(default) all DB are taken a final snapshot unless the db instance is created from snapshot itself or a read replica." | string | `false` | no


### Tags
Expand Down
13 changes: 12 additions & 1 deletion example/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable "cluster_state_bucket" {
# Make sure you restart your pods which use this RDS secret to avoid any down time.

module "example_team_rds" {
source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.4"
source = "github.com/ministryofjustice/cloud-platform-terraform-rds-instance?ref=5.5"
cluster_name = var.cluster_name
cluster_state_bucket = var.cluster_state_bucket
team_name = "example-repo"
Expand Down Expand Up @@ -55,6 +55,17 @@ module "example_team_rds" {
# }
# ]

# Set below values if you want to create read replica db instance

# Set the database_name of the source db
# db_name = module.example_team_rds.database_name

# If specifies, this resource is a Replicate database. Set the db_identifier of the source db
# replicate_source_db = module.example_team_rds.db_identifier

# Set to true for replica database. No backups or snapshots are created for read replica
# skip_final_snapshot = "true"
# db_backup_retention_period = 0

# use "allow_major_version_upgrade" when upgrading the major version of an engine
allow_major_version_upgrade = "true"
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ variable "db_engine" {

variable "db_engine_version" {
description = "The engine version to use e.g. 10"
default = "10"
default = "10.11"
}

variable "db_instance_class" {
Expand Down Expand Up @@ -116,6 +116,6 @@ variable "replicate_source_db" {

variable "skip_final_snapshot" {
type = string
description = "If false(default) all DB are taken a final snapshot unless the db instance is created from snapshot itself or a read replica."
description = "if false(default), a DB snapshot is created before the DB instance is deleted, using the value from final_snapshot_identifier. If true no DBSnapshot is created"
default = "false"
}

0 comments on commit 1cce090

Please sign in to comment.