Sunday, 1 January 2023

Build Application with AWS CodeBuild

 

Build Application with AWS CodeBuild

AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, you don’t need to provision, manage, and scale your own build servers. CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue.codebuild-getting-started

In this activity guide, you will learn to create two S3 buckets, create the source code, and Uploading the source code and the build spec file

Working with AWS CodeCommit

 

Working with AWS CodeCommit

AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories. It makes it easy for teams to collaborate on code in a secure and highly scalable ecosystem. CodeCommit eliminates the need to operate your source control system or worry about scaling its infrastructure. You can use CodeCommit to securely store anything from source code to binaries, and it works seamlessly with your existing Git tools.AWS CodeCommit Repositories

In this activity guide, you will learn steps to creating an IAM user, Logging in to the account, Creating CodeCommit, and Adding File to Repository

Install & Configure AWS CLI, Setup GIT, Node JS & SDK

The AWS Command Line Interface is an open-source and unified tool that enables you to interact with AWS services/resources using commands in your command-line shell. With minimum configuration, AWS CLI also enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console from the command prompt in your favorite terminal program.

In this activity guide, You will learn how to set up and use the AWS CLI, GIT, and SDKs.

Create & Connect to Windows EC2 Machine

Create & Connect to Windows EC2 Machine

Amazon EC2 presents represents a true virtual computing environment, allowing you to use the console interfaces to launch instances with a variety of operating systems, load them with your custom desired application environment, manage your network’s access permissions, and run the image using as many or few systems as you desire.

In this activity guide, you will learn how to create and connect to a Linux/Windows EC2 Machine

Activity Guide II: CloudWatch – Create Billing Alarm & Service Limits

We can enable the AWS billing alerts through Amazon CloudWatch. CloudWatch is an AWS service dedicated to monitoring all of your activities across your AWS account. In addition to billing alerts, CloudWatch also provides the infrastructure for monitoring applications, logs, metrics collections, other service metadata, and detecting the activity in your AWS account usage.

The AWS CloudWatch provides a variety of metrics by which you can schedule your alarms. For example, you could create an alarm to notify you when the CPU or memory Utilization of a running instance goes beyond 90% or when the billing amount goes over $100, In an AWS free tier account, we get 10 alarms and 1,000 emails notifications per month.

Elastic Beanstalk | AWS Beanstalk Benefits & Work Overview

 AWS Elastic Beanstalk is an easy-to-use AWS service for deploying and scaling web applications and services developed with Python, Ruby, Java, .NET, PHP, Node.js, Go, and Docker on familiar servers such as Apache, Passenger, Nginx, and IIS.

In this post, we are going to discuss what is Elastic Beanstalk, What is the advantage, and the working of Elastic Beanstalk.

With Elastic Beanstalk, you just have to upload your code and it automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. At the same time, you retain full control over the AWS resources powering your application and can access the underlying resources at any time.

Old Architecture vs Elastic Beanstalk

What Is AWS Elastic Beanstalk?

  • An orchestration service offered by AWS.
  • Used to deploy and scale web applications and services.
  • Support Java, Python, Ruby, .NET, PHP, Node.js, Go, Docker on familiar servers such as Apache, Passenger, Nginx, and IIS.
  • The fastest and simplest way to deploy your application to AWS.
  • It takes care of deployment, capacity provisioning, load balancing, auto-scaling, application health monitoring.
  • You have full control over the AWS resources.

Feature of Elastic Beanstalk

Benefits Of Elastic Beanstalk AWS

  • Fast and simple to deploy: It is the simplest and fastest way to deploy your application on AWS. You just use the AWS Management Console, a Git repository, or an integrated development environment (IDE) such as Eclipse or Visual Studio to upload your application, and it automatically handles the deployment details of capacity provisioning, auto-scaling, load balancing, and application health monitoring. Within minutes, your application will be ready to use without any infrastructure or resource configuration work on your part.
  • Scalable: It automatically scales your application up and down based on your application’s need using easily adjustable Auto Scaling settings. For e.g, you can use CPU utilization metrics to trigger Auto Scaling actions. With this, your application can handle peaks in workload or traffic while minimizing your costs.
  • Developer productivity: Amazon Beanstalk Elastic provisions and operates the infrastructure and manages the application stack (platform) for you, so you don’t have to spend the time or develop the expertise. It also keeps the underlying platform running your application up-to-date with the latest patches and updates. So, you can focus on writing code rather than spending time managing and configuring servers, load balancers, databases, firewalls, and networks.
  • Complete infrastructure control: You are free to select the AWS resources, such as Amazon EC2 instance type, that are optimal for your application. Additionally, it lets you “open the hood” and allow you to full control over the AWS resources powering your application. If you decide you want to take over some (or all) of the elements of your infrastructure, you can do so seamlessly by using Amazon Elastic Beanstalk’s management capabilities.

Key Concept Of ElasticBeanstalk AWS

AWS Elastic Beanstalk enables you to manage all of the resources that run your application as environments. Here are some key concepts:

Elastic Beanstalk core architecture

  • Application: Amazon Elastic Beanstalk application is a logical collection of Elastic Beanstalk components, including environments, environment configurations and versions. In Elastic Beanstalk an application is conceptually similar to a folder.
  • Application version: An application version of Amazon Elastic Beanstalk refers to a specific, labelled iteration of deployable code for a web application. An application version points to an Amazon Simple Storage Service (Amazon S3) object that contains the deployable code, such as a Python WAR file.
  • Environment: An environment is a collection of AWS resources running an application version. Each environment runs only one application version at a time, still, you can able to run the same application version or different application versions in many environments simultaneously.
  • Environment configuration: An environment configuration determines a collection of parameters and settings that define how an environment and its associated resources behave. When you update an environment’s configuration settings, It automatically applies the changes to existing resources or deletes and deploys new resources depending on the changes you made.
  • Saved configuration: A saved configuration is a template that you can use as a starting point for creating unique environment configurations. You can create and modify saved configurations, and apply them to environments, using the Elastic Beanstalk console, AWS CLI, EB CLI, or API.
  • Platform: A platform is a combination of an operating system, programming language runtime, application server, web server, and Elastic Beanstalk components. It provide a variety of platforms on which you can build your applications.

How Does AWS Elastic Beanstalk Work?

By using Elastic Beanstalk, you create an application, upload an application version in the form of an application code bundle (for example, a Python .war file) to Elastic Beanstalk, and then provide some information about the application. Elastic Beanstalk automatically launches an environment, creates and configures the AWS resources needed to run your code. After your environment launch, you can then manage your environment and deploy new application versions. The following diagram illustrates the workflow of Elastic Beanstalk.

Working of Elastic Beanstalk

It supports the DevOps practice name “rolling deployments.” When enabled, your configuration deployments work hand in hand with Auto Scaling to ensure there are always a defined number of instances available as configuration changes made. It gives you control as Amazon EC2 instances are updated.

Read this blog where we have discussed 5 Pillars of AWS Well-Architected Framework and their design principles.

Hands-on: Creating an Elastic Beanstalk Application

  1. From the Compute Section click on Elastic Beanstack.
    AWS Management Console
  2. Click on Create Application under Elastic Beanstalk.
    AWS Elastic Beanstalk Console
  3. Give your application a name.
    Elastic Beanstalk Application Name
  4. In the Application tags section you can tag your application by giving key-value pairs.
    Tag for Elastic Beanstalk Application
  5. In the platform section, you have to choose a platform, platform branch, platform version (In Platform  Select PHP as the web application environment, In Platform branch you have to select the instance type on which your environment will going to create. I am using Amazon Linux 2, In Platform, version select the recommended version.)
    Runtime platform for Elastic Beanstalk Application
  6. In the Application code section you have to choose a sample application and then click on Create application.
    Sample Application for Elastic Beanstalk
  7. Once all the backend services will create then you will see the following screen. Click on the link to see your sample application.
    PHP application Elastic Beanstalk
  8. After clicking on the link you will see your application on the new tab of your browser.
    Running application on Elastic Beanstalk
    Now we created a running sample PHP application using Elastic Beanstalk

REGISTER FOR AWS FREE TIER ACCOUNT

 

REGISTER FOR AWS FREE TIER ACCOUNT

1. First Open your web browser and navigate 
2. On middle-click on Create a Free Account

3. Issue the details which you want to use for login your AWS account and click on Continue
• Email address: Provide the mail id which hasn’t been registered yet with Amazon AWS.
• Password: Type your password.
• Confirm password: Authenticate the password.
• AWS Account name: Choose a name for your account. You can change this name in your account settings after you sign up.

4. Contact Information
Select your AWS type (Profesional/ Personal) Fill in the correct information to validate your account if you’re going to create personal use then click on “Personal Account” else use “Company Account”, Accepts the Terms and
condition and then click on Create Account and Continue

Note: Make sure to provide proper contact details and mobile number to get the Verification code from AWS.
5. Payment and PAN information: In this step, you must fill in your credit card /Debit Card info and billing address and click on Secure Submit.

6. In this step, it will take you to the payment gateway to validate your payment information and for your credit card verification, Amazon will charge the minimum price based on Country. Here I have provided India, so Amazon charged 2 INR.

7. Phone verification: Here you will be taken to an identity verification page that will already have your phone number, so you just have to select either “Text message or Voice call” Provide a valid phone number, Solve the captcha and then click on Send SMS or Call Me Now(depending upon your selection).

8. After clicking on Send SMS or Call me Now, you will immediately receive a call or SMS from Amazon, for verification code, Enter your code then click on Verify Code.

9. Support plan: AWS support offers a selection of plans to meet your business needs.
Select your suitable plan then click continue.

Note: All customers receive free basic support.
10. Registration Confirmation page.
Once you completed all the above steps and processes. You’ll get the confirmation page as below. Now your account will be processed for activation. It may take somewhere between 30 minutes to 1 hour for you to receive an email confirmation that your Amazon Cloud Services account has been activated.