This tutorial covers configuring an AWS S3 bucket for storing application images. It details setting up IAM credentials, updating NestJS backend code to use the AWS SDK, and adjusting Next.js frontend configurations to ensure images are publicly accessible, persisted, and successfully deployed to a production environment.
Length 16:12
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #aws #s3 #nestjs #nextjs #cloud storage #backend development #image upload #iam #deployment #elastic beanstalk
0:00 All right, so we now wanna be able to configure our 0:02 NestJS backend to 0:04 upload images to AWS S3. 0:07 So go ahead and enter in S3 0:10 here in AWS. So S3 is an 0:14 all-purpose storage solution in AWS's cloud that allows us 0:18 to store objects in the cloud, including files 0:22 like images for very low cost. We can see we already have two 0:26 buckets created here, one for CodePipeline and Elastic 0:30 Beanstalk. We wanna go ahead and create a new bucket to 0:34 host our product images. So go ahead and click on Create 0:38 new bucket, and I'll call this 0:40 shoppy-products. 0:44 Go ahead and scroll down to keep all these default 0:48 settings for object ownership. And then Block public access, we're 0:52 gonna deselect Block all public access because we do wanna allow 0:55 public access to this bucket since it's going to host our product 0:59 images, which we know are publicly accessible on the Internet. 1:03 So go ahead and uncheck this box, acknowledge this warning, and go 1:07 ahead and continue to scroll down to create this new bucket. 1:11 So with this bucket created, click inside of it 1:14 and click on Permissions. 1:16 And now scroll down to the bucket policy where you wanna go ahead and edit 1:20 this and enter in a new bucket policy. 1:23 So we need to define a custom policy in here in order for read access 1:27 to occur on our product images. All right, so I've gone ahead and 1:31 pasted in a bucket policy here that I'll include below in 1:35 the lecture notes. So here is a policy in 1:39 S3 to allow for public read access on our S3 1:43 bucket. So importantly, you need to go ahead and update this 1:46 resource key here to match your bucket. 1:49 So my case, my bucket name here is gonna be called 1:53 shoppy-products. Swap this out for
The rest of the transcript is for members.
Sign in