diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index 6f566b4..616d4b5 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -1,5 +1,5 @@ terraform { - required_version = "~> 1.4.4" + required_version = ">= 1.4.6" required_providers { aws = { diff --git a/s3.tf b/s3.tf index 5c5f965..e053158 100644 --- a/s3.tf +++ b/s3.tf @@ -11,6 +11,7 @@ resource "aws_s3_bucket_ownership_controls" "geff_bucket_ownership_controls" { } resource "aws_s3_bucket_acl" "geff_bucket_acl" { + count = var.bucket_object_ownership_settings == "BucketOwnerPreferred" ? 1 : 0 bucket = aws_s3_bucket.geff_bucket.id acl = "private" diff --git a/variables.tf b/variables.tf index a402116..8b762bd 100644 --- a/variables.tf +++ b/variables.tf @@ -46,6 +46,7 @@ variable "bucket_object_ownership_settings" { default = "BucketOwnerEnforced" } + data "aws_caller_identity" "current" {} data "aws_region" "current" {} data "aws_partition" "current" {}