I tried to create a S3 bucket(thisIsTestBucket190) via AWS SDK (Node) and came across Invalid bucket name exception.
{ InvalidBucketName: The specified bucket is not valid.
at Request.extractError (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/services/s3.js:577:35)
at Request.callListeners (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/Users/niro273/Desktop/data-lake/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
message: 'The specified bucket is not valid.',
code: 'InvalidBucketName',
region: null,
time: 2018-03-29T04:51:02.692Z,
requestId: '5D487CF96846EFE2',
extendedRequestId: '1TzPeOv4c7zq+H+GV5kFMFO3Y6awoS79VCuf4C7lUmy/IucNEfbINEfEIiNp/Esz7t38ckYZbrU=',
cfId: undefined,
statusCode: 400,
retryable: false,
retryDelay: 34.88207359966853 }
Would be great if I could know what is the root cause.
AWS provides naming standards when naming an aws bucket.
The bucket name can be between 3 and 63 characters long, and can contain only lower-case characters, numbers, periods, and dashes.
Each label in the bucket name must start with a lowercase letter or number.
The bucket name cannot contain underscores, end with a dash, have consecutive periods, or use dashes adjacent to periods.
The bucket name cannot be formatted as an IP address (198.51.100.24).
The name provided contains upper case letters, by switching to lower case letters the issue can be resolved.
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-s3-bucket-naming-requirements.html
It's all about name convention!
The bucket name can be between 3 and 63 characters long, and can contain only lower-case characters, numbers, periods, and dashes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With