Monday, November 8, 2021

Demo: Amazon AWS S3 - Static Web Site Hosting

step1: Login to AWS console and create S3 bucket giving unique name for the bucket. Uncheck the block all public access. since Lab is to create static website so it needs to be accessed via public channel


step2: Select the bucket and go to properties. Scroll to the bottom of page and edit static website hosting section. Set it to Enable and type default.html for index page and save changes


step3: go to objects under bucket and upload any sample default.html file from local machine. After file is uploaded, set the permission of file to Public/ Everyone read.

Final Step: Go back to bucket, properties and see the static website section to copy the endpoint. Paste it in browser and enter.




Monday, November 1, 2021

Implement the Azure IoT Hub Demo: 

In this research room, we will go thru steps to configure IoT hub and add device to authenticate connection with online Raspberry Pi device simulator. Sensor data and messages will be passed from the Raspberry Pi to Azure IoT Hub connection which shows in view metrics for the messaging activity in Azure Portal. 

a) Go to URL https://portal.azure.com and Login to the account. On the Azure portal menu or from the Home page, select Create a resource and search for IoT Hub and click create as below. 

b) Fill out the IoT Hub information, then click on Next: Networking. IoT Hub name must be unique. Select Free Tier or S1: Standard Tier 


c) Review the options and click create to wait for the deployment to finish and then go to Resources


d) Search Device and Add Device

e) type device name, click save and copy the primary connection string


f) Test device using Raspberry Pi online Simulator. 
Launch Raspberry Pi Simulator site( https://azure-samples.github.io/raspberry-pi-web-simulator/). 
In the code area on the right, locate the line with ‘const connectionString =’ and replace it with the connection string copied from the Azure portal.

Click on the Run button(below the code area) to run the application. The console output should show the sensor data and messages that are sent from the Raspberry Pi simulator to your Azure IoT Hub. Data and messages are sent each time the Raspberry Pi simulator LED flashes. Click on Stop button to stop sending data


g) go back to Azure Portal to check IoT Hub Overview page to see the matrix and data. Change your timeframe in the show data for last to see data in the last hour.


Sunday, October 17, 2021

 Databases on AWS:

AWS provides fully managed database services to support relational, NoSQL, in-memory databases.

  • Amazon RDS is fully managed RDBMS offering with six different engines Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle and Microsoft SQL Server. 
  • With RDS, CPU, memory, storage and IOPS can be scaled independently.
  • Provides and maintains Multi-AZ deployment. Primary DB instance is synchronously replicated to standby replica in different availability zones for failover support
  • RDS also offers reserved DB instances for 1-3 years with significant discount
Amazon Aurora RDS is fully managed high performance, highly scalable and high availability offering from AWS. 5x higher throughput than standard MySQL database or PostgreSQL

Amazon DynamoDB is a fully managed NoSQL database to store and retrieve any amount of data. Supports only Eventual and strongly consistent read models


Amazon RedShift : fully managed data warehouse service in the cloud which can be scaled up to petabytes or more on redshift cluster. Uses ML to predict incoming query runtime for fast runtime. Uses result caching for repeated queries. Backup is automated on S3.

ElastiCache: is a web service providing scalable high performance caching solution or in-memory data store. Automatically modifies itself to scale out or scale in as per app requirement. 


Monday, October 11, 2021

 Amazon S3: Amazon Simple Storage Service

is a cloud based storage offering which can be maintained and accessed over the internet. Can be accessed also programmatically using Amazon provided APIs. Highly durable and data replication across multiple data centre in a region. S3 offers eventual consistency model.


Storage classes
With Amazon S3, you can store data across a range of different S3 Storage Classes.
S3 Standard, S3 Intelligent-Tiering, S3 Standard-Infrequent Access, S3 One Zone-Infrequent Access, S3 Glacier, S3 Glacier Deep Archive, and S3 Outposts.

Monday, October 4, 2021

AWS Load Balancer and Auto Scaling Case Study

Problem: Migrate infrastructure from on-premise to AWS to cut down expenses and handle increase in load requests. Create Load Balancer for load distribution, distribute traffic and scale up/down based on CPU utilization. 

Step1: Create two EC2 instances

Step2: Install Apache web server by logging on thru Putty

Step3: Create Target Group policy (Blue, Green) for each instance

Step4: Create an application Load Balancer with weighted rule to forward 70 % traffic to blue and remaining to green target group

Step4: Auto Scaling is based on Launch configuration which implicitly works by AMI. Lets create AMI by stopping one of EC2 instance.

Step5: Route 53 is a highly available and scalable cloud Domain Name System (DNS) web service. It is designed to give developers and businesses an extremely reliable and cost effective way to route end users to Internet applications by translating names like www.example.com into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other. Amazon Route 53 is fully compliant with IPv6 as well.

Create hosted zone for the company domain and update the AWS nameservers to domain sites. Now create record in Route 53 to route traffic to Load Balancer.

E2E flow is: Client browser-->Domain NamespaceRoute 53→ App Load Balancer→ Green/Blue target group→ Auto Scale in/out EC2 instance AMI based on CPU Utilization monitored by CloudWatch Alarm


Step6: Create Launch config with AMI and create auto Scaling Group with this launch config. attach the load balancer and specify target groups


Step7: define Auto Scaling policy by creating alarm in cloudwatch to monitor CPU usage


Move to Auto Scaling group to define dynamic scaling policy based on the alarms created

Sunday, September 26, 2021

 AWS Load Balancers: Load balancer is a service that uniformly distributes the network traffic and workloads across multiple servers or a cluster of servers. Load balancer increases the availability and fault tolerance of an application. 

Elastic Load Balancer (ELB) is a load balancing service for the AWS deployments and scaling itself as necessary to handle the load. Incoming traffic is distributed across EC2 instances in multiple availability zones and ELB becomes the single point of contact for clients.


Creating Application Load Balancer:

  • Go to AWS Management Console and click on the Services drop-down
  • choose EC2 and Scroll down to select ‘Load Balancers’
  • Select Create button under Application Load Balancer
  • Configure Name, create a new VPC, add a tag; select mapping, default subnet, use weighted routing in the listener rules and then choose launch
Autoscaling: Scaling is the process of adding/removing capacity/resources as needed. Vertical and Horizontal are two distinct scaling types. Scale out is adding the capacity/resources and Scale in is removing the capacity/resources. Autoscaling can dynamically increase or decrease capacity as needed.

 Autoscaling group contains a collection of EC2 instances that identical. autoscaling group needs  launch configuration to be specified which cannot be changed. All new instances launched will use configuration and scaling policies will determine EC2 instances launching and termination. 

Launch configuration is a template that is specified with Autoscaling groups to launch EC2 instances. It can be created by either a) From scratch: Image ID, instance type, storage devices, etc. b) From an EC2 instance: Attributes from the instance are copied. Block device mapping of the AMI is included.

Scaling policies and alarms mention how to scale, and alarms decide when to scale. Amazon CloudWatch enables policies and monitor metrics e.g., CPU utilization, etc. When the threshold is breached, scaling policies are executed with pre-defined min, max  and the desired capacity. Scaling can also be achieved based on a schedule i.e scale at a given time and date. Finally, Scaling can be done based on demand i.e. scaling occurs when the CPU utilization of the current running instances grows beyond a fixed usage limit.



Monday, September 20, 2021

Amazon Elastic Block Store (EBS), Amazon Elastic File System (EFS): 

 EBS is an easy-to-use, scalable, high-performance block-storage service designed for Amazon Elastic Compute Cloud (Amazon EC2).


  • EBS is unformatted block-level storage and mounted as raw device to the EC2 instance 
  • EBS volumes persist independently from the life of the EC2 instance 
  • EBS volume is automatically replicated within an availability zone. 
  • EBS can now enable Multi-Attach on Amazon EBS IOPS io1 volume to allow a single volume to be concurrently attached to up to 16 AWS Nitro System-based EC2 instances within the same AZ


EBS Snapshot: Snapshots are used to backup data incrementally on EBS volumes. Snapshots are copied to Amazon S3.

Data Lifecycle Manager for Snapshots: Amazon DLM supports EBS volumes and snapshots. Define backup and retention schedules for EBS snapshots by creating lifecycle policies based on tags

  • It is free to use and no longer need to create custom scripts for backup and restore
  • can create up to 100 lifecycle policies per region and add up to 45 tags per resource
  • can create one schedule per lifecycle policy

Get Started with EBS:

  • Select EBS under Volumes from the EC2 dashboard and Click on Create volume
  • Select general purpose SSD and reduce the size to 8 GB, and choose the availability zone the same as the zone of the created EC2 instance
  • Click Create volume and click on Actions -->Attach Volume
  • Click on the instance field; choose the available instance and proceed to create
EBS volume is now created and is ready to be mounted. Reconnect to EC2 instance and follow Linux/Ubuntu commands to mount the created EBS volume.


What is Amazon Elastic File System (EFS) ?

EFS provides a cloud-based simple, scalable, elastic file system for general purpose workloads for use with AWS Cloud services and on-premises resources.

  • It is built to scale on demand to petabytes, growing and shrinking automatically as you add and remove files, eliminating the need to provision and manage capacity to accommodate growth. 
  • provides massively parallel shared access to thousands of Amazon EC2 instances, enabling your applications to achieve high levels of throughput and IOPS with consistent low latencies.
  • Amazon EFS is a fully managed service.

Get Started with EFS:

  • Go to AWS Management Console and select Services drop down to choose EFS
  • Choose Create File System
  • select the default VPC, name file system, add tags if needed and click on Next
  • Select General Purpose and Bursting for high performance
  • Review the properties and Create File System. Note down the File System ID

EFS volume is now created and is ready to be mounted. Reconnect to EC2 instance and follow Linux/Ubuntu commands to mount the created EFS volume.

Sunday, September 12, 2021

 Amazon EC2: Elastic Compute Cloud

Elasticity: It is the level at which a system is able to adapt to workload changes by provisioning and de-provisioning resources such that the resources meet the current demand as closely as possible.

Regions and Availability Zones: Regions are geographical locations where AWS data centers reside. Regions like US East: N. Virginia (us-east-1), Ohio (us-east-2), US West: N. California (us-west-1), Oregon (uswest-2), APAC: Mumbai (ap-south-1), Seoul (apnortheast-2), Singapore (ap-southeast-1)

For example, ‘us-east-1’ contains 6 data centers or availability zones: us-east-1a us-east-1b us-east-1c us-east-1d us-east-1e us-east-1f

EC2 Instance Types: The instance type determines the hardware of the underlying host computer on which EC2 instances are launched. General-purpose, Memory-optimized, Storage-optimized, Accelerated Computing and Compute-optimized.

Launching an EC2 instance:
  • Open AWS Management Console; click on Services drop-down, and choose EC2 
  • Click on Launch Instance, and choose an AMI (Ubuntu 18.04){Amazon Machine Image (AMI) contains the information required to launch an instance } 
  • Choose Instance type (Free tier eligible), and select t2-Micro 
  • Configure instances, and add storage and unique tags like Name, Value pait
  • Configure the network group (choose Create new group), and then review once and launch 
  • Next, choose Create a new key pair; give a name, and download 
  • Click on Launch instances and wait until it initializes
Public IP vs Elastic IP: 
Public IP : It is not associated with an AWS account. No charges for the public IP, even if it is not being used while the instance is running. Whenever the instance is re-launched, the public IP changes.
Elastic IP: It is associated with the AWS account. Charges will be applied if the same is done with the elastic IP. The elastic IP is the same and static for every launch until we manually release it.

Reserved and Spot Instances: 
Resources and capacity is reserved until the contract period ends in case of Reserved Instances.
For Spot, unused EC2 instances are available for significant price reduction than the on-demand price. Instances are terminated if the spot price increases than the bid price.

Monday, September 6, 2021

 Amazon Web Service: Cloud Computing Leader with cloud service models as

  • IaaS: Infrastructure as a Service
  • PaaS: Platform as a Service
  • SaaS: Software as a Service

Starting off with AWS

  • https://aws.amazon.com/
  • Create account by entering all the details along with credit card details
  • Now login and open the AWS management console to begin with hands-on experience