🌥️A Deep Dive into AWS S3's Storage Wizardry 🧙‍♂️

🌥️A Deep Dive into AWS S3's Storage Wizardry 🧙‍♂️

What is Amazon S3?

Amazon S3 is a cloud service offered by Amazon. S3 means Simple Storage Service. Amazon occupies 32% of the market share for cloud services. Currently, it is a primary service provider. A storage facility is made available through a web interface. It can be ideally used by developers to develop, deploy, and test their software applications in AWS environments. It guarantees 99.9999 % durability, scalability, and availability of objects.

Amazon S3 is a system used to stores files up to terabytes in size. This feature will ensure that we have our data available anywhere and anytime without any errors.

Benefits of using AWS S3

  • It can store an infinite size of data.

  • It is less expensive, and it only costs as per usage.

  • It will provide efficient service without affecting the customer experience.

  • The applications can easily be scaled and available on the AWS S3 cloud environment.

  • Data is safe and secure when stored in AWS S3.

  • It provides flexibility and effortless transfer of data.

Buckets and Objects in AWS

Objects are the essential component that is stored in the Amazon S3. It is made up of object data and metadata.

objects and meta data

Amazon S3 cannot see the object data. Meta-data is a combination of name and value pair that is used to describe the object.

Buckets are used to store these objects in S3. Within a bucket, an object is recognized by a key name and version id. Every object is identified by combining bucket no, key name, and version id.

Steps to create an AWS S3 bucket

  1. AWS Management Console is used for the Amazon S3 login.

  2. Go to the AWS S3 console at https://console.aws.amazon.com/s3.

  3. Click on the tab Create bucket.

create bucket

  1. Enter the name of the Bucket. The name of the Bucket cannot be changed at a later time.

The following things need to be kept in mind while creating one.

  • The minimum length is three, while the maximum size of the bucket name is 63.

  • It should be unique across all AWS S3.

  • It should start with a lowercase letter or a number. It cannot contain an uppercase character.

  1. Under the Region field, enter the location of the AWS S3 server. An object created in a particular region remains the same until you transfer it to some desired region.

  2. Block Public Access is a setting in Bucket. This is used to provide public access to the Bucket for all the access points. By default, the buckets are not accessible by the public. But if needed, you can turn off any setting if you wish to host a public website.

  3. S3 object lock settings are an option available in Advanced Settings. It is used to lock the S3 objects for protection. Once it is enabled, it can’t be disabled during the lifecycle of the object.

  4. Click Create Bucket to finish the process.

  5. Once the Bucket is created, you may add files to this Bucket. Click the Upload button, and select the file you wish to upload.

steps to delete s3 buckets

Steps to delete an S3 bucket

  1. Log in to AWS Management Console.

  2. Go to the AWS S3 console at https://console.aws.amazon.com/s3.

  3. Select the bucket name you wish to delete.

  4. Click the Delete button at the top of the page.

delete bucket

  1. The next Delete page will confirm the bucket name by asking you to enter the same in the text box. Once you confirm, it will delete the bucket.

Once a bucket is deleted, all the objects within the bucket are also deleted. Once the bucket is deleted, the bucket name is now available for other AWS S3 users.

If you have configured a static website on Amazon 53 Router using the bucket, you need to clean the settings on Amazon53 Router for that bucket.

AWS S3 logs are used to track the permission for accessing the bucket. It contains the details about the request made that includes the requester, name of the bucket, time of the request made, the response status received, and error code in case of any failure.

We can also create and manage buckets and objects in Amazon S3 using the S3 browser. S3 browser is the Windows client available for free. This makes storing and accessing any data on the web more accessible.

Bucket Permission Options

With AWS S3 or Simple Storage Service, you may store and retrieve data on the cloud with a flexible and popular object storage solution. Amazon offers a variety of bucket permission options to help you maintain security and control over access to your S3 objects and buckets. Using these choices, you can specify who has access to, control over, and ability to modify your data within S3. We will go over the main AWS S3 bucket permission choices in depth.

  1. Bucket Policies:

A JSON document is a bucket policy that defines permissions at the bucket level. It outlines which AWS accounts or users are permitted to carry out particular operations on the bucket and the objects included. In most cases, bucket policies are utilized to give access between accounts or exercise fine-grained control over rights.

For instance, you can design a bucket policy to provide read-only access to a particular group of users, or you can make sure files associated with a website are accessible to the general public.

2. Access Control Lists (ACLs):

ACLs are an additional management tool for controlling who can access S3 buckets and objects. Unlike bucket policies, their approach is less flexible and more coarse-grained. You can determine who is permitted to access a bucket or object and their access level (such as read-only, read-write, or full control) using ACLs. Depending on the context, ACLs may be applied at either the bucket or object level.

However, bucket policies are often suggested over ACLs since they give more extensive control and are easier to handle than ACLs.

3. IAM (Identity and Access Management) Policies:

Access to Amazon Web Services and Resources, such as S3, can be managed through the use of IAM Policies. You can affix IAM policies to IAM users, groups, or roles. These policies govern the actions a user or role can carry out on S3 buckets and objects. IAM policies are preferable for managing access on a user or role-by-role basis because of their greater flexibility.

IAM rules can be quite granular, enabling you to establish fine-grained permissions for individuals or groups. This makes IAM policies extremely useful for use in access control because they can be applied to a wide variety of scenarios.

4. Block Public Access:

Using the “Block Public Access” settings in AWS S3, you may add an extra layer of security to your account to prevent the inadvertent disclosure of your data to the general public. You can define rules that will prohibit public access at both the bucket and account levels using this functionality. It helps to prevent data breaches that are caused by permissions being misconfigured.

The following options can be found under the Block Public Access section:

  • Put a stop to any public access to objects and buckets.
  • Create new access control lists (ACLs) to prevent unauthorized users from accessing objects and buckets.
  • By implementing new bucket regulations, you can prevent the general public from accessing buckets and their contents.
  • Using any method, you should prevent anyone from accessing other accounts’ buckets or objects.
  • By putting these settings into effect, you can reduce the risk of inadvertently disclosing sensitive information to the general .

5.Versioning:
Versioning in S3 is a powerful tool for maintaining data integrity and limiting access, even though it is not a direct mechanism for controlling access control. When versioning is turned on, a new version of the thing is produced each time a change is made to an object. You can manage and control access to particular object versions, which allows you to recover data that was deleted or overwritten inadvertently.

In short, AWS S3 provides a variety of bucket permission choices so you can manage access and safeguard your information. ACLs offer more straightforward access control options, but bucket policies give you more flexible control over who can operate on your bucket. With IAM policies, you may control access at the user or role level, and “Block Public Access” settings help keep information from accidentally becoming public. Web applications need CORS to regulate cross-origin access, and versioning helps preserve data integrity and retrieve earlier iterations of objects. Knowing them, you may use these options to secure your S3 buckets and objects to your unique needs.

6. Cross-Origin Resource Sharing (CORS):
CORS is a protocol used to manage rights for web applications to access resources located in a separate domain. Even though it is not a security feature in the conventional sense, it is essential when it comes to web apps’ access to your S3 buckets through browsers. Cross-origin access to your data may be controlled by configuring CORS rules. These rules allow you to designate which domains are allowed to make requests to your S3 services.

How do Amazon S3 works?

We have already seen in the example above that the user needs first to create an S3 bucket. Whenever the bucket is created, files or objects to be stored can easily be uploaded using the Upload option. Once the file is uploaded, we need to find which S3 storage class needs to be used for that bucket.

S3 object classes are configured at the level of an object. So any bucket can contain objects stored across different storage classes. S3 lifecycle policies can be used to move the objects among other storage classes without making any changes in the application.

How does Amazon S3 Function?

1.Bucket

Buckets are the containers that are used for the storage of data in S3. Each bucket will be responsible for implementing its own individual policies and configurations. Users will have increased control over their own data due to this. Names given to buckets have to be original. One may consider it the “parent” folder of the data. A maximum of 100 buckets can be used with each AWS account. However, if you contact AWS support and make a request, they can make the limit higher.

2. Objects

A fundamental entity type that is kept in Amazon S3 storage. You can store an unlimited number of things in this space. The maximum capacity of an Amazon S3 bucket is 5 terabytes of storage space. The following elements are:

  • Version ID.

  • Value

  • Metadata

  • Access control information.

  • Tags

  • Subresources

  • Key

3. S3 Versioning

When you use versioning, you ensure that a record of previously uploaded files is always kept in S3. It is not the default setting to enable points to versioning. When it is allowed for one object in a bucket, it is enabled for all the objects in that bucket. Because versioning preserves all copies of your file, the expense of storing numerous copies of your data will increase. For instance, if you make 10 copies of a file that is 1 gigabyte in size, you will be charged for using 10 gigabytes of S3 space. The use of versioning is essential in avoiding accidental overwrites and data deletions. If versioning is turned on, then objects with the same key can be kept in a bucket (since each version of the object has a distinct version ID).

4. Bucket Policy

An access policy document is a document that regulates which services and users have what kind of access to your S3 bucket and may be used for confirming access to S3 buckets from within your AWS account. Bucket policies are specific to each bucket.

5. Access Control Lists (ACLs)

A document that can be used to validate access to S3 buckets from locations other than your AWS account. Each bucket has its own unique Access Control List (ACL). S3 Object Ownership is a feature exclusive to Amazon S3 buckets that allows you to govern who owns the things you upload to your bucket and turn access control lists on or off.

  1. Lifecycle Regulations

This cost-saving technique allows you to either fully erase the data after the designated period or migrate your files to another S3 storage class or AWS Glacier (The AWS Data Archive Service) for less expensive storage of outdated data.

  1. Key

A key in S3 is a unique identifier that can be assigned to an object stored in a bucket. For instance, if the location of your GFG.java file in the bucket ‘ABC’ is java Programs/GFG.java, then ‘java Programs/GFG.java’ is the object key for your GFG.java file.

  1. Null Object

When versioning is suspended, the version ID of an object in a bucket is null. We can call these things null objects.

Features of AWS S3

  • Permission to host website: A customer can easily host their AWS S3 and map to their domain. This saves expenses as the customer only pays for what resources they have used. The customer also need not have servers with high configuration to provide services to their website.

  • Reliability: Amazon storage S3 assures 99.99% reliable uptime of servers. So customers can be assured that their data is reliable too.

  • Scalability: Any AWS S3 storage user can store any size of data n AWS S3 servers. Now the customer needs to pay only for the services used. There is no separate S3 storage cost.

  • Security: Any Amazon S3 customer can enter the console after proper authentication. Only after clearing this authentication step, the customer has the privilege to alter any data. It also provides the privilege to give necessary permissions to create, delete, and update the data stored as objects in a bucket.

  • Interfaces for web framework: REST and SOAP are the standard interfaces available for the AWS S3 web framework.

  • Tracking of torrents and seeding: Amazon S3 follows the torrent and seeds the file in the system.

  • Generating a temporary URL: A temporary URL is created for Amazon S3 storage users. This can be shared with other people giving them limited-time access. After this, the user can access the data using the URL.

  • Logging: Amazon S3 gives the facility to logging to perform activities on the bucket. Using this feature, you can audit the activities of the bucket.

  • Versioning: AWS S3 storage users can maintain older records of objects. This helps us in saving from any data loss that has happened unintentionally.

  • Integration: AWS S3 can be integrated with services like Amazon EBS, Amazon EC2, etc. AWS S3 storage is generally used to store files of the type images, documents, videos. It can also be accessed using HTTP get.

Â