1 Answer
- Newest
- Most votes
- Most comments
1
Hello.
You probably can't create Lightsail buckets with S3Client.
Lightsail buckets have an API for that.
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lightsail/command/CreateBucketCommand/
If you are uploading files, etc., you may be able to use S3Client.
It seems that creating a bucket uses the Lightsail API and uploading objects using the S3 API.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-uploading-files-to-a-bucket.html#uploading-files-to-a-bucket-aws-cli

In the case of a Lightsail bucket, uploading was not possible unless an access key and secret access key were issued. So, please follow the steps described in the document below to issue an access key, set it in your code, and run it. I ran the code below with Lambda and was able to upload the file to a Lightsail bucket. https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-creating-bucket-access-keys.html