Skip to content

Commit 307b9e5

Browse files
authored
Merge pull request #11 from joshbeard/permissions_boundary
Support IAM permissions boundaries
2 parents ff964a3 + 9867e78 commit 307b9e5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ module "efs" {
4848
| allowed\_cidrs | List of CIDRs permitted to access EFS mounts | `list(string)` | `[]` | no |
4949
| allowed\_security\_groups | List of Security Group IDs permitted to access EFS mounts | `list(string)` | `[]` | no |
5050
| backup\_kms\_key\_id | KMS Key to use for backups (Specify `aws/backup` to use the default key, leave null to have a key generated automatically) | `string` | `null` | no |
51+
| backup\_role\_permissions\_boundary | Optional [permissions boundary](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) ARN to use for the backup IAM role. | `string` | `null` | no |
5152
| backup\_schedule | Cron schedule to run backups on | `string` | `"cron(0 0 * * ? *)"` | no |
5253
| create | If `false`, this module does nothing | `bool` | `true` | no |
5354
| efs\_kms\_key\_id | ARN of KMS key to use for EFS encryption (leave null to create a key, set to `aws/backup` to use AWS default CMK) | `string` | `null` | no |

backup.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ resource "aws_iam_role" "backup" {
6363

6464
name_prefix = substr("${var.name}-backup", 0, 32)
6565

66-
assume_role_policy = data.aws_iam_policy_document.assume_backup.json
67-
tags = var.additional_tags
66+
assume_role_policy = data.aws_iam_policy_document.assume_backup.json
67+
permissions_boundary = var.backup_role_permissions_boundary
68+
tags = var.additional_tags
6869

6970
lifecycle {
7071
create_before_destroy = true

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,9 @@ variable "enable_backups" {
9393
description = "Should AWS Backup be configured for this file system?"
9494
type = bool
9595
}
96+
97+
variable "backup_role_permissions_boundary" {
98+
default = null
99+
description = "An optional IAM permissions boundary to use when creating the IAM role for backups"
100+
type = string
101+
}

0 commit comments

Comments
 (0)