Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make access_control_policy a string, fix ACL count check
  • Loading branch information
robwittman committed Mar 8, 2022
commit c9698f63cae1f7704ca0c20a626ebcd0b5531880
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_acceleration_status"></a> [acceleration\_status](#input\_acceleration\_status) | (Optional) Sets the accelerate configuration of an existing bucket. Can be Enabled or Suspended. | `string` | `null` | no |
| <a name="input_access_control_policy"></a> [access\_control\_policy](#input\_access\_control\_policy) | An ACL policy grant. Conflicts with `acl` | `any` | `[]` | no |
| <a name="input_access_control_policy"></a> [access\_control\_policy](#input\_access\_control\_policy) | An ACL policy grant. Conflicts with `acl` | `any` | `""` | no |
| <a name="input_acl"></a> [acl](#input\_acl) | (Optional) The canned ACL to apply. Defaults to 'private'. Conflicts with `access_control_policy` | `string` | `"private"` | no |
| <a name="input_attach_deny_insecure_transport_policy"></a> [attach\_deny\_insecure\_transport\_policy](#input\_attach\_deny\_insecure\_transport\_policy) | Controls if S3 bucket should have deny non-SSL transport policy attached | `bool` | `false` | no |
| <a name="input_attach_elb_log_delivery_policy"></a> [attach\_elb\_log\_delivery\_policy](#input\_attach\_elb\_log\_delivery\_policy) | Controls if S3 bucket should have ELB log delivery policy attached | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ resource "aws_s3_bucket_accelerate_configuration" "this" {
}

resource "aws_s3_bucket_acl" "this" {
count = var.acl == "" && length(keys(try(jsondecode(var.access_control_policy), var.access_control_policy))) == 0 ? 0 : 1
count = var.acl == "" && var.access_control_policy == "" ? 0 : 1

bucket = aws_s3_bucket.this.id
acl = var.acl
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "logging" {
variable "access_control_policy" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the description of var.acl too :)

description = "An ACL policy grant. Conflicts with `acl`"
type = any
default = []
default = ""
}

variable "lifecycle_rule" {
Expand Down