Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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*
- Loading branch information