Skip to content

Commit

Permalink
feat: remove destructino delay
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Jul 17, 2023
1 parent 102c3ec commit f141883
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ other optional variables (e.g., `name`, `tags`, etc.) provided by the
|---------------------------|---------------------------------------------------------------------------|:------:|:-------:|:--------:|
| auth_service_config | Configuration details for the authentication service. More details below. | object | `{}` | no |
| urlrewrite_service_config | Configuration details for the URL rewrite service, More details below. | object | `{}` | no |
| destruction_delay | Delay before destroying resources when they are deleted | string | `"20m"` | no |
| aws_account_id | The AWS account ID that the module will be deployed in | string | `""` | no |
| aws_region_name | The AWS region name where the module will be deployed | string | `""` | no |

Expand Down
11 changes: 0 additions & 11 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ locals {
enabled = module.this.enabled
auth_service_enabled = local.enabled && var.auth_service_config.enabled
urlrewrite_service_enabled = local.enabled && var.urlrewrite_service_config.enabled
destruction_delay_enabled = var.destruction_delay != null

aws_account_id = try(coalesce(var.aws_account_id, data.aws_caller_identity.current[0].account_id), "")
aws_region_name = try(coalesce(var.aws_region_name, data.aws_region.current[0].name), "")
Expand Down Expand Up @@ -85,16 +84,6 @@ data "aws_region" "current" {
count = module.this.enabled && var.aws_region_name == "" ? 1 : 0
}

resource "time_sleep" "destruction_delay" {
for_each = local.destruction_delay_enabled ? aws_lambda_function.auth_service : {}

destroy_duration = var.destruction_delay

triggers = {
arn = each.value.arn
}
}

# ====================================================== middleware-services ===

module "mw_service_label" {
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ variable "urlrewrite_service_config" {
default = {}
}

variable "destruction_delay" {
description = "Delay before destroying resources when they are deleted"
type = string
default = "20m"
}

variable "aws_account_id" {
description = "The AWS account ID that the module will be deployed in"
type = string
Expand Down

0 comments on commit f141883

Please sign in to comment.