Skip to content

Commit

Permalink
Merge pull request #83 from rancherfederal/optional-acl
Browse files Browse the repository at this point in the history
toggle statestore
  • Loading branch information
adamacosta authored Apr 26, 2023
2 parents d48d046 + 80aa775 commit 8adcb1f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ resource "random_password" "token" {
}

module "statestore" {
source = "./modules/statestore"
name = local.uname
token = random_password.token.result
tags = merge(local.default_tags, var.tags)
source = "./modules/statestore"
name = local.uname
create_acl = var.create_acl
token = random_password.token.result
tags = merge(local.default_tags, var.tags)

attach_deny_insecure_transport_policy = var.statestore_attach_deny_insecure_transport_policy
}
Expand Down
1 change: 1 addition & 0 deletions modules/statestore/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource "aws_s3_bucket_ownership_controls" "bucket_ownership_controls" {
}

resource "aws_s3_bucket_acl" "acl" {
count = var.create_acl ? 1 : 0
bucket = aws_s3_bucket.bucket.id
acl = "private"

Expand Down
5 changes: 5 additions & 0 deletions modules/statestore/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ variable "tags" {
variable "attach_deny_insecure_transport_policy" {
type = bool
}

variable "create_acl" {
type = bool
default = true
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,9 @@ variable "statestore_attach_deny_insecure_transport_policy" {
type = bool
default = true
}

variable "create_acl" {
description = "Toggle creation of ACL for statestore bucket"
type = bool
default = true
}

0 comments on commit 8adcb1f

Please sign in to comment.