Skip to main content

EFS Backup Policy

πŸ“¦ Overview​

This Terraform module provisions an AWS Backup policy targeting an existing EFS file system. It includes:

A dedicated Backup Vault, a scheduled Backup Plan, and a backup selection targeting your specified EFS file systemβ€”all built to enforce reliable, automated backup routines.


βœ… Key Features​

  • Creates a dedicated AWS Backup Vault for EFS snapshots
  • Defines a scheduled Backup Plan with recurring backup rules
  • Links an existing EFS file system via a Backup Selection
  • Adds environment and name tags for organization and filtering

πŸ’Ό Use Cases​

  • Enabling automated daily backups for critical shared storage
  • Supporting disaster recovery policies for EFS-backed workloads
  • Enforcing routine data protection for compliance-driven environments
  • Modular backup control without altering existing EFS configs

πŸ“₯ Input Variables​

NameTypeDescription
regionstringAWS region where backups should be managed
efs_file_system_idstringThe ID of the existing EFS file system to back up
environmentstringTag to specify the deployment environment (e.g., dev, staging, prod)
namestringA name prefix for identifying the vault and plan

πŸ“€ Outputs​

NameDescription
backup_vault_nameThe name of the created Backup Vault
backup_plan_idThe ID of the scheduled Backup Plan
efs_backup_selection_idThe resource linking the backup plan to the EFS file system

πŸš€ Deployment Readiness​

  • βœ… Compatible with Terraform 1.0+
  • βœ… Tested with AWS provider 5.x
  • πŸ§ͺ Requires existing EFS filesystem and IAM permissions for AWS Backup

πŸ› οΈ Example Usage​

module "efs_backup_policy" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//storage/efs-backup-policy?ref=v1.0.0"

region = "us-east-1"
efs_file_system_id = "fs-12345678"
environment = "dev"
name = "efs-backup"
}
terraform init
terraform plan
terraform apply

or

tofu init
tofu plan
tofu apply

🧹 Cleanup Options​

Terraform Destroy (for test environments):

terraform destroy

or

tofu destroy

Manual Cleanup (recommended for production):

Delete the Backup Plan, Vault, and Selection via AWS Console or CLI Ensure no other systems are using shared backup configurations

πŸ›‘οΈ Notes​

This is a Level 1 baseline module designed for modular use. It complements any EFS setup by adding automated backup protection.

For advanced backup tiering, cross-region replication, or custom lifecycle rules, compose this into a Level 2 module.

πŸ”’ Deployment Package Notice​

This module is part of the Level 1 AWS License Tier. To access the full deployment package and source code, subscribe to Archiphire.