From 3ef57d01de1154be7c2fd80ea7baeec6c4fd12df Mon Sep 17 00:00:00 2001 From: Bayron Carranza Date: Wed, 22 Jun 2022 22:18:45 -0600 Subject: [PATCH 1/4] add input var s3_object_ownership --- main.tf | 4 ++-- variables.tf | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 51d6785..a7c31ad 100644 --- a/main.tf +++ b/main.tf @@ -10,7 +10,7 @@ module "access_log_label" { module "s3_bucket" { source = "cloudposse/s3-log-storage/aws" - version = "0.26.0" + version = "0.28.0" enabled = module.this.enabled acl = var.acl @@ -38,7 +38,7 @@ module "s3_bucket" { bucket_notifications_enabled = var.bucket_notifications_enabled bucket_notifications_type = var.bucket_notifications_type bucket_notifications_prefix = var.bucket_notifications_prefix - + s3_object_ownership = var.s3_object_ownership context = module.this.context } diff --git a/variables.tf b/variables.tf index 33b45f0..ddba342 100644 --- a/variables.tf +++ b/variables.tf @@ -147,4 +147,10 @@ variable "bucket_notifications_prefix" { type = string description = "Prefix filter. Used to manage object notifications" default = "" +} + +variable "s3_object_ownership" { + type = string + default = "BucketOwnerPreferred" + description = "Specifies the S3 object ownership control. Valid values are `ObjectWriter`, `BucketOwnerPreferred`, and 'BucketOwnerEnforced'." } \ No newline at end of file From bd5572124ae8c38a076a57a4b6b4942df03a2998 Mon Sep 17 00:00:00 2001 From: Bayron Carranza Date: Thu, 28 Dec 2023 15:18:19 -0600 Subject: [PATCH 2/4] tf-upgrade --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index a7c31ad..86bcbc6 100644 --- a/main.tf +++ b/main.tf @@ -76,7 +76,7 @@ module "s3_access_log_bucket" { data "aws_iam_policy_document" "default" { count = module.this.enabled ? 1 : 0 - source_json = var.policy == "" ? null : var.policy + source_policy_documents = [var.policy == "" ? null : var.policy] statement { sid = "AWSCloudTrailAclCheck" From 2cf40550fc27a4141ec4175c9600d2bd9cac58f6 Mon Sep 17 00:00:00 2001 From: Bayron Carranza Date: Thu, 28 Dec 2023 15:30:28 -0600 Subject: [PATCH 3/4] new s3 bucket version --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 86bcbc6..19d275f 100644 --- a/main.tf +++ b/main.tf @@ -44,7 +44,7 @@ module "s3_bucket" { module "s3_access_log_bucket" { source = "cloudposse/s3-log-storage/aws" - version = "0.26.0" + version = "1.0.0" enabled = module.this.enabled && var.create_access_log_bucket acl = var.acl From 27575e7a6303d38dd62e559f125447b8fec71464 Mon Sep 17 00:00:00 2001 From: Bayron Carranza Date: Thu, 28 Dec 2023 15:38:43 -0600 Subject: [PATCH 4/4] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 19d275f..3900e79 100644 --- a/main.tf +++ b/main.tf @@ -76,7 +76,7 @@ module "s3_access_log_bucket" { data "aws_iam_policy_document" "default" { count = module.this.enabled ? 1 : 0 - source_policy_documents = [var.policy == "" ? null : var.policy] + source_policy_documents = [var.policy] statement { sid = "AWSCloudTrailAclCheck"