Skip to content

Commit 1dae082

Browse files
authored
feat: Support aws_efs_file_system.protection and aws_efs_replication_configuration.destination.file_system_id (#43)
1 parent 4c04785 commit 1dae082

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ No modules.
169169
| <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 |
170170
| <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 |
171171
| <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 |
172+
| <a name="input_protection"></a> [protection](#input\_protection) | A map of file protection configurations | `any` | `{}` | no |
172173
| <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 |
173174
| <a name="input_replication_configuration_destination"></a> [replication\_configuration\_destination](#input\_replication\_configuration\_destination) | A destination configuration block | `any` | `{}` | no |
174175
| <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 |

main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ resource "aws_efs_file_system" "this" {
2323
}
2424
}
2525

26+
dynamic "protection" {
27+
for_each = length(var.protection) > 0 ? [var.protection] : []
28+
content {
29+
replication_overwrite = try(protection.value.replication_overwrite, null)
30+
}
31+
}
32+
2633
tags = merge(
2734
var.tags,
2835
{ Name = var.name },
@@ -270,6 +277,7 @@ resource "aws_efs_replication_configuration" "this" {
270277

271278
content {
272279
availability_zone_name = try(destination.value.availability_zone_name, null)
280+
file_system_id = try(destination.value.file_system_id, null)
273281
kms_key_id = try(destination.value.kms_key_id, null)
274282
region = try(destination.value.region, null)
275283
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ variable "lifecycle_policy" {
6868
default = {}
6969
}
7070

71+
variable "protection" {
72+
description = "A map of file protection configurations"
73+
type = any
74+
default = {}
75+
}
76+
7177
################################################################################
7278
# File System Policy
7379
################################################################################

wrappers/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module "wrapper" {
2323
override_policy_documents = try(each.value.override_policy_documents, var.defaults.override_policy_documents, [])
2424
performance_mode = try(each.value.performance_mode, var.defaults.performance_mode, null)
2525
policy_statements = try(each.value.policy_statements, var.defaults.policy_statements, [])
26+
protection = try(each.value.protection, var.defaults.protection, {})
2627
provisioned_throughput_in_mibps = try(each.value.provisioned_throughput_in_mibps, var.defaults.provisioned_throughput_in_mibps, null)
2728
replication_configuration_destination = try(each.value.replication_configuration_destination, var.defaults.replication_configuration_destination, {})
2829
security_group_description = try(each.value.security_group_description, var.defaults.security_group_description, null)

0 commit comments

Comments
 (0)