<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ramaiah Kethana</title>
    <description>The latest articles on DEV Community by Ramaiah Kethana (@ramaiahkethana).</description>
    <link>https://dev.to/ramaiahkethana</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F527549%2F5ac2e3ad-3752-4c41-96ca-8caf68cdb207.jpg</url>
      <title>DEV Community: Ramaiah Kethana</title>
      <link>https://dev.to/ramaiahkethana</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ramaiahkethana"/>
    <language>en</language>
    <item>
      <title>Cost savings in aws</title>
      <dc:creator>Ramaiah Kethana</dc:creator>
      <pubDate>Mon, 17 Feb 2025 09:24:18 +0000</pubDate>
      <link>https://dev.to/ramaiahkethana/cost-savings-in-aws-53gg</link>
      <guid>https://dev.to/ramaiahkethana/cost-savings-in-aws-53gg</guid>
      <description>&lt;h3&gt;
  
  
  AWS EC2 Cost Optimization Strategies
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check and Terminate Low-Used Instances&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify idle or underutilized EC2 instances.
&lt;/li&gt;
&lt;li&gt;Terminate or downsize instances to reduce expenses.
&lt;/li&gt;
&lt;li&gt;Use AWS Billing and Cost Management tool to detect unused instances.
&lt;/li&gt;
&lt;li&gt;Utilize AWS Operations Conductor for automatic right-sizing.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Optimize Spot Instance Usage&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spot instances offer significant cost savings but can be interrupted.
&lt;/li&gt;
&lt;li&gt;EC2 provides two signals for failover:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spot Instance Interruption Notice&lt;/strong&gt; (2-minute warning before termination).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EC2 Instance Rebalancing Suggestion&lt;/strong&gt; (proactive notification before the 2-minute warning).
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure spot instances to stop or hibernate instead of terminating.
&lt;/li&gt;
&lt;li&gt;Rebalance workloads to&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Setting Up a Node.js Server on AWS EC2 with Nginx and SSL</title>
      <dc:creator>Ramaiah Kethana</dc:creator>
      <pubDate>Mon, 17 Feb 2025 09:22:50 +0000</pubDate>
      <link>https://dev.to/ramaiahkethana/setting-up-a-nodejs-server-on-aws-ec2-with-nginx-and-ssl-434k</link>
      <guid>https://dev.to/ramaiahkethana/setting-up-a-nodejs-server-on-aws-ec2-with-nginx-and-ssl-434k</guid>
      <description>&lt;p&gt;Amazon EC2 (Elastic Compute Cloud) is widely used for hosting applications because it is scalable and flexible. In this tutorial, we will install a Node.js server on an EC2 instance, configure a static IP address, install Nginx as a reverse proxy, configure security groups, and install an SSL certificate with Certbot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Launch an EC2 Instance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Go to the AWS Management Console and navigate to the EC2 dashboard.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Launch Instance&lt;/strong&gt; and choose an Amazon Machine Image (AMI), such as &lt;strong&gt;Ubuntu 22.04 LTS&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select an instance type (e.g., &lt;strong&gt;t2.micro&lt;/strong&gt;, which is free-tier eligible).&lt;/li&gt;
&lt;li&gt;Configure instance details and select &lt;strong&gt;Create new key pair&lt;/strong&gt; for SSH access.&lt;/li&gt;
&lt;li&gt;Launch the instance and download the key file (.pem).&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 2: Assign a Static IP (Elastic IP)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the AWS EC2 dashboard, navigate to &lt;strong&gt;Elastic IPs&lt;/strong&gt; under &lt;strong&gt;Network &amp;amp; Security&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Allocate a new Elastic IP and associate it with your running instance.&lt;/li&gt;
&lt;li&gt;Update your domain’s DNS settings if needed to point to the static IP.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: Connect to Your EC2 Instance
&lt;/h2&gt;

&lt;p&gt;Use SSH to connect to the instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; your-key.pem ubuntu@your-ec2-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Install Node.js and PM2
&lt;/h2&gt;

&lt;p&gt;Update the system and install Node.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://deb.nodesource.com/setup_18.x | &lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; bash -
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt;
npm &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install PM2 for managing Node.js processes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; pm2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Deploy Your Node.js Application
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone or copy your Node.js project into the instance:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/your-repo.git
&lt;span class="nb"&gt;cd &lt;/span&gt;your-repo
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start the Node.js server using PM2:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm start
&lt;span class="c"&gt;# OR&lt;/span&gt;
pm run start:prod
&lt;span class="c"&gt;# To keep it running in the background&lt;/span&gt;
pm2 start app.js &lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"node-server"&lt;/span&gt;
pm2 save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6: Configure Security Groups
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In the AWS EC2 dashboard, go to &lt;strong&gt;Security Groups&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Edit inbound rules to allow:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSH (port 22)&lt;/strong&gt; – only for your IP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP (port 80)&lt;/strong&gt; – open to the world.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTPS (port 443)&lt;/strong&gt; – open to the world.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom (port 3000)&lt;/strong&gt; – if your Node.js app runs on port 3000 (for internal access only).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 7: Install and Configure Nginx as a Reverse Proxy
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install Nginx:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure Nginx:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the contents with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;your-domain.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_http_version&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Upgrade&lt;/span&gt; &lt;span class="nv"&gt;$http_upgrade&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Connection&lt;/span&gt; &lt;span class="s"&gt;'upgrade'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_cache_bypass&lt;/span&gt; &lt;span class="nv"&gt;$http_upgrade&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restart Nginx:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 8: Install SSL Certificate using Certbot
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install Certbot:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;certbot python3-certbot-nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Generate and install an SSL certificate:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot &lt;span class="nt"&gt;--nginx&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; your-domain.com &lt;span class="nt"&gt;-d&lt;/span&gt; www.your-domain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Auto-renew SSL:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot renew &lt;span class="nt"&gt;--dry-run&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You have successfully installed a Node.js server on AWS EC2 with Nginx as the reverse proxy and SSL encryption through Certbot. This installation provides a secure and scalable deployment for your application. Happy coding!&lt;/p&gt;

</description>
      <category>node</category>
      <category>nginx</category>
      <category>ssl</category>
      <category>ec2</category>
    </item>
    <item>
      <title>Cost savings in AWS EC2</title>
      <dc:creator>Ramaiah Kethana</dc:creator>
      <pubDate>Tue, 11 Jul 2023 06:48:06 +0000</pubDate>
      <link>https://dev.to/ramaiahkethana/cost-savings-in-aws-ec2-2g3i</link>
      <guid>https://dev.to/ramaiahkethana/cost-savings-in-aws-ec2-2g3i</guid>
      <description>&lt;p&gt;Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. &lt;/p&gt;

&lt;p&gt;Below are the few cost saving techniques in EC2.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify running EC2 instances that are idle or underutilized. You can then reduce your costs by stopping or reducing them.&lt;/li&gt;
&lt;li&gt;Use Compute Savings Plans to reduce EC2, Fargate and Lambda costs.&lt;/li&gt;
&lt;li&gt;Use Spot Instances based on to get discounts of up to 90%.&lt;/li&gt;
&lt;li&gt;Use Spot Fleet to combine spot instances with on-demand or reserved instances.&lt;/li&gt;
&lt;li&gt;Downgrade or upgrade the instance type based on CPU usage.&lt;/li&gt;
&lt;li&gt;Use AWS Billing and Cost Management tools to find out underused instances.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>When to choose AWS lambda</title>
      <dc:creator>Ramaiah Kethana</dc:creator>
      <pubDate>Fri, 07 Jul 2023 06:07:10 +0000</pubDate>
      <link>https://dev.to/ramaiahkethana/when-to-choose-aws-lambda-44hj</link>
      <guid>https://dev.to/ramaiahkethana/when-to-choose-aws-lambda-44hj</guid>
      <description>&lt;p&gt;AWS Lambda is a compute service that can be used for many applications. Few of the examples are mentioned below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To build serverless backend services&lt;/li&gt;
&lt;li&gt;IoT backend related applications&lt;/li&gt;
&lt;li&gt;Convert or processing uploaded S3 Objects&lt;/li&gt;
&lt;li&gt;Stream processing&lt;/li&gt;
&lt;li&gt;Convert files on demand&lt;/li&gt;
&lt;li&gt;Backup, automated and cron related jobs&lt;/li&gt;
&lt;li&gt;Mobile backend&lt;/li&gt;
&lt;li&gt;Email Service&lt;/li&gt;
&lt;li&gt;App authentication&lt;/li&gt;
&lt;li&gt;Chatbot&lt;/li&gt;
&lt;li&gt;Cleaning backend server&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>What is lambda and when to use lambda</title>
      <dc:creator>Ramaiah Kethana</dc:creator>
      <pubDate>Fri, 07 Jul 2023 05:46:29 +0000</pubDate>
      <link>https://dev.to/ramaiahkethana/what-is-lambda-and-when-to-use-lambda-1g60</link>
      <guid>https://dev.to/ramaiahkethana/what-is-lambda-and-when-to-use-lambda-1g60</guid>
      <description>&lt;p&gt;AWS Lambda is a serverless computing platform provided by Amazon. It is a part of AWS. Lambda is like a compute engine. It will take care of resources assigning and help to build applications quickly. &lt;/p&gt;

&lt;p&gt;Advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cost efficiency: Because you only pay for the compute time you consume, using AWS Lambda can be more cost-effective than running your own servers.&lt;/li&gt;
&lt;li&gt;Scalability: Lambda take care of resource planning and spin up new resources based on incoming requests.
Reduced cost of execution: One of the biggest strengths of - 
AWS Lambda functions is the reduced cost of execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Drawbacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Issue of Cold start: If the function called first time or being idle for some time, cold start will come into existence. It includes spin up a new server to run the code. This will cause the extra latency.&lt;/li&gt;
&lt;li&gt;Limited runtime options: Lambda supports only a limited runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sample Use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email service - Lambda can be used to send emails&lt;/li&gt;
&lt;li&gt;Serverless website: AWS Lambda can be used to build serverless websites that are scalable and cost-effective&lt;/li&gt;
&lt;li&gt;App authentication: Lambda can be used to write authentication related services&lt;/li&gt;
&lt;li&gt;Real-time data transformation: AWS Lambda can be used to transform data in real-time&lt;/li&gt;
&lt;li&gt;Chatbot: Lambda can be used to build chatbot related applications&lt;/li&gt;
&lt;li&gt;IoT applications: Lambda can be used for developing IoT related applications&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
