DEV Community

StuartCreed
StuartCreed

Posted on

List all of your buckets in Lambda

import {S3Client, ListBucketsCommand} from '@aws-sdk/client-s3';
const s3 = new S3Client({region: 'us-west-2'});

export const handler = async (event) => {
const data = await s3.send(new ListBucketsCommand({}));
return data.Buckets;
};

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay