Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFS: Create replication configuration #21455

Closed
2 tasks
Labels
@aws-cdk/aws-efs Related to Amazon Elastic File System feature-request A feature should be added or improved.

Comments

@ElmerReal-Triumph
Copy link

Describe the feature

By the moment the aws cdk doesn't offer support to create a replication rule for the EFS. It would be great have this functionality out of the box and don't need to run a lambda to create the replication rule.

Use Case

Create a replication configuration for EFS directly from the cdk code.

Proposed Solution

No response

Other Information

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.31.0

Environment details (OS name and version, etc.)

Python cdk

@ElmerReal-Triumph ElmerReal-Triumph added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2022
@ElmerReal-Triumph ElmerReal-Triumph changed the title EFS: Crea replication configuration EFS: Create replication configuration Aug 3, 2022
@github-actions github-actions bot added the @aws-cdk/aws-efs Related to Amazon Elastic File System label Aug 3, 2022
@corymhall
Copy link
Contributor

Looks like this is something that is not currently supported in CloudFormation. I've created an
issue on the cloudformation-coverage-roadmap

@corymhall corymhall added needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. and removed needs-triage This issue or PR still needs to be triaged. labels Aug 9, 2022
@corymhall corymhall removed their assignment Aug 9, 2022
@rdbatch
Copy link
Contributor

rdbatch commented Sep 26, 2023

It looks like this was now added to CloudFormation https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-efs-filesystem.html#cfn-efs-filesystem-replicationconfiguration. @corymhall could the needs-cfn tag be removed now? I believe this should be clear to implement at this point.

@gracelu0 gracelu0 removed the needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. label Apr 24, 2024
@mergify mergify bot closed this as completed in #29347 Apr 24, 2024
mergify bot pushed a commit that referenced this issue Apr 24, 2024
### Issue # (if applicable)

Closes #21455.

### Reason for this change

EFS supports [replicating file systems](https://docs.aws.amazon.com/efs/latest/ug/efs-replication.html) but AWS CDK cannot configure it.

### Description of changes

Add `replicationConfiguration` to `FileSystemProps`

```ts
declare const vpc: ec2.Vpc;
declare const kmsKey: kms.Key;

// auto generate a replication destination file system
new efs.FileSystem(this, 'ReplicationSourceFileSystem1', {
  vpc,
  replicationConfiguration: {
    kmsKey, // optional
    region: 'us-east-1', // optional
    availabilityZone: 'us-east-1a', // optional, Specifing the AZ means creating a One Zone file system as the replication destination
  }
});

// specify the replication destination file system
const destinationFileSystem = new efs.FileSystem(this, 'DestinationFileSystem', {
  vpc,
  // set as the read-only file system for use as a replication destination
  replicationOverwriteProtection: efs.ReplicationOverwriteProtection.DISABLED,
});

new efs.FileSystem(this, 'ReplicationSourceFileSystem2', {
  vpc,
  replicationConfiguration: {
    destinationFileSystem,
    // cannot configure other properties when destinationFileSystem is specified
  }
});
```

### Description of how you validated changes

I have added both unit and integ tests.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment