'how to set exportpath to "same as original path" in fsx for lustre cloudformation

I'm trying to configure an fsx for lustre file system using cloudformation. If creating it using the GUI, I can set "write objects back to the original path" which ensures that updates performed in the fsx file system will be written back to s3 when running the "lfs hsm_archive" command.

However, with cloudformation I'm struggling to get the paths right.

If I configure my file system like this:

  filesystemD9154EF3:
    Type: AWS::FSx::FileSystem
    Properties:
      FileSystemType: LUSTRE
      SubnetIds:
        - subnet-abc
      LustreConfiguration:
        AutoImportPolicy: NEW_CHANGED_DELETED
        DataCompressionType: LZ4
        DeploymentType: SCRATCH_2
        ExportPath: s3://awesomebucket/v2
        ImportPath: s3://awesomebucket/v2

any files will be written back to the path s3://awesomebucket/v2/v2/newfile.txt. I'm at a loss of how to get this right, the only way I've gotten it to work is to use the entire bucket (use s3://awesomebucket/ as both exportpath and importpath) but I don't want to do that.

Any hints appreciated, I'm quite stuck!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source