Create S3 bucket
AWS provides a wonderful file storage service called S3. It offers scalability, data availability, security. And all this at a relatively low cost. In this article, we will look at how to create and configure a bucket in the AWS console.
Go to the AWS Management Console and open the S3 console in your region, for example eu-central-1. In the Create menu, enter a bucket name and select the ownership options. You probably won't need to select the ACLs enabled option unless you have a specific need. Possible case: configuring access to the bucket for different teams under each of their own accounts in your company.
Leave the Block all public acces setting enabled. You will customize access to bucket items later. You can enable or disable versioning, the choice is yours. It is good practice to enable it so that you can restore a previous version of a file if needed. But obviously this will take up more space in the bucket.
Set a tag if you want to. This will help organize projects and better manage storage costs, but is not very important. For Encryption type, just leave the default value unless you have special needs. As for Object lock, if you need to secure items from deletion and modification, you can enable it. You can set a retention period for each item in the bucket. But this is usually not required for a regular projects.
Now that you have created the bucket, you may want to set some access policies. For example, you may want to make some files in the bucket public so that everyone can access them. Let's create some folders to make one of them public.
Upload a file into public folder
Now select the file in the console, find its url and try to click on the link. You will see that it is inaccessible. This is because the bucket is private by default.
It's time to make the folder public. Go to the bucket permissions
Disable Block all public access
And edit the bucket policy
Modify the statements manually or use the sidebar menu
Now go back to the shared folder and try to access the file again. Oh boy, success! ๐บ The file is now accessible.
Now all files in the public/ folder can be accessed by anyone. But files in the private/ folder are still private.
Hope you found this article helpful. Stay tuned for more articles on AWS services. ๐