Skip to content

Commit

Permalink
- common
Browse files Browse the repository at this point in the history
  - add bucket_policy_disabled to not apply a default policy if desired to do the policy differently
  • Loading branch information
badra001 committed Oct 6, 2022
1 parent 62d3a67 commit b1018f3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ This works with the Terraform AWS provider 4.x, released 2022-02.
* 3.3.3 -- 2022-09-21
- common
- change aws_s3_bucket_versioning default if disabled to Suspended

* 3.3.4 -- 2022-10-06
- common
- add bucket_policy_disabled to not apply a default policy if desired to do the policy differently
1 change: 1 addition & 0 deletions common/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ data "aws_iam_policy_document" "this" {
# apply policy to bucket and public access block policy to bucket
#---
resource "aws_s3_bucket_policy" "policy" {
count = var.bucket_policy_disabled ? 0 : 1
bucket = aws_s3_bucket.this.bucket
# policy = data.aws_iam_policy_document.this.json
policy = data.aws_iam_policy_document.bucket_policy_combined.json
Expand Down
6 changes: 6 additions & 0 deletions common/variables.s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ variable "object_lock_enabled" {
type = bool
default = false
}

variable "bucket_policy_disable" {
description = "Flag to enable or disable the default bucket policy. This is used for where we need to create the bucket policy outside of the module to prevent cyclical setup"
type = bool
default = false
}
2 changes: 1 addition & 1 deletion common/version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "3.3.3"
_module_version = "3.3.4"
}

0 comments on commit b1018f3

Please sign in to comment.