Skip to content

Commit

Permalink
feat(fsx): specify file system type version for the Lustre file system (
Browse files Browse the repository at this point in the history
#31136)

### Issue # (if applicable)

Closes #31130

### Reason for this change

We cannot specify Lustre version for the file system.

### Description of changes

Add `fileSystemTypeVersion` prop to `LustreFileSystemProps`.

There are some restrictions about `fileSystemTypeVersion`. 

- 2.10 is supported by the Scratch and Persistent_1 Lustre deployment types.
- 2.12 is supported by all Lustre deployment types, except for PERSISTENT_2 with a metadata configuration mode.
- 2.15 is supported by all Lustre deployment types and is recommended for all new file systems.

https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-fsx-filesystem.html#cfn-fsx-filesystem-filesystemtypeversion

I've only added validation of V2.10 is supported by the Scratch and Persistent_1 deployment types because `LustreFileSystemProps` does not have metadata configuration props.

```ts
  private validateFiileSystemTypeVersion(deploymentType: LustreDeploymentType, fileSystemTypeVersion?: FileSystemTypeVersion): void {
    if (fileSystemTypeVersion === undefined) {
      return;
    }

    if (fileSystemTypeVersion === FileSystemTypeVersion.V_2_10) {
      if (!deploymentType.startsWith('SCRATCH') && deploymentType !== LustreDeploymentType.PERSISTENT_1) {
        throw new Error('fileSystemTypeVersion V_2_10 is only supported for SCRATCH and PERSISTENT_1 deployment types');
      }
    }
  }
```

### Description of how you validated changes

 Add 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*
  • Loading branch information
badmintoncryer authored Oct 16, 2024
1 parent 799b541 commit 252cca9
Show file tree
Hide file tree
Showing 14 changed files with 2,335 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 252cca9

Please sign in to comment.