Cloud Unit 1
Cloud Unit 1
Internet Dependency:
A dependable and fast internet connection is essential for cloud computing.
Limited Control and Customization:
Using standardized services and platforms offered by the cloud service provider is a
common part of cloud computing. As a result, organizations may have less ability to
customize and control their infrastructure, applications, and security measures.
Data Security and Concerns about Privacy:
Concerns about data security and privacy arise when sensitive data is stored on the
cloud. Businesses must have faith in the cloud service provider's security
procedures, data encryption, access controls, and regulatory compliance.
Public Cloud: The cloud resources that are owned and operated by a third-party
cloud service provider are termed as public clouds. It delivers computing resources
such as servers, software, and storage over the internet
Private Cloud: The cloud computing resources that are exclusively used inside a
single business or organization are termed as a private cloud. A private cloud may
physically be located on the company’s on-site datacentre or hosted by a third-party
service provider.
Hybrid Cloud: Hybrid clouds are mixtures of these different deployments. For
example, an enterprise may rent storage in a public cloud for handling peak
demand. The combination of the enterprise’s private cloud and the rented storage
then is a hybrid cloud
Community Cloud is a cloud infrastructure shared by a community of multiple
organizations that generally have a common purpose.
Uses of AWS
A small manufacturing organization uses their expertise to expand their business by
leaving their IT management to the AWS.
A large enterprise spread across the globe can utilize the AWS to deliver the training
to the distributed workforce.
Pay-As-You-Go
Based on the concept of Pay-As-You-Go, AWS provides the services to the
customers.
Amazon storage services
Amazon Simple Storage Server(S3)
S3 provides developers and IT teams with secure, durable, highly scalable object
storage.
It is easy to use with a simple web services interface to store and retrieve any
amount of data from anywhere on the web.
S3 is a safe place to store the files.
It is Object-based storage, i.e., you can store the images, word files, pdf files, etc.
The files which are stored in S3 can be from 0 Bytes to 5 TB.
It has unlimited storage means that you can store the data as much you want.
Files are stored in Bucket. A bucket is like a folder available in S3 that stores the
files.S3 is a universal namespace, i.e., the names must be unique globally. Bucket
contains a DNS address. Therefore, the bucket must contain a unique name to
generate a unique DNS address.
If you create a bucket, URL look like:
If you upload a file to S3 bucket, then you will receive an HTTP 200 code means
that the uploading of a file is successful.
Advantages of Amazon S3
Create Buckets: Firstly, we create a bucket and provide a name to the bucket.
Buckets are the containers in S3 that stores the data. Buckets must have a unique
name to generate a unique DNS address.
Storing data in buckets: Bucket can be used to store an infinite amount of data. You
can upload the files as much you want into an Amazon S3 bucket, i.e., there is no
maximum limit on no of buckets being stored. Each object can contain up to 5 TB of
data. Each object can be stored and retrieved by using a unique developer
assigned-key.
Download data: You can also download your data from a bucket and can also give
permission to others to download the same data. You can download the data at any
time whenever you want.
Permissions: You can also grant or deny access to others who want to download or
upload the data from your Amazon S3 bucket. Authentication mechanism keeps the
data secure from unauthorized access.
Standard interfaces: S3 is used with the standard interfaces REST and SOAP
interfaces which are designed in such a way that they can work with any
development toolkit.
Security: Amazon S3 offers security features by protecting unauthorized users from
accessing your data.
Accessing Simple Storage Server (S3): There are three ways of using S3.
Most common operations can be performed via
Step 1.Through the AWSconsole
Step 2.the GUI interface to AWS (shown in Figure 2.1) that can be accessed via
http://aws.amazon.com/console. For use of S3 within applications, Amazon provides
a REST-ful API with familiar HTTP operations such as GET, PUT, DELETE, and
HEAD.
Step 3. Also, there are libraries and SDKs for various languages.
How data is stored in Aws Simple Storage Server(Creating Bucket)
1.Sign up for S3 at http://aws.amazon.com/s3/. While signing up, obtain the AWS
Access Key and the AWS Secret Key. These are similar to userid and password that
is used to authenticate all transactions with Amazon Web Services (not just S3).
2.Sign in to the AWS Management Console for S3 (see Figure 2.1)athttps://
console.aws.amazon.com/s3/home.
3. Create a bucket (see Figure 2.2) giving a name and geographical location where
it can be stored. In S3 all files (called objects) are stored in a bucket, which
represents a collection of related objects. Buckets and objects are described later in
the section Organizing Data in S3: Buckets, Objects and Keys.
4. Click the Upload button (see Figure 2.3) and follow the instructions to upload files.
5. The photos or other files are now safely backed up to S3 and available for sharing
with a URL if the right permissions are provided.
Organizing Data In S3:
Buckets:
A bucket is a container used for storing the objects.
Every object is incorporated in a bucket.
For example, if the object named photos/tree.jpg is stored in the treeimage bucket,
then it can be addressed by using the URL
http://treeimage.s3.amazonaws.com/photos/tree.jpg.
A bucket has no limit to the amount of objects that it can store. No bucket can exist
inside of other buckets.
S3 performance remains the same regardless of how many buckets have been
created.
The AWS user that creates a bucket owns it, and no other AWS user cannot own it.
Therefore, we can say that the ownership of a bucket is not transferrable.
The AWS account that creates a bucket can delete a bucket, but no other AWS user
can delete the bucket.
Objects
Objects are the entities which are stored in an S3 bucket.
An object consists of object data and metadata where metadata is a set of name-
value pair that describes the data.
An object consists of some default metadata such as date last modified, and
standard HTTP metadata, such as Content type. Custom metadata can also be
specified at the time of storing an object.
It is uniquely identified within a bucket by key and version ID.
Key
A key is a unique identifier for an object.
Every object in a bucket is associated with one key.
An object can be uniquely identified by using a combination of bucket name, the
key, and optionally version ID.
For example, in the URL http://jtp.s3.amazonaws.com/2019-01-31/Amazons3.wsdl
where "jtp" is the bucket name, and key is "2019-01-31/Amazons3.wsdl"
Regions
You can choose a geographical region in which you want to store the buckets that
you have created.
A region is chosen in such a way that it optimizes the latency, minimize costs or
address regulatory requirements.
Objects will not leave the region unless you explicitly transfer the objects to another
region.
S3 Administration
In any enterprise, data is always coupled to policies that determine the location of
the data and its availability, as well as who can and cannot access it. For security
and compliance with local regulations, it is necessary to be able to audit and log
actions and be able to undo inadvertent user actions.
Security: Users can ensure the security of their S3 data by two methods.
First, S3 offers access control to objects. Users can set permissions that allow
others to access their objects. This is accomplished via the AWS Management
Console. A right-click on an object brings up the object actions menu (see Figure
2.4). Granting anonymous read access to objects makes them readable by anyone;
this is useful, for example, for static content on a web site. This is accomplished by
selecting the Make Public option on the object menu. It is also possible to narrow
read or write access to specific AWS accounts. This is accomplished by selecting
the Properties option that brings up another menu (not shown) that allows users to
enter the email ids of users to be allowed access.
Data protection: S3 offers two features to prevent data loss [1]. By default, S3
replicates data across multiple storage devices, and is designed to survive two
replica failures. It is also possible to request Reduced Redundancy Storage(RRS)
for non-critical data. RRS data is replicated twice, and is designed to survive one
replica failure. It is important to note that Amazon does not guarantee consistency
among the replicas; e.g., if there are three replicas of the data, an application
reading a replica which has a delayed update could read an older version of the
data.
Regions: For performance, legal and other reasons, it may be desirable to have S3
data running in specific geographic locations. This can be accomplished at the
bucket level by selecting the region that the bucket is stored in during its creation
Amazon Simple DB
allows storage and retrieval of a set of attributes based on a key. Use of key-value
stores is an alternative to relational databases that use SQL-based queries. It is a
type of NoSQL data store.
Data Organization and Access
Data in SDB is organized into domains. Each item in a domain has a unique key that
must be provided during creation. Each item can have up to 256 attributes, which
are name-value pairs. In terms of the relational model, for each row, the primary key
translates to the item name and the column names and values for that row translate
to the attribute name-value pairs. For example, if it is necessary to store information
regarding an employee, it is possible to store the attributes of the employee (e.g.,
the employee name) indexed by an appropriate key, such as an employee id. Unlike
an RDBMS, attributes in SDB can have multiple values
Amazon EC2
EC2 stands for Amazon Elastic Compute Cloud.
Amazon EC2 is a web service that provides resizable compute capacity in the cloud.
Amazon EC2 reduces the time required to obtain and boot new user instances to
minutes rather than in older days, if you need a server then you had to put a
purchase order, and cabling is done to get a new server which is a very time-
consuming process. Now, Amazon has provided an EC2 which is a virtual machine
in the cloud that completely changes the industry.
You can scale the compute capacity up and down as per the computing requirement
changes.
Amazon EC2 changes the economics of computing by allowing you to pay only for
the resources that you actually use. Rather than you previously buy physical
servers, you would look for a server that has more CPU capacity, RAM capacity and
you buy a server over 5 year term, so you have to plan for 5 years in advance.
People spend a lot of capital in such investments. EC2 allows you to pay for the
capacity that you actually use.
Accessing EC2 Using AWS Console
Step 1: EC2 can be accessed via the Amazon Web Services console at http://
aws.amazon.com/console Ec2 Dashboard appears.
Step 2: Using EC2 Console Dashboard, we can create an instance (a compute
resource by Clicking on the “Launch Instance” button
Step 3: That takes user to the screen shown, where a set of supported operating
system images (called Amazon Machine Images, AMI) are shown to choose from.
Step 4: one should choose the right one Once the image is chosen, the EC2
instance wizard pops up to help the user set further options for the instance, such as
the specific OS kernel version to use, whether to enable monitoring and so on
Step5:Next, the user has to create at least one key-value pair that is needed to
securely connect to the instance. Follow the instructions to create a key-pair and
save the file (say my_keypair.pem) in a safe place. The user can reuse an already
created key-pair in case the user has many instances (it is analogous to using the
same username-password to access many machines).
Step6: Next, the security groups for the instance can be set to ensure the required
network ports are open or blocked for the instance. For example, choosing the “web
server” configuration will enable port 80 (the default HTTP port). More advanced
firewall rules can be set as well.
Step7: The final screen before launching the instance is shown in Figure 2.10.
Launching the instance gives a public DNS name that the user can use to login
remotely and use as if the cloud server was on the same network as the client
machine
Accessing EC2 Using Command Line Tools
Amazon also provides a command line interface to EC2 that uses the EC2 API to
implement specialized operations that cannot be performed with the AWS console.
Installing EC2 command line tools
Download tools
Set environment variables (e.g., location of JRE)
Set security environment (e.g., get certificate)
Set region
1:Download tools: The EC2 command line utilities can be downloaded from Amazon
EC2 API Tools [7] as a Zip file. They are written in Java, and hence will run on
Linux, Unix, and Windows if the appropriate JRE is available.
2:Set environment variables: The first command sets the environment variable that
specifies the directory in which the Java runtime resides. PATHNAME should be the
full pathname of the directory where the java.exe file can be found. The second
command specifies the directory where the EC2 tools reside; TOOLS_PATHNAME
should be set to the full pathname of the directory
For Linux: $export JAVA_HOME=PATHNAME
$export EC2_TOOLS=TOOLS_PATHNAME
$export PATH=$PATH:$EC2_HOME/bin
For Windows:
C:\>SET JAVA_HOME=PATHNAME
C:\>SET EC2_TOOLS=TOOLS_PATHNAME
C:\>SET PATH=%PATH%,%EC2_HOME%\bin
3: Set up security environment:
The next step is to set up the environment so that the EC2 command line utilities
can authenticate to AWS during each interaction.
To do this, it is necessary to download an X.509 certificate and private key that
authenticates HTTP requests to Amazon.
The following commands are to be executed to set up the environment; both Linux
and Windows commands are given. Here, f1.pem is the certificate file downloaded
from EC2.
$export EC2-CERT=~/.ec2/f1.pem
Or
C:\> set EC2-CERT=~/.ec2/f1.pem
Set region:
It is necessary to next set the region that the EC2 command tools interact with – i.e.,
the location in which the EC2 virtual machines would be created
$export EC2-URL=https:// <ENDPOINT URL>
Or
C:\> set EC2-URL =https:// <ENDPOINT URL>
Simple EC2 Example: Setting up a Web Server
The process is broken down into four steps:
Step 1: Selecting the Amazon MachineImage(AMI) for the instance
Step 2: Creating the EC2 instance and installing the web server
Step 3: Creating an EBS volume for data, such as HTML files and so on
Step 4: Setting up networking and access rules
Step 1: Selecting the AMI for the instance
Using the dropdown menus to select “Amazon Images” and “Amazon Linux” brings
up a list of Linux images supplied by Amazon,
Step2: Creating the Example EC2 Instance
Two other important steps done during the creation of an instance are
generate a key pair that provides access to the EC2 servers that are created and
create a security group that will be associated with the instance and specify the
networking access rules
For Linux: $ export EC2-PRIVATE-KEY=~/.ec2/f2.pem $ ec2addgrp "Web Server"
–d "Security Group for Web Servers" $ ec2run ami-74f0061d –b dev/sda1=::false –k
f2.pem –g “Web Server”
For Windows: C:\> set EC2-PRIVATE-KEY =C:\.ec2\f2.pem C:\> ec2addgrp "Web
Server" –d "Security Group for Web Servers" C:\> ec2run ami-74f0061d –b
"xvda=::false" –k f2.pem –g "Web Server"