Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ No modules.
| <a name="input_override_policy_documents"></a> [override\_policy\_documents](#input\_override\_policy\_documents) | List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid` | `list(string)` | `[]` | no |
| <a name="input_performance_mode"></a> [performance\_mode](#input\_performance\_mode) | The file system performance mode. Can be either `generalPurpose` or `maxIO`. Default is `generalPurpose` | `string` | `null` | no |
| <a name="input_policy_statements"></a> [policy\_statements](#input\_policy\_statements) | A list of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage | `any` | `[]` | no |
| <a name="input_protection"></a> [protection](#input\_protection) | A map of file protection configurations | `any` | `{}` | no |
| <a name="input_provisioned_throughput_in_mibps"></a> [provisioned\_throughput\_in\_mibps](#input\_provisioned\_throughput\_in\_mibps) | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with `throughput_mode` set to `provisioned` | `number` | `null` | no |
| <a name="input_replication_configuration_destination"></a> [replication\_configuration\_destination](#input\_replication\_configuration\_destination) | A destination configuration block | `any` | `{}` | no |
| <a name="input_security_group_description"></a> [security\_group\_description](#input\_security\_group\_description) | Security group description. Defaults to Managed by Terraform | `string` | `null` | no |
Expand Down
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ resource "aws_efs_file_system" "this" {
}
}

dynamic "protection" {
for_each = length(var.protection) > 0 ? [var.protection] : []
content {
replication_overwrite = try(protection.value.replication_overwrite, null)
}
}

tags = merge(
var.tags,
{ Name = var.name },
Expand Down Expand Up @@ -270,6 +277,7 @@ resource "aws_efs_replication_configuration" "this" {

content {
availability_zone_name = try(destination.value.availability_zone_name, null)
file_system_id = try(destination.value.file_system_id, null)
kms_key_id = try(destination.value.kms_key_id, null)
region = try(destination.value.region, null)
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ variable "lifecycle_policy" {
default = {}
}

variable "protection" {
description = "A map of file protection configurations"
type = any
default = {}
}

################################################################################
# File System Policy
################################################################################
Expand Down
1 change: 1 addition & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module "wrapper" {
override_policy_documents = try(each.value.override_policy_documents, var.defaults.override_policy_documents, [])
performance_mode = try(each.value.performance_mode, var.defaults.performance_mode, null)
policy_statements = try(each.value.policy_statements, var.defaults.policy_statements, [])
protection = try(each.value.protection, var.defaults.protection, {})
provisioned_throughput_in_mibps = try(each.value.provisioned_throughput_in_mibps, var.defaults.provisioned_throughput_in_mibps, null)
replication_configuration_destination = try(each.value.replication_configuration_destination, var.defaults.replication_configuration_destination, {})
security_group_description = try(each.value.security_group_description, var.defaults.security_group_description, null)
Expand Down