Skip to content
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

Add ability to set terraform timeouts{} map for aws_db_instance resources #73

Merged
merged 3 commits into from
Aug 18, 2018
Merged
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ module "db" {
| availability_zone | The Availability Zone of the RDS instance | string | `` | no |
| backup_retention_period | The days to retain backups for | string | `1` | no |
| backup_window | The daily time range (in UTC) during which automated backups are created if they are enabled. Example: '09:46-10:16'. Must not overlap with maintenance_window | string | - | yes |
| character_set_name | (Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information. | string | `` | no |
| character_set_name | (Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information | string | `` | no |
| copy_tags_to_snapshot | On delete, copy all Instance tags to the final snapshot (if final_snapshot_identifier is specified) | string | `false` | no |
| create_db_instance | Whether to create a database instance | string | `true` | no |
| create_db_option_group | Whether to create a database option group | string | `true` | no |
@@ -175,6 +175,7 @@ module "db" {
| storage_type | One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'standard' if not. Note that this behaviour is different from the AWS web console, where the default is 'gp2'. | string | `gp2` | no |
| subnet_ids | A list of VPC subnet IDs | list | `<list>` | no |
| tags | A mapping of tags to assign to all resources | string | `<map>` | no |
| timeouts | (Optional) Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | map | `<map>` | no |
| timezone | (Optional) Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information. | string | `` | no |
| username | Username for the master DB user | string | - | yes |
| vpc_security_group_ids | List of VPC security groups to associate | string | `<list>` | no |
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -101,5 +101,7 @@ module "db_instance" {
timezone = "${var.timezone}"
character_set_name = "${var.character_set_name}"

timeouts = "${var.timeouts}"

tags = "${var.tags}"
}
3 changes: 2 additions & 1 deletion modules/db_instance/README.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
| availability_zone | The Availability Zone of the RDS instance | string | `` | no |
| backup_retention_period | The days to retain backups for | string | `1` | no |
| backup_window | The daily time range (in UTC) during which automated backups are created if they are enabled. Example: '09:46-10:16'. Must not overlap with maintenance_window | string | - | yes |
| character_set_name | (Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information. | string | `` | no |
| character_set_name | (Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information | string | `` | no |
| copy_tags_to_snapshot | On delete, copy all Instance tags to the final snapshot (if final_snapshot_identifier is specified) | string | `false` | no |
| create | Whether to create this resource or not? | string | `true` | no |
| create_monitoring_role | Create IAM role with a defined name that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. | string | `false` | no |
@@ -44,6 +44,7 @@
| storage_encrypted | Specifies whether the DB instance is encrypted | string | `false` | no |
| storage_type | One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD). The default is 'io1' if iops is specified, 'standard' if not. Note that this behaviour is different from the AWS web console, where the default is 'gp2'. | string | `gp2` | no |
| tags | A mapping of tags to assign to all resources | string | `<map>` | no |
| timeouts | (Optional) Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times | map | `<map>` | no |
| timezone | (Optional) Time zone of the DB instance. timezone is currently only supported by Microsoft SQL Server. The timezone can only be set on creation. See MSSQL User Guide for more information. | string | `` | no |
| username | Username for the master DB user | string | - | yes |
| vpc_security_group_ids | List of VPC security groups to associate | string | `<list>` | no |
4 changes: 4 additions & 0 deletions modules/db_instance/main.tf
Original file line number Diff line number Diff line change
@@ -65,6 +65,8 @@ resource "aws_db_instance" "this" {

character_set_name = "${var.character_set_name}"

timeouts = "${var.timeouts}"

tags = "${merge(var.tags, map("Name", format("%s", var.identifier)))}"
}

@@ -117,5 +119,7 @@ resource "aws_db_instance" "this_mssql" {

timezone = "${var.timezone}"

timeouts = "${var.timeouts}"

tags = "${merge(var.tags, map("Name", format("%s", var.identifier)))}"
}
13 changes: 12 additions & 1 deletion modules/db_instance/variables.tf
Original file line number Diff line number Diff line change
@@ -189,6 +189,17 @@ variable "timezone" {
}

variable "character_set_name" {
description = "(Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information."
description = "(Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information"
default = ""
}

variable "timeouts" {
description = "(Optional) Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times"
type = "map"

default = {
create = "40m"
update = "80m"
delete = "40m"
}
}
13 changes: 12 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
@@ -239,6 +239,17 @@ variable "timezone" {
}

variable "character_set_name" {
description = "(Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information."
description = "(Optional) The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS for more information"
default = ""
}

variable "timeouts" {
description = "(Optional) Updated Terraform resource management timeouts. Applies to `aws_db_instance` in particular to permit resource management times"
type = "map"

default = {
create = "40m"
update = "80m"
delete = "40m"
}
}