<?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: Pritam Pramanik</title>
    <description>The latest articles on DEV Community by Pritam Pramanik (@pritambios).</description>
    <link>https://dev.to/pritambios</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%2F331430%2F6fe025da-6759-4fb6-82c4-8fc6ba91c537.jpeg</url>
      <title>DEV Community: Pritam Pramanik</title>
      <link>https://dev.to/pritambios</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pritambios"/>
    <language>en</language>
    <item>
      <title>Deploy AWS elastic beanstalk on custom VPC network</title>
      <dc:creator>Pritam Pramanik</dc:creator>
      <pubDate>Fri, 10 Jun 2022 04:33:28 +0000</pubDate>
      <link>https://dev.to/pritambios/deploy-aws-elastic-beanstalk-on-custom-vpc-network-48pm</link>
      <guid>https://dev.to/pritambios/deploy-aws-elastic-beanstalk-on-custom-vpc-network-48pm</guid>
      <description>&lt;p&gt;If you want to deploy a web application on AWS elastic beanstalk and you want that to be highly available and secure. Read this content. I hope it will be helpful to you. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keep web servers and database hosted in private subnet. &lt;/li&gt;
&lt;li&gt;Keep Load Balancer on public subnet. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You need an Internet Gateway to connect to internet. You also need NAT Gateway since your web servers need internet access and web servers will not be accessible to internet.&lt;/p&gt;

&lt;p&gt;Use VPC launch template to setup the infrastructure quickly. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vgz2zCEH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79qkbhabz0fe56a4bsyd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vgz2zCEH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79qkbhabz0fe56a4bsyd.png" alt="Image description" width="880" height="423"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SbfF2KPA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9j9uc2u94vx8xmlfa0il.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SbfF2KPA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9j9uc2u94vx8xmlfa0il.png" alt="Image description" width="880" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your web servers need access to other AWS services(like S3, dynamoDB, SQS etc) in that case, you need to create VPC endpoints. This will allow your web servers securely access AWS resources with low latency. Example: If your web application need image upload and file reading from S3 you can enable VPC endpoints with S3 Gateway option in the VPC launch template.&lt;/p&gt;

&lt;p&gt;Note:~ you can also create single single NAT Gateway in 1 AZ instead of NAT Gateway 1 per AZ to save money.&lt;/p&gt;

&lt;p&gt;Once you setup above infrastructure successfully. You can go to elastic beanstalk and create a beanstalk environment using this network setup. In network configuration first choose the VPC and select public subnets for Load Balancer and private subnet for instances. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>beanstalk</category>
      <category>vpc</category>
    </item>
    <item>
      <title>How to run rails console on elastic beanstalk rails app</title>
      <dc:creator>Pritam Pramanik</dc:creator>
      <pubDate>Tue, 25 Jan 2022 05:45:13 +0000</pubDate>
      <link>https://dev.to/pritambios/how-to-run-rails-console-on-newly-setup-elastic-beanstalk-environment-4ieg</link>
      <guid>https://dev.to/pritambios/how-to-run-rails-console-on-newly-setup-elastic-beanstalk-environment-4ieg</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Put all you environment variable into &lt;code&gt;.env&lt;/code&gt; file root of your project directory.
&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;su - &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"cd /var/app/current; /opt/elasticbeanstalk/bin/get-config --output YAML environment | sed 's/: /=/g' &amp;gt; .env"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Set environment variable from &lt;code&gt;.env&lt;/code&gt; file
&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;export&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s1"&gt;'^#'&lt;/span&gt; .env | xargs &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'\n'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run your rails console based rails environment(production/staging/test/development etc).
&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="nv"&gt;RAILS_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;production bundle &lt;span class="nb"&gt;exec &lt;/span&gt;rails c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ebs</category>
      <category>elasticbeanstalk</category>
      <category>rails</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
