Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Added delete timeout for db_option_group (terraform-aws-modules#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko authored Jan 9, 2020
1 parent 1492acf commit 42c1763
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ module "db" {
| name | The DB name to create. If omitted, no database is created initially | string | `""` | no |
| option\_group\_description | The description of the option group | string | `""` | no |
| option\_group\_name | Name of the DB option group to associate | string | `""` | no |
| option\_group\_timeouts | Define maximum timeout for deletion of `aws\_db\_option\_group` resource | map(string) | `{ "delete": "15m" }` | no |
| options | A list of Options to apply. | any | `[]` | no |
| parameter\_group\_description | Description of the DB parameter group to create | string | `""` | no |
| parameter\_group\_name | Name of the DB parameter group to associate or create | string | `""` | no |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module "db_option_group" {

options = var.options

timeouts = var.option_group_timeouts

tags = var.tags
}

Expand Down
1 change: 1 addition & 0 deletions modules/db_option_group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| option\_group\_description | The description of the option group | string | `""` | no |
| options | A list of Options to apply | any | `[]` | no |
| tags | A mapping of tags to assign to the resource | map(string) | `{}` | no |
| timeouts | Define maximum timeout for deletion of `aws\_db\_option\_group` resource | map(string) | `{ "delete": "15m" }` | no |

## Outputs

Expand Down
4 changes: 4 additions & 0 deletions modules/db_option_group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ resource "aws_db_option_group" "this" {
},
)

timeouts {
delete = lookup(var.timeouts, "delete", null)
}

lifecycle {
create_before_destroy = true
}
Expand Down
9 changes: 8 additions & 1 deletion modules/db_option_group/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ variable "options" {
default = []
}

variable "timeouts" {
description = "Define maximum timeout for deletion of `aws_db_option_group` resource"
type = map(string)
default = {
delete = "15m"
}
}

variable "tags" {
description = "A mapping of tags to assign to the resource"
type = map(string)
default = {}
}

8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ variable "timeouts" {
}
}

variable "option_group_timeouts" {
description = "Define maximum timeout for deletion of `aws_db_option_group` resource"
type = map(string)
default = {
delete = "15m"
}
}

variable "deletion_protection" {
description = "The database can't be deleted when this value is set to true."
type = bool
Expand Down

0 comments on commit 42c1763

Please sign in to comment.