CreateAnalyticsBucketForm.utils.ts14 lines · main
| 1 | /** |
| 2 | * Rules: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html?i |
| 3 | * Bucket names must be between 3 and 63 characters long. |
| 4 | * Bucket names can consist only of lowercase letters, numbers, and hyphens (-). |
| 5 | * Bucket names must begin and end with a letter or number. |
| 6 | * Bucket names must not contain any underscores (_) or periods (.). |
| 7 | * Bucket names must not start with any of the following reserved prefixes: |
| 8 | xn--, sthree-, amzn-s3-demo-, aws |
| 9 | * Bucket names must not end with any of the following reserved suffixes: |
| 10 | -s3alias, --ol-s3, --x-s3, --table-s3 |
| 11 | */ |
| 12 | export const reservedPrefixes = /^(?:xn--|sthree-|amzn-s3-demo-|aws)/ |
| 13 | export const reservedSuffixes = /(?:-s3alias|--ol-s3|--x-s3|--table-s3)$/ |
| 14 | export const validBucketNameRegex = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/ |