From 3726310c924d57a47ca566bac79d52160934d1d8 Mon Sep 17 00:00:00 2001 From: MrDevOpsMan Date: Wed, 16 Oct 2024 14:11:39 +0100 Subject: [PATCH 1/4] Update aws_s3_bucket.tf --- aws_s3_bucket.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws_s3_bucket.tf b/aws_s3_bucket.tf index f090aac..8129768 100644 --- a/aws_s3_bucket.tf +++ b/aws_s3_bucket.tf @@ -7,6 +7,7 @@ resource "aws_s3_bucket" "bucket" { } resource "aws_s3_bucket_acl" "bucket-acl" { + count = var.acl_enabled : 1 : 0 bucket = aws_s3_bucket.bucket.id acl = var.s3_bucket_acl } @@ -108,4 +109,4 @@ data "aws_iam_policy_document" "bucket-tls-policy-document" { one(aws_s3_bucket.bucket[*].arn), ] } -} \ No newline at end of file +} From 77e5302fb9b683fa143f795f676306fdc3434a4f Mon Sep 17 00:00:00 2001 From: MrDevOpsMan Date: Wed, 16 Oct 2024 14:12:28 +0100 Subject: [PATCH 2/4] Update variables.tf --- variables.tf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 2d5459f..f90916f 100644 --- a/variables.tf +++ b/variables.tf @@ -100,4 +100,10 @@ variable "tls_enabled" { description = "If TLS on the bucket should be enabled." type = bool default = true -} \ No newline at end of file +} + + +variable "acl_enabled" { + description = "Either enable or disable acl on the bucket" + default = false +} From 5026395d766384d264996d72f4233858ef316e6b Mon Sep 17 00:00:00 2001 From: osotopbot <72751587+osotopbot@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:13:06 +0000 Subject: [PATCH 3/4] Auto Format --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1de0699..383a9f1 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ File a GitHub [issue](https://github.com/osodevops/aws-terraform-module-s3/issue ## The legals -Copyright © 2017-2022 [OSO](https://oso.sh) | See [LICENCE](LICENSE) for full details. +Copyright © 2017-2024 [OSO](https://oso.sh) | See [LICENCE](LICENSE) for full details. [OSO who we are](https://oso.sh/who-we-are/) From 7c6ff165a5ad2b71eb8261f41671e7d0e8fc3a6d Mon Sep 17 00:00:00 2001 From: MrDevOpsMan Date: Wed, 16 Oct 2024 14:29:16 +0100 Subject: [PATCH 4/4] Update aws_s3_bucket.tf --- aws_s3_bucket.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_s3_bucket.tf b/aws_s3_bucket.tf index 8129768..39d58fc 100644 --- a/aws_s3_bucket.tf +++ b/aws_s3_bucket.tf @@ -7,7 +7,7 @@ resource "aws_s3_bucket" "bucket" { } resource "aws_s3_bucket_acl" "bucket-acl" { - count = var.acl_enabled : 1 : 0 + count = var.acl_enabled ? 1 : 0 bucket = aws_s3_bucket.bucket.id acl = var.s3_bucket_acl }