From the course: AWS for Developers: S3

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Bucket and file security

Bucket and file security - Amazon Web Services (AWS) Tutorial

From the course: AWS for Developers: S3

Start my 1-month free trial

Bucket and file security

Just like with python, there are lots of bucket and file security options. We will focus once again on blocking public access for these buckets as a way to show some of these features within the SDK. So, let's jump back into our application class, and once again we will create a new method, public void. blockPublicAccess. Start with the try block, we're going to use the putPublicAccessBlockRequest and once again when we use our builder we must send in our bucket. I'm going to expand this a little bit to make it easier to do this next section. We're then going to call PublicAccessBlockConfiguration, which is itself a builder, break this up just a little bit so it's easier to read. All right, so, we will go through and we will do all of these values. So blockPublicAcls. will be true. blockPublicPolicy. will be true. ignore will be true. and restrict. Will be true. So now that we've built our request,…

Contents