Repository navigation
Commit cbf130e
authored
feat(efs): allow to specify az for one-zone (#30010)
### Issue # (if applicable)
This PR allows users to specify AZ for the one-zone filesystems through the `vpcSubnets.availabilityZones`. Before this PR, `vpcSubnets` is not allowed when `oneZone` is enabled, this PR removes the restriction and takes the following use cases into considerations:
- [x] create a regional EFS file system with a mount target for each AZ
- [x] create a one-zone EFS file system with mount target at the auto-selected AZ
- [x] create a one-zone EFS file system at specified AZ with a single mount target at that AZ
- [x] create a regional EFS file system with a single mount target at the specified AZ
Closes #30005
### Reason for this change
### Description of changes
### Description of how you validated changes
1. Add additional unit tests.
2. I have deployed the code below and validated from my AWS console.
```ts
// create a regional EFS file system with a mount target for each AZ
new FileSystem(stack, 'FileSystem1', {
vpc,
});
// create a one-zone EFS file system with mount target at the auto-selected AZ
new FileSystem(stack, 'FileSystem2', {
vpc,
oneZone: true,
});
// create a one-zone EFS file system at specified AZ with a single mount target at that AZ
new FileSystem(stack, 'FileSystem3', {
vpc,
oneZone: true,
vpcSubnets: {
availabilityZones: [vpc.availabilityZones[1]],
},
});
// create a regional EFS file system with a single mount target at the specified AZ
new FileSystem(stack, 'FileSystem4', {
vpc,
vpcSubnets: {
availabilityZones: [vpc.availabilityZones[2]],
},
});
```
### 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*1 parent c389a8b commit cbf130e
11 files changed
Lines changed: 607 additions & 263 deletions
File tree
- packages
- @aws-cdk-testing/framework-integ/test/aws-efs/test
- integ.efs-filesystem-one-zone.js.snapshot
- asset.4554b47be6f57b68c6c7a7391dcc73894866d2377fe174883351e7639097f292
- asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1
- aws-cdk-lib/aws-efs
- lib
- test
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
592 | 675 | | |
593 | 676 | | |
594 | 677 | | |
| |||
0 commit comments