getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.6k stars 2.03k forks source link

[FSx] Update file system id generation to expected regex #8149

Closed rpmcginty closed 2 days ago

rpmcginty commented 4 days ago

This change intends to address https://github.com/getmoto/moto/issues/8148

Modifies how fsx fs id is generated so that:

bblommers commented 3 days ago

Hi @rpmcginty, thanks for raising a PR here.

Do you know what AWS actually uses as the length of this identifier? The documentation is a bit confused:

FileSystemId

The system-generated, unique 17-digit ID of the file system.

Type: String

Length Constraints: Minimum length of 11. Maximum length of 21.

Pattern: ^(fs-[0-9a-f]{8,})$

Required: No

Based on this I can't tell whether it's supposed to 8, 17, or anything between 11 and 21.

codecov[bot] commented 3 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.50%. Comparing base (d8da0ac) to head (6c76aac). Report is 11 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8149 +/- ## ======================================= Coverage 94.50% 94.50% ======================================= Files 1150 1150 Lines 99191 99203 +12 ======================================= + Hits 93736 93752 +16 + Misses 5455 5451 -4 ``` | [Flag](https://app.codecov.io/gh/getmoto/moto/pull/8149/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | Coverage Δ | | |---|---|---| | [servertests](https://app.codecov.io/gh/getmoto/moto/pull/8149/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `28.79% <0.00%> (+<0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/getmoto/moto/pull/8149/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `94.47% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rpmcginty commented 3 days ago

Hi @rpmcginty, thanks for raising a PR here.

Do you know what AWS actually uses as the length of this identifier? The documentation is a bit confused:

FileSystemId

The system-generated, unique 17-digit ID of the file system.

Type: String

Length Constraints: Minimum length of 11. Maximum length of 21.

Pattern: ^(fs-[0-9a-f]{8,})$

Required: No

Based on this I can't tell whether it's supposed to 8, 17, or anything between 11 and 21.

yeah it is a bit confusing I suppose. The character count does include the "fs-" so I think the minimum is in fact 11 characters (not 8). Having dealt with fsx ids I have only seen 17 characters so I can update it if you would like me to.