AWS Certified Developer - Associate
AWS Fundamentals
S3 Basics Demo
In this guide, you'll learn how to create and manage an Amazon S3 bucket using the AWS Management Console. We will cover accessing the S3 service, creating a bucket, uploading files, organizing objects, and deleting the bucket—all while exploring key S3 features.
Accessing the S3 Service
Begin by logging in to the AWS Management Console. In the search bar, type "S3" to locate and access the S3 service. This page allows you to manage your buckets. If you have not created any buckets yet, you'll see a prompt to create one; otherwise, a list of your existing buckets will be displayed.
Understanding S3’s Global Namespace
Amazon S3 uses a global namespace, meaning that all your buckets across regions are displayed together. The specific region for a bucket is selected only during creation, not in the overall management interface.
When you create your first bucket, you will be prompted to choose a specific AWS region.
Creating Your First Bucket
Click on the Create bucket button. You must provide a unique bucket name since bucket names in S3 are globally unique. For this demo, we’ll use "KK-demo-123". If you need more information on naming conventions, consult the AWS documentation.
Next, select your desired region, for example, US East 1. You can also copy settings from an existing bucket, but for this introduction, the default settings for object ownership and block public access are sufficient. Finally, click Create bucket.
After successfully creating the bucket, it will appear in your list along with details such as its region and creation date.
Click on the bucket name to access its details.
Exploring Bucket Contents and Properties
Once inside your bucket, you'll notice the Objects page where you can view or upload files—initially, this will be empty.
Switch to the Properties tab to review key configuration details, including:
- Region
- ARN (Amazon Resource Name)
- Bucket creation date
- Versioning status (disabled by default)
Other available settings include server access logging, CloudTrail data events, and static website hosting. In the Permissions tab, manage the access rules for your bucket. By default, the bucket is private and accessible only to you.
Additional metrics are available under the Metrics section, and advanced configurations like lifecycle policies, replication rules, inventory configurations, and access points can be found under Management.
Uploading Files to the Bucket
To add files, navigate back to the Objects page and click Upload. You can drag-and-drop files or use the file selection dialog.
Tip: When uploading, ensure that your files comply with S3’s naming conventions and that you understand the available storage class options. These options balance cost, access frequency, and redundancy.
For instance, you can upload a photo file, after which the file details such as size and type (e.g., JPEG) will be displayed.
During the upload, you can modify settings like versioning and permissions. If left unchanged, the file inherits the bucket’s default settings. S3 also offers multiple storage classes, which you can select based on your requirements.
After confirming the upload, a green check mark will appear to signal success. Click the file to view its detailed properties including:
- Region and file size
- Last modified date
- Unique URI and ARN
- Direct object URL
- Additional settings like object lock, storage class, and server-side encryption
Accessing Files: Authenticated vs. Public Users
When you click the file’s URL as a public (unauthenticated) user, you will see an access denied message:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>PYW004S2RAZJBVDC</RequestId>
<HostId>ibsVnlokTmiJkuXW/MjiamVADURSB1TvwBq2LKvw9e5u/RyLkNqAWF+xtbFDK[iu]</HostId>
</Error>
This occurs because, by default, S3 buckets and their content are private. If you access the file using the Open button in the S3 interface while authenticated, the URL will include your authentication credentials, granting access to the file.
Security Reminder: Always ensure that your S3 bucket permissions match your security requirements. Use authenticated access for sensitive data or adjust permissions if you need to allow public access for specific files.
Creating Folders and Organizing Files
Although Amazon S3 employs a flat storage structure without true folders, folder-like organization can be simulated using prefixes in object names.
Follow these steps to create a folder:
- Click Create folder.
- Name the folder (for example, "food").
- Open the newly created folder and upload additional files, such as high-resolution food images.
After creating the folder, both the original file and folder will be visible in your bucket. Files uploaded within the folder will have keys prefixed with the folder name (e.g., "food/burger.jpg").
Click Open on any file to access it with your authenticated user credentials.
Deleting Files and Moving Objects
To delete a file:
- Select the file.
- Click Delete.
- Confirm by typing "permanently delete".
Note: If versioning is disabled, the file will be permanently removed.
Moving files between folders is straightforward:
- Select the file.
- Choose Actions and then Move.
- Provide the full destination path by updating the object key prefix. For example, to move a file to a "test" folder, the key might change to S3://[bucket-name]/test/[file-name].
- Alternatively, you can use the browse feature to select the destination folder.
The system then updates the object's key to reflect the new folder prefix.
Deleting the Bucket
Before deleting a bucket, ensure that it is empty. An error will occur if you try to delete a bucket containing objects.
Steps to delete the bucket:
- Select the bucket and click Delete.
- If the bucket is not empty, click the option to empty it and confirm the action by typing "permanently delete".
- Once the bucket is empty, proceed to delete it by typing the bucket's name when prompted to confirm the deletion.
After these steps, the bucket will be deleted successfully.
This concludes our comprehensive introduction to managing Amazon S3 buckets. We explored how to create a bucket, upload and organize files, manage permissions, and safely delete buckets. For more details on S3 features and best practices, refer to the official Amazon S3 documentation.
Watch Video
Watch video content