Check bucket name length at CreateBucket
Check that s3 bucket names follow the documented length restriction: 'Bucket names must be at least 3 and no more than 63 characters long.' See https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
This commit is contained in:
parent
ed861ecae1
commit
fb7e52becc
3 changed files with 31 additions and 2 deletions
|
|
@ -178,3 +178,13 @@ class InvalidStorageClass(S3ClientError):
|
|||
"InvalidStorageClass",
|
||||
"The storage class you specified is not valid",
|
||||
*args, **kwargs)
|
||||
|
||||
|
||||
class InvalidBucketName(S3ClientError):
|
||||
code = 400
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(InvalidBucketName, self).__init__(
|
||||
"InvalidBucketName",
|
||||
"The specified bucket is not valid.",
|
||||
*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue