Configuring replication to an existing EFS file system - Amazon Elastic File System

Configuring replication to an existing EFS file system

Amazon EFS replicates the data and metadata on the source file system to the destination file system and AWS Region that you choose. During replication, Amazon EFS identifies data differences between the file systems and applies the differences to the destination file system.

To replicate to an existing, perform the following steps.

Note

A file system can be part of only one replication configuration. You cannot use a destination file system as the source file system in another replication configuration.

Step 1: Disable the file system's replication overwrite protection

When you create an Amazon EFS file system, its replication overwrite protection is enabled by default. Replication overwrite protection prevents the file system from being used as the destination in a replication configuration. Before you can use the file system as the destination in a replication configuration, you must disable the protection. If you delete the replication configuration, the file system's replication overwrite protection is re-enabled and the file system becomes writeable.

The status of the replication overwrite protection for an Amazon EFS file system can have one of the values described in the following table.

File system state Description
ENABLED The file system cannot be used as the destination file system in a replication configuration. The file system is writeable. Replication overwrite protection is ENABLED by default.
DISABLED The file system can be used as the destination file system in a replication configuration.
REPLICATING The file system is being used as the destination file system in a replication configuration. The file system is read-only and is only modified only by Amazon EFS during replication.

Required permission

Disabling replication overwrite protection requires permissions for the elasticfilesystem:UpdateFileSystemProtection action. For more information, see AWS managed policy: AmazonElasticFileSystemFullAccess.

  1. Sign in to the AWS Management Console and open the Amazon EFS console at https://console.aws.amazon.com/efs/.

  2. In the left navigation pane, choose File systems.

  3. In the File systems list, choose the Amazon EFS file system that you want to use as the destination file system in a replication configuration.

  4. In the File system protection section, turn off Replication Overwrite Protection.

Step 2: Create the replication configuration

If the source file system is encrypted, then the destination file system must also be encrypted. Additionally, if the source file is unencrypted and the destination file system is encrypted, then you cannot fail back to the source destination after performing failover. For more information about encryption, see Encrypting data in Amazon EFS.

  1. Sign in to the AWS Management Console and open the Amazon EFS console at https://console.aws.amazon.com/efs/.

  2. Open the file system that you want to replicate:

    1. In the left navigation pane, choose File systems.

    2. In the File systems list, choose the Amazon EFS file system that you want to replicate. The file system that you choose cannot be a source or destination file system in an existing replication configuration.

  3. Choose the Replication tab.

  4. In the Replication section, choose Create replication.

  5. For Replication configuration, choose existing file system.

  6. Choose Browse EFS, and then select the file system. The path to your destination file system appears in the Destination box.

  7. If replication overwrite protection is enabled on the file system, then a warning displays. Choose Disable protection to open the file system in a new tab and turn off its Replication overwrite protection. After disabling the protection, return to the Create replication tab and click the Refresh button to clear the message.

  8. Choose Create replication, type confirm in the confirmation message input box, and then choose Create replication.

  9. The Replication section shows the replication details.

  10. To see the destination file system's configuration, choose the file system ID above Destination file system.

This section provides examples for creating a replication configuration in the AWS CLI using the create-replication-configuration command. The equivalent API command is CreateReplicationConfiguration.

Example : Create a replication configuration for a Regional destination file system

The following example creates a replication configuration for the file system fs-0123456789abcdef1. The example uses the Region parameter to create a destination file system in the eu-west-2 AWS Region. The KmsKeyId parameter specifies the KMS key ID to use when encrypting the destination file system:

aws efs create-replication-configuration \ --source-file-system-id fs-0123456789abcdef1 \ --destinations "[{\"Region\":\"eu-west-2\", \"KmsKeyId\":\"arn:aws:kms:us-east-2:111122223333:key\/abcd1234-ef56-ab78-cd90-1111abcd2222\"}]"

The AWS CLI responds as follows:

{ "SourceFileSystemArn": "arn:aws:elasticfilesystem:us-east-1:111122223333:file-system/fs-0123456789abcdef1", "SourceFileSystemRegion": "us-east-1", "Destinations": [ { "Status": "ENABLING", "FileSystemId": "fs-0123456789abcde22", "Region": "eu-west-2" } ], "SourceFileSystemId": "fs-0123456789abcdef1", "CreationTime": 1641491892.0, "OriginalSourceFileSystemArn": "arn:aws:elasticfilesystem:us-east-1:111122223333:file-system/fs-0123456789abcdef1" }
Example : Create a replication configuration for a One Zone destination file system

The following example creates a replication configuration for the file system fs-0123456789abcdef1. The example uses the AvailabilityZoneName parameter to create a One Zone destination file system in the us-west-2a Availability Zone. Because no KMS key is specified, the destination file system is encrypted using the account's default AWS KMS service key (aws/elasticfilesystem).

aws efs create-replication-configuration \ --source-file-system-id fs-0123456789abcdef1 \ --destinations AvailabilityZoneName=us-west-2a