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

[Feature] Allow Bucket Destruction via Code #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions modules/provisioning/s3-archive/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ resource "aws_s3_bucket" "logs_bucket_name" {
count = local.logs_validations ? 1 : 0
bucket = var.logs_bucket_name
lifecycle {
prevent_destroy = true
prevent_destroy = var.bypass_bucket_lifecycle_prevent_destroy
}
}

resource "aws_s3_bucket" "metrics_bucket_name" {
count = local.metrics_validations ? 1 : 0
bucket = var.metrics_bucket_name
lifecycle {
prevent_destroy = true
prevent_destroy = var.bypass_bucket_lifecycle_prevent_destroy
}
}

Expand Down
6 changes: 6 additions & 0 deletions modules/provisioning/s3-archive/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ variable "bypass_valid_region" {
default = ""
}

variable "bypass_bucket_lifecycle_prevent_destroy" {
type = bool
description = "Use this to bypass the bucket lifecycle so that you can (if needed) use terraform destroy to turn down infrastructure"
default = true
}

variable "custom_coralogix_arn" {
type = string
description = "In case that you want to use a custom coralogix arn enter the aws account id that you want to use"
Expand Down