1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import process from "node:process";
export const uploadTextToS3 = (async () => {
const { S3Client } = await import(
"https://deno.land/x/s3_lite_client@0.6.1/mod.ts"
);
const s3client = new S3Client({
endPoint: "s3.amazonaws.com",
region: process.env.awsS3Region,
bucket: process.env.awsS3Bucket,
accessKey: process.env.awsS3Key,
secretKey: process.env.awsS3Secret,
});
return await s3client.putObject("filename.txt", "File contents");
})();