1

How do I use EFS block replication for disaster recovery when the replica volume is unknown to terraform? After breaking the replication/mirror I need to import the volume into the plan so it can become the new main with it's own replica.

This seems really cumbersome. Is this really the best way for a DR scenario?

Use case We have a Jenkins using an EFS volume and presently use datasync tasks to migrate data to the DR region. However, datasync tasks are like rsync and sluggish as they walk the tree processing files. Whereas, EFS replication is block based and much faster.

  1. terraform creates region A volume + access and replication in region B + access
  2. At some point region A goes down
  3. We delete the replication from A -> B transforming region B EFS volume to writable and our primary volume
  4. We create a replication from this volume back to region A
  5. Allow sync
  6. Delete replication making region A replica the main volume

Terraform sync issues After step 3 we've got a main volume in region B that terraform would need to know about as terraform should be making the replica in region A

After step 6 we've got the same problem in region A

Questions

  • Can someone point to a good example of an automated end of end process?
  • Is this a case of "import the infra into tf state" as an automated part of the DR process?

1 Answer 1

0

Reading your usecase it seem that the solutions your are looking for is the refresh state of terraform

Allowing you to refresh your state from the current architecture running without applying any diff

1
  • thanks for that. However, I'd also need to import the replica volume as while TF told EFS to make a replica, the replica and its access point are not the main volume which is listed in the tf state. That volume will be destroyed and then the replica will take its place
    – Peter Kahn
    Commented Nov 2, 2023 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.