Skip to content

Feat/add replica mode argument #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,16 @@ Users have the ability to:

| Name | Version |
|------|---------|
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.1 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.1.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db_instance"></a> [db\_instance](#module\_db\_instance) | ./modules/db_instance | |
| <a name="module_db_option_group"></a> [db\_option\_group](#module\_db\_option\_group) | ./modules/db_option_group | |
| <a name="module_db_parameter_group"></a> [db\_parameter\_group](#module\_db\_parameter\_group) | ./modules/db_parameter_group | |
| <a name="module_db_subnet_group"></a> [db\_subnet\_group](#module\_db\_subnet\_group) | ./modules/db_subnet_group | |
| <a name="module_db_instance"></a> [db\_instance](#module\_db\_instance) | ./modules/db_instance | n/a |
| <a name="module_db_option_group"></a> [db\_option\_group](#module\_db\_option\_group) | ./modules/db_option_group | n/a |
| <a name="module_db_parameter_group"></a> [db\_parameter\_group](#module\_db\_parameter\_group) | ./modules/db_parameter_group | n/a |
| <a name="module_db_subnet_group"></a> [db\_subnet\_group](#module\_db\_subnet\_group) | ./modules/db_subnet_group | n/a |

## Resources

Expand Down Expand Up @@ -300,6 +300,7 @@ Users have the ability to:
| <a name="input_port"></a> [port](#input\_port) | The port on which the DB accepts connections | `string` | `null` | no |
| <a name="input_publicly_accessible"></a> [publicly\_accessible](#input\_publicly\_accessible) | Bool to control if instance is publicly accessible | `bool` | `false` | no |
| <a name="input_random_password_length"></a> [random\_password\_length](#input\_random\_password\_length) | (Optional) Length of random password to create. (default: 10) | `number` | `10` | no |
| <a name="input_replica_mode"></a> [replica\_mode](#input\_replica\_mode) | (Optional) Specifies whether the replica is in either 'mounted' or 'open-read-only' mode. Supported by Oracle Instances Only | `string` | `null` | no |
| <a name="input_replicate_source_db"></a> [replicate\_source\_db](#input\_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` | `null` | no |
| <a name="input_restore_to_point_in_time"></a> [restore\_to\_point\_in\_time](#input\_restore\_to\_point\_in\_time) | Restore to a point in time (MySQL is NOT supported) | `map(string)` | `null` | no |
| <a name="input_s3_import"></a> [s3\_import](#input\_s3\_import) | Restore from a Percona Xtrabackup in S3 (only MySQL is supported) | `map(string)` | `null` | no |
Expand Down
6 changes: 3 additions & 3 deletions examples/complete-mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Note that this example may create resources which cost money. Run `terraform des

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

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db"></a> [db](#module\_db) | ../../ | |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | |
| <a name="module_db"></a> [db](#module\_db) | ../../ | n/a |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 |

Expand Down
6 changes: 3 additions & 3 deletions examples/complete-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db"></a> [db](#module\_db) | ../../ | |
| <a name="module_db_default"></a> [db\_default](#module\_db\_default) | ../../ | |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | |
| <a name="module_db"></a> [db](#module\_db) | ../../ | n/a |
| <a name="module_db_default"></a> [db\_default](#module\_db\_default) | ../../ | n/a |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 |

Expand Down
5 changes: 3 additions & 2 deletions examples/complete-oracle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db"></a> [db](#module\_db) | ../../ | |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | |
| <a name="module_db"></a> [db](#module\_db) | ../../ | n/a |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | n/a |
| <a name="module_db_replica"></a> [db\_replica](#module\_db\_replica) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 |

Expand Down
6 changes: 3 additions & 3 deletions examples/complete-oracle/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ module "db" {
identifier = "demodb-oracle"

engine = "oracle-ee"
engine_version = "12.1.0.2.v8"
family = "oracle-ee-12.1" # DB parameter group
major_engine_version = "12.1" # DB option group
engine_version = "19.0.0.0.ru-2019-10.rur-2019-10.r1"
family = "oracle-ee-19" # DB parameter group
major_engine_version = "19" # DB option group
instance_class = "db.t3.large"
license_model = "bring-your-own-license"

Expand Down
6 changes: 3 additions & 3 deletions examples/complete-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db"></a> [db](#module\_db) | ../../ | |
| <a name="module_db_default"></a> [db\_default](#module\_db\_default) | ../../ | |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | |
| <a name="module_db"></a> [db](#module\_db) | ../../ | n/a |
| <a name="module_db_default"></a> [db\_default](#module\_db\_default) | ../../ | n/a |
| <a name="module_db_disabled"></a> [db\_disabled](#module\_db\_disabled) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 |

Expand Down
4 changes: 2 additions & 2 deletions examples/cross-region-replica-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_master"></a> [master](#module\_master) | ../../ | |
| <a name="module_replica"></a> [replica](#module\_replica) | ../../ | |
| <a name="module_master"></a> [master](#module\_master) | ../../ | n/a |
| <a name="module_replica"></a> [replica](#module\_replica) | ../../ | n/a |
| <a name="module_security_group_region1"></a> [security\_group\_region1](#module\_security\_group\_region1) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_security_group_region2"></a> [security\_group\_region2](#module\_security\_group\_region2) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc_region1"></a> [vpc\_region1](#module\_vpc\_region1) | terraform-aws-modules/vpc/aws | ~> 2.0 |
Expand Down
4 changes: 2 additions & 2 deletions examples/enhanced-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Note that this example may create resources which cost money. Run `terraform des

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

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db"></a> [db](#module\_db) | ../../ | |
| <a name="module_db"></a> [db](#module\_db) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2 |

Expand Down
10 changes: 5 additions & 5 deletions examples/groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_byo_mysql"></a> [byo\_mysql](#module\_byo\_mysql) | ../../ | |
| <a name="module_default_mysql"></a> [default\_mysql](#module\_default\_mysql) | ../../ | |
| <a name="module_default_mysql_default_aws"></a> [default\_mysql\_default\_aws](#module\_default\_mysql\_default\_aws) | ../../ | |
| <a name="module_default_mysql_name"></a> [default\_mysql\_name](#module\_default\_mysql\_name) | ../../ | |
| <a name="module_default_postgres"></a> [default\_postgres](#module\_default\_postgres) | ../../ | |
| <a name="module_byo_mysql"></a> [byo\_mysql](#module\_byo\_mysql) | ../../ | n/a |
| <a name="module_default_mysql"></a> [default\_mysql](#module\_default\_mysql) | ../../ | n/a |
| <a name="module_default_mysql_default_aws"></a> [default\_mysql\_default\_aws](#module\_default\_mysql\_default\_aws) | ../../ | n/a |
| <a name="module_default_mysql_name"></a> [default\_mysql\_name](#module\_default\_mysql\_name) | ../../ | n/a |
| <a name="module_default_postgres"></a> [default\_postgres](#module\_default\_postgres) | ../../ | n/a |

## Resources

Expand Down
4 changes: 2 additions & 2 deletions examples/replica-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_master"></a> [master](#module\_master) | ../../ | |
| <a name="module_replica"></a> [replica](#module\_replica) | ../../ | |
| <a name="module_master"></a> [master](#module\_master) | ../../ | n/a |
| <a name="module_replica"></a> [replica](#module\_replica) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |

Expand Down
4 changes: 2 additions & 2 deletions examples/replica-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_master"></a> [master](#module\_master) | ../../ | |
| <a name="module_replica"></a> [replica](#module\_replica) | ../../ | |
| <a name="module_master"></a> [master](#module\_master) | ../../ | n/a |
| <a name="module_replica"></a> [replica](#module\_replica) | ../../ | n/a |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |

Expand Down
6 changes: 3 additions & 3 deletions examples/s3-import-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.49 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.62.0 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.1.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_db"></a> [db](#module\_db) | ../../ | |
| <a name="module_db"></a> [db](#module\_db) | ../../ | n/a |
| <a name="module_import_s3_bucket"></a> [import\_s3\_bucket](#module\_import\_s3\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 2.0 |
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4 |
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 2.0 |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module "db_instance" {
storage_encrypted = var.storage_encrypted
kms_key_id = var.kms_key_id
license_model = var.license_model
replica_mode = var.replica_mode

name = var.name
username = var.username
Expand Down
5 changes: 3 additions & 2 deletions modules/db_instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.49 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.2 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.62.0 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.1.0 |

## Modules

Expand Down Expand Up @@ -80,6 +80,7 @@ No modules.
| <a name="input_performance_insights_retention_period"></a> [performance\_insights\_retention\_period](#input\_performance\_insights\_retention\_period) | The amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years). | `number` | `7` | no |
| <a name="input_port"></a> [port](#input\_port) | The port on which the DB accepts connections | `string` | `null` | no |
| <a name="input_publicly_accessible"></a> [publicly\_accessible](#input\_publicly\_accessible) | Bool to control if instance is publicly accessible | `bool` | `false` | no |
| <a name="input_replica_mode"></a> [replica\_mode](#input\_replica\_mode) | (Optional) Specifies whether the replica is in either 'mounted' or 'open-read-only' mode. Supported by Oracle Instances Only | `string` | `null` | no |
| <a name="input_replicate_source_db"></a> [replicate\_source\_db](#input\_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` | `null` | no |
| <a name="input_restore_to_point_in_time"></a> [restore\_to\_point\_in\_time](#input\_restore\_to\_point\_in\_time) | Restore to a point in time (MySQL is NOT supported) | `map(string)` | `null` | no |
| <a name="input_s3_import"></a> [s3\_import](#input\_s3\_import) | Restore from a Percona Xtrabackup in S3 (only MySQL is supported) | `map(string)` | `null` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/db_instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ resource "aws_db_instance" "this" {
storage_encrypted = var.storage_encrypted
kms_key_id = var.kms_key_id
license_model = var.license_model
replica_mode = var.replica_mode

name = var.name
username = var.username
Expand Down
6 changes: 6 additions & 0 deletions modules/db_instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -337,3 +337,9 @@ variable "restore_to_point_in_time" {
type = map(string)
default = null
}

variable "replica_mode" {
description = "(Optional) Specifies whether the replica is in either 'mounted' or 'open-read-only' mode. Supported by Oracle Instances Only"
type = string
default = null
}
2 changes: 1 addition & 1 deletion modules/db_option_group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/db_parameter_group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/db_subnet_group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

## Modules

Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,10 @@ variable "random_password_length" {
type = number
default = 10
}


variable "replica_mode" {
description = "(Optional) Specifies whether the replica is in either 'mounted' or 'open-read-only' mode. Supported by Oracle Instances Only"
type = string
default = null
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.49"
version = ">= 3.62"
}
random = {
source = "hashicorp/random"
Expand Down