Skip to content

Commit 6693739

Browse files
committed
Made force destroy option configurable in tfvars and documented
1 parent d43436e commit 6693739

5 files changed

Lines changed: 19 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ This module uses the following input variables:
115115
| app_name | string | | "bignbit" |
116116
| default_tags | map(string) | | {} |
117117
| lambda_container_image_uri | string | | "" |
118+
| force_delete_ecr | bool | Force delete the ECR repository and all its images on destroy. Set to true when migrating resource names to avoid manual cleanup. | false |
119+
| force_destroy_staging_bucket | bool | Force destroy the staging S3 bucket and all its contents on destroy. Set to true when migrating resource names to avoid manual cleanup. | false |
118120
| harmony_job_status_interval_seconds | number | Interval in seconds for checking Harmony job status | 20 |
119121
| harmony_job_status_max_attempts | number | Maximum number of attempts to check Harmony job status | 15 |
120122
| harmony_job_status_backoff_rate | number | Backoff rate for Harmony job status checks | 1.0 |

examples/cumulus-tf/tfvars/sit.tfvars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ prefix = "podaac-sit-svc"
66
gibs_region="mocked"
77
gibs_queue_name="mocked"
88
gibs_account_id="mocked"
9+
10+
force_delete_ecr = false
11+
force_destroy_staging_bucket = false

terraform/lambda_functions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ locals {
2222

2323
resource aws_ecr_repository "lambda-image-repo" {
2424
name = local.ecr_image_name
25-
force_delete = true
25+
force_delete = var.force_delete_ecr
2626
}
2727

2828

terraform/s3.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ locals {
77
resource "aws_s3_bucket" "bignbit_staging_bucket" {
88
count = local.create_bucket ? 1 : 0
99
bucket = "${local.aws_resources_name}-staging"
10-
force_destroy = true
10+
force_destroy = var.force_destroy_staging_bucket
1111

1212
lifecycle {
1313
ignore_changes = [

terraform/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ variable "lambda_container_image_uri" {
112112
default = ""
113113
}
114114

115+
variable "force_delete_ecr" {
116+
type = bool
117+
description = "Force delete the ECR repository and all its images on destroy. Set to true when migrating resource names to avoid manual cleanup."
118+
default = false
119+
}
120+
121+
variable "force_destroy_staging_bucket" {
122+
type = bool
123+
description = "Force destroy the staging S3 bucket and all its contents on destroy. Set to true when migrating resource names to avoid manual cleanup."
124+
default = false
125+
}
126+
115127
variable "harmony_job_status_interval_seconds" {
116128
type = number
117129
description = "Interval in seconds for checking Harmony job status"

0 commit comments

Comments
 (0)