Reader small image

You're reading from  AWS Certified Developer - Associate Guide - Second Edition

Product typeBook
Published inJun 2019
PublisherPackt
ISBN-139781789617313
Edition2nd Edition
Tools
Right arrow
Authors (2):
Vipul Tankariya
Vipul Tankariya
author image
Vipul Tankariya

Vipul Tankariya has a broad range of experience in cloud consulting, development, and training. He has worked with a number of customers across the globe, solving real-life business problems in terms of technology and strategy. He is also a public speaker at various AWS events and meetups. He has not only extensively worked on AWS, but is also certified in five AWS certifications. He is an accomplished senior cloud consultant and technologist with more than 21 years of experience. He is focused on strategic thought leadership concentrated around next-generation cloud-based solutions. He has a lot of experience in working on DevOps, CI/CD, and automation at each level of the delivery lifecycle of products, solutions, and services on the cloud.
Read more about Vipul Tankariya

Bhavin Parmar
Bhavin Parmar
author image
Bhavin Parmar

Bhavin Parmar has a broad range of experience in cloud consulting, development, and training. He actively participates in solving real-life business problems. He has not only extensively worked on AWS, but he is also certified in AWS and Red Hat. This book combines his AWS experience in solving real-life business problems with his hands-on deployment and development experience. Bhavin is an accomplished technologist and senior cloud consultant with more than 11 years of experience. He is focused on strategic thought leadership concentrated around next-generation cloud-based and DevOps solutions. He has also been instrumental in setting up cloud migration strategies for customers, building enterprise-class cloud solutions, and AWS training.
Read more about Bhavin Parmar

View More author details
Right arrow

Simple Storage Service, Glacier, and CloudFront

Before we describe what Amazon S3 is, let's look at some basic concepts of storage. Storage services are usually categorized based on how they work and how they are used. Specifically, there are three broad types of storage services—block storage, file storage, and object storage:

  • Block storage: In simple terms, block storage is a type of storage that is not physically attached to a server, but is accessed as a local storage device, just like a hard disk drive. At the backend, the storage service provider creates a cluster of disks, divided into a number of storage blocks. Each block is virtually connected to a server and treated as local storage. The server OS manages the block of storage assigned to it. For example, AWS EBS is a block storage type. When you provision a 100 GB EBS volume, a block of 100 GB is assigned...

Introducing Amazon S3

S3 is a cloud-based object storage service from Amazon. It is highly scalable and makes it easy to access storage over the internet. You can use S3 for storing and retrieving virtually unlimited amounts of data, at any time, from anywhere. It provides you with access to a highly scalable, reliable, efficient, and low-cost storage infrastructure that is used by Amazon to run its own global network of websites.

S3 is recommended for storing static content such as graphics files, documents, log files, audio, video, and compressed files. Virtually any type of data in any file format can be stored on S3. Currently, the permissible object size in S3 is 0 bytes to 5 TB. Objects in S3 are stored in a bucket. A bucket is a logical unit in S3 that is just like a folder. Buckets are created at the root level in S3 with a globally unique name. You can store objects,...

Creating a bucket

The following steps describe the process of creating a bucket using the AWS Management Console:

  1. Sign in to your AWS account and go to the S3 console, or visit https://console.aws.amazon.com/s3/. If you already have buckets in the account, this will display a list of the buckets; otherwise, you will see the following screenshot, stating that you do not have any buckets and how you can get started using S3:
Figure 8.2: S3 console
  1. Click on the + Create bucket icon, displayed in the following screenshot:
Figure 8.3: Create bucket
  1. Clicking on the + Create bucket button will display a popup, as shown in the following screenshot. Enter a DNS-compliant bucket name. The bucket name field must be unique across all existing bucket names in S3. Since S3 is a shared service, it is likely that you will not always get the bucket name you want, as it might have been taken...

Understanding objects

Objects are the basic entities stored in S3. Amazon has designed S3 as a simple key value store. You can store a virtually unlimited number of objects in S3. You can segregate objects by storing them in one or more buckets.

Objects consist of a number of elements, that is, a key, a version ID, a value, metadata, subresources, and access control information. Let's look at these object elements:

  • Key: The key is the name that is assigned to an object. It's just like a filename and can be used to access or retrieve the object.
  • Version ID: If you enable versioning on a bucket, S3 associates a version ID with each object. The bucket may have one or more objects with the same key, but a different version ID. The version ID helps in uniquely identifying an object when there are multiple objects with the same key.
  • Value: The value refers to the content...

S3 storage classes

Amazon S3 provides a number of storage classes for different storage needs. Storage classes are divided into the following five main types, based on how they are used:

  • S3 Standard storage
  • S3 Infrequently Accessed (IA)
  • S3 One Zone-IA storage
  • S3 Reduced Redundancy Storage (RRS)
  • S3 Intelligent-Tiering
  • Glacier

S3 Standard storage

S3 Standard storage is used as general-purpose storage for frequently accessed data. It provides high availability, durability, and high-performance storage for frequently accessed data. S3 Standard storage can be used in content distribution, cloud applications, big data analytics, mobile or gaming applications, and dynamic websites.

The key features of S3 Standard storage are as...

Life cycle management

Life cycle management is a mechanism in S3 that enables you to either automatically transition an object from one storage class to another storage class, or automatically delete an object, based on configuration. Life cycle rules can be applied to a group of objects based on filter criteria set in the rule.

S3 allows you to configure one or more life cycle rules, in which each rule defines a specific action. There are two types of actions that you can define in life cycle rules:

  • Transition actions: This defines when an object storage class changes from an existing storage class to a target storage class. For example, you can define a rule for all object keys starting with data/ in a bucket to transition from Standard storage to STANDARD_IA after 15 days. Similarly, you can define a rule to transition for all object keys starting with data/ from STANDARD_IA...

Hosting a static website on S3

Amazon S3 allows you to host a static website. A static website can contain web pages with static content, as well as client-side scripts. S3 does not support server-side scripting, and because of this, you cannot host a site with any server-side scripting, such as PHP, JSP, and ASP.NET. You can host HTML pages, CSS, client-side scripts such as JavaScript, and so on.

Here's a step-by-step process to enable static website hosting on an S3 bucket:

  1. Sign in to your AWS console and go to the S3 console at https://console.aws.amazon.com/s3.
  2. Click on the bucket in which you want to enable static website hosting.
  3. Click on the Properties tab, as shown in the following screenshot:
Figure 8.21: Bucket properties tab
  1. Click on Static website hosting, as shown in the following screenshot:
Figure 8.22: Enabling static website hosting
  1. Specify index and...

Cross-origin resource sharing (CORS)

Before we look at CORS, let's look at the significance of the same origin policy. The cross-origin policy is a critical aspect of a web application security model. In a web application security model, by default, a web browser does not allow a script file associated with a web page to access data associated on a page in a different hostname, domain, or port number. The purpose of a cross-origin policy is to prevent any malicious script embedded on one page to access sensitive data on another web page.

For example, a script hosted in a books.html page on www.packtpub.com can access the Document Object Model (DOM) of any page within the same domain, that is, www.packtpub.com. If it tries to access the DOM of a page hosted on another domain, the access is denied. Even if a page is hosted on a subdomain, such as books.packtpub.com, when it...

Cross-region replication

Amazon S3 enables you to automatically and asynchronously copy objects from a bucket in one AWS region to another AWS region. This is a bucket-level feature, which can be configured on the source bucket. In the replication configuration, you can specify the destination bucket where you want your source bucket objects to be replicated. In the configuration, you can specify a key-name prefix. S3 replicates all the objects, starting with the specific key prefixes to destination bucket. Cross-region replication is generally used for compliance requirements, for minimizing latency in accessing objects, and for any operations in which compute resources in multiple regions need to access data from a region-specific bucket.

The following are some requirements for enabling cross-region replication:

  • Both sources, as well as the destination bucket, must have versioning...

CloudFront

Amazon CloudFront is a fast content delivery network (CDN) that aims to deliver image, PDF, audio/video files, live broadcasting, dynamic web content (.html, .css, .js), and APIs. Lambda@Edge is an extension of AWS Lambda that executes functions to customize the content delivered by CloudFront.

A CDN consists of a geographically distributed group of caching servers. Each geographical location situated servers are called an Edge Location or Point of Presence (PoP). It reduces the load on an application origin by caching frequently used content. The aim is to minimize the latency and improve the speed. The following image may help you to understand how the CDN works at a high level, once it is configured:

The preceding diagram can be interpreted as follows:

  1. An end user accesses the website or an application hosted on a Amazon S3, AWS EC2, or a custom origin. A custom...

Summary

  • There are three broad types of storage services: block storage, file storage, and object storage.
  • Block storage is a type of storage that may not be physically attached to a server, but is accessed as a local storage device, just like a hard disk drive.
  • File storage is also known as file-based storage. It is a highly available, centralized place for storing your files and folders.
  • Object storage is a type of storage architecture where the data is stored as objects. Each object consists of the data, metadata, and a globally unique identifier.
  • Block storage works well for creating filesystems and installing operating systems and databases.
  • Unlike in block storage, you do not have access to format the file storage, create a filesystem, and install an operating system on it.
  • Unlike in block storage, you do not have access to format the object storage, create a filesystem...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
AWS Certified Developer - Associate Guide - Second Edition
Published in: Jun 2019Publisher: PacktISBN-13: 9781789617313
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Authors (2)

author image
Vipul Tankariya

Vipul Tankariya has a broad range of experience in cloud consulting, development, and training. He has worked with a number of customers across the globe, solving real-life business problems in terms of technology and strategy. He is also a public speaker at various AWS events and meetups. He has not only extensively worked on AWS, but is also certified in five AWS certifications. He is an accomplished senior cloud consultant and technologist with more than 21 years of experience. He is focused on strategic thought leadership concentrated around next-generation cloud-based solutions. He has a lot of experience in working on DevOps, CI/CD, and automation at each level of the delivery lifecycle of products, solutions, and services on the cloud.
Read more about Vipul Tankariya

author image
Bhavin Parmar

Bhavin Parmar has a broad range of experience in cloud consulting, development, and training. He actively participates in solving real-life business problems. He has not only extensively worked on AWS, but he is also certified in AWS and Red Hat. This book combines his AWS experience in solving real-life business problems with his hands-on deployment and development experience. Bhavin is an accomplished technologist and senior cloud consultant with more than 11 years of experience. He is focused on strategic thought leadership concentrated around next-generation cloud-based and DevOps solutions. He has also been instrumental in setting up cloud migration strategies for customers, building enterprise-class cloud solutions, and AWS training.
Read more about Bhavin Parmar