diff --git a/README.md b/README.md index 73e4287..0351399 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Comment in these badges if they apply to the repository. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [accessors\_read\_write](#input\_accessors\_read\_write) | List of accessors that are allowed to read & write. | `list(string)` | `[]` | no | | [bypass\_policy\_lockout\_safety\_check](#input\_bypass\_policy\_lockout\_safety\_check) | A flag to indicate whether to bypass the aws\_efs\_file\_system\_policy lockout safety check. | `bool` | `false` | no | | [enable\_enhanced\_backups](#input\_enable\_enhanced\_backups) | Enable enhanced backups. | `bool` | `false` | no | | [encrypted](#input\_encrypted) | If true, the disk will be encrypted. | `bool` | `true` | no | diff --git a/data.tf b/data.tf index c06304c..db6849a 100644 --- a/data.tf +++ b/data.tf @@ -18,8 +18,11 @@ data "aws_iam_policy_document" "main" { } principals { - type = "AWS" - identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"] + type = "AWS" + identifiers = coalescelist( + ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"], + var.accessors_read_write + ) } } } diff --git a/variables.tf b/variables.tf index 2f45feb..1b1878b 100644 --- a/variables.tf +++ b/variables.tf @@ -68,3 +68,9 @@ variable "transition_to_primary_storage_class" { description = "Describes the policy used to transition a file from infequent access storage to primary storage. Only AFTER_1_ACCESS is accepted" type = string } + +variable "accessors_read_write" { + default = [] + description = "List of accessors that are allowed to read & write." + type = list(string) +}