From 5306a80c5cb74283503b47437a4141303caaf620 Mon Sep 17 00:00:00 2001 From: lpm0073 Date: Thu, 10 Aug 2023 16:06:33 -0600 Subject: [PATCH] refactor ACL config --- .../environments/modules/s3/openedx_backups.tf | 7 ++++--- .../environments/modules/s3/openedx_secrets.tf | 7 ++++--- .../environments/modules/s3/openedx_storage.tf | 15 +++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_backups.tf b/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_backups.tf index 1829fcca..47172960 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_backups.tf +++ b/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_backups.tf @@ -11,9 +11,10 @@ module "openedx_backup" { source = "terraform-aws-modules/s3-bucket/aws" version = "~> {{ cookiecutter.terraform_aws_modules_s3 }}" - bucket = var.resource_name_backup - object_ownership = "BucketOwnerPreferred" - acl = "private" + bucket = var.resource_name_backup + acl = "private" + control_object_ownership = true + object_ownership = "ObjectWriter" tags = merge( local.tags, diff --git a/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_secrets.tf b/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_secrets.tf index d436d8aa..7c6f62a8 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_secrets.tf +++ b/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_secrets.tf @@ -11,9 +11,10 @@ module "openedx_secrets" { source = "terraform-aws-modules/s3-bucket/aws" version = "~> {{ cookiecutter.terraform_aws_modules_s3 }}" - bucket = var.resource_name_secrets - object_ownership = "BucketOwnerPreferred" - acl = "private" + bucket = var.resource_name_secrets + acl = "private" + control_object_ownership = true + object_ownership = "ObjectWriter" tags = merge( local.tags, diff --git a/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_storage.tf b/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_storage.tf index ca7ad440..3ff5b2f9 100644 --- a/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_storage.tf +++ b/{{cookiecutter.github_repo_name}}/terraform/environments/modules/s3/openedx_storage.tf @@ -11,22 +11,21 @@ module "openedx_storage" { source = "terraform-aws-modules/s3-bucket/aws" version = "~> {{ cookiecutter.terraform_aws_modules_s3 }}" - bucket = var.resource_name_storage - acl = "private" + bucket = var.resource_name_storage + acl = "private" + control_object_ownership = true + object_ownership = "ObjectWriter" tags = merge( local.tags, { "cookiecutter/resource/source" = "terraform-aws-modules/s3-bucket/aws" - "cookiecutter/resource/version" = "{{ cookiecutter.terraform_aws_modules_s3 }}" + "cookiecutter/resource/version" = "3.6" } ) - control_object_ownership = true - object_ownership = "BucketOwnerPreferred" - - attach_policy = true - policy = data.aws_iam_policy_document.bucket_policy.json + # attach_policy = true + # policy = data.aws_iam_policy_document.bucket_policy.json cors_rule = [ {