Skip to content

Commit

Permalink
Add force destroy option
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Nemetz committed Jun 21, 2018
1 parent dfd9041 commit 28b60f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ module "labels" {
resource "aws_s3_bucket" "this" {
count = "${module.enabled.value ? length(var.names) : 0}"

bucket = "${module.labels.id[count.index]}"
acl = "${var.public ? "public-read" : "private"}"
bucket = "${module.labels.id[count.index]}"
acl = "${var.public ? "public-read" : "private"}"
force_destroy = "${var.force_destroy}"

versioning {
enabled = "${var.versioned}"
}

#acceleration_status
#force_destroy = true
#lifecycle_rule {}
#logging {
# target_bucket
Expand All @@ -71,6 +71,7 @@ resource "aws_s3_bucket" "this" {
#region
#request_payer
#replication_configuration {}
#server_side_encryption_configuration
tags = "${module.labels.tags[count.index]}"
}

Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ variable "enabled" {
default = true
}

variable "force_destroy" {
description = "Delete all objects in bucket on destroy"
default = false
}

variable "principal" {
description = "principal"
default = "*"
Expand Down

0 comments on commit 28b60f4

Please sign in to comment.