Skip to content

Commit 1902eac

Browse files
committed
allow write list and read list to be separate
1 parent 34b3b51 commit 1902eac

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ No modules.
4848

4949
| Name | Description | Type | Default | Required |
5050
|------|-------------|------|---------|:--------:|
51-
| <a name="input_allow_cross_account_write"></a> [allow\_cross\_account\_write](#input\_allow\_cross\_account\_write) | Allow write access to helm repo from `allowed_account_ids` | `bool` | `false` | no |
5251
| <a name="input_allowed_account_ids"></a> [allowed\_account\_ids](#input\_allowed\_account\_ids) | List of AWS account IDs to grant read-only access to the repo. Due to how policies are constructed, there's effectively a limit of about 9 accounts. | `list(string)` | `[]` | no |
52+
| <a name="input_allowed_account_ids_write"></a> [allowed\_account\_ids\_write](#input\_allowed\_account\_ids\_write) | List of AWS account IDs to grant write access to the repo. Due to how policies are constructed, there's effectively a limit of about 9 accounts. | `list(string)` | `[]` | no |
5353
| <a name="input_logging_bucket"></a> [logging\_bucket](#input\_logging\_bucket) | S3 bucket name to log bucket access requests to (optional) | `string` | `null` | no |
5454
| <a name="input_logging_bucket_prefix"></a> [logging\_bucket\_prefix](#input\_logging\_bucket\_prefix) | S3 bucket prefix to log bucket access requests to (optional). If blank but a `logging_bucket` is specified, this will be set to the name of the bucket | `string` | `null` | no |
5555
| <a name="input_name"></a> [name](#input\_name) | Bucket name for the helm repo. Specify to control the exact name of the bucket, otherwise use `name_suffix` | `string` | `null` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ data "aws_iam_policy_document" "this" {
131131
}
132132

133133
dynamic "statement" {
134-
for_each = var.allow_cross_account_write ? var.allowed_account_ids : []
134+
for_each = var.allowed_account_ids_write
135135

136136
content {
137137
sid = "Allow Cross-account write access (${statement.value})"

variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
########################################
22
# General Vars
33
########################################
4-
variable "allow_cross_account_write" {
5-
default = false
6-
description = "Allow write access to helm repo from `allowed_account_ids`"
7-
type = bool
8-
}
9-
104
variable "allowed_account_ids" {
115
default = []
126
description = "List of AWS account IDs to grant read-only access to the repo. Due to how policies are constructed, there's effectively a limit of about 9 accounts."
137
type = list(string)
148
}
159

10+
variable "allowed_account_ids_write" {
11+
default = []
12+
description = "List of AWS account IDs to grant write access to the repo. Due to how policies are constructed, there's effectively a limit of about 9 accounts."
13+
type = list(string)
14+
}
15+
1616
variable "logging_bucket" {
1717
default = null
1818
description = "S3 bucket name to log bucket access requests to (optional)"

0 commit comments

Comments
 (0)