Posts

Showing posts with the label S3

S3 - Create a static website

Image
 S3 - Create a static website Creating static website with S3 bucket is very easy. This will make not only your website fast but also hassle-free and cheap alternative to traditional hosting. Please read this post before going further -  https://www.learn-aws.com/2024/11/s3.html  Create a bucket and set the permissions.  Click on the bucket, and navigate to the "Properties" tab, scroll down you will see this option. Edit it like below. Create a simple index.html file like the one below and upload it with the files you used in index file. In this case "aws.png" is also uploaded into the bucket as well. <html> <title> Hello from AWS S3 </title> <body> <img src="aws.png" alt="AWS"> </body> </html>  If we do everything right, we will be able to see rendered html when we copy and paste the link in the index file's link in S3 service.

S3

Image
 S3 In AWS S3 storage is special kind of storage that provides flexibility that other kind of storage services don't provide. S3 is sitting internet facing subnet and if we want to access S3 bucket from our private subnet we need to either direct traffic over internet gateway or use S3 gateway endpoint service.  To access or upload files to S3 we must use REST API for that. This actually makes things easier because thanks to this we will be able to do all operations programmatically (via our favorite programming language). In block storage service we supposed to use operating system to perform all the tasks. There should be some kind of hierarchy. But in S3 files storage in "bucket"s. Hierarchy can be mimicked by prefixes.  Let's create bucket and access over internet Search S3 in the search bar  Create a bucket Name must be unique otherwise it will display an error. Use default settings. After that try to upload some files there. Click to that file you will see the ...

IAM - Policies

Image
AWS Policies AWS policies, as the name implies, allow you to set permissions to access your AWS resources. This is essential for controlling who can do what with your AWS services. There are two types of policies : Resource based policy (This can be applied to specific services (not all supports this) ) Identity based policy (This can be applied to users,groups and roles) Example Policy for Full Access to S3 Let's suppose we want to provide full access to the S3 resource. Here's an example policy: Version : The version number of the policy language. Statement : The key part of the policy. Each statement includes: Effect : Can be either Allow or Deny . Action : Specifies the actions that are allowed. The s3:* wildcard means all actions on Amazon S3 are allowed, including creating, listing, and deleting buckets, uploading and downloading objects, setting permissions, etc. Resource : Specifies the resources that the actions apply to. The * wildcard means all resources. In the...