<?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: Pankaj Kumar</title>
    <description>The latest articles on DEV Community by Pankaj Kumar (@cryptic022).</description>
    <link>https://dev.to/cryptic022</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%2F110431%2Fe5bf021b-1325-4940-948f-fa157ffac67d.jpg</url>
      <title>DEV Community: Pankaj Kumar</title>
      <link>https://dev.to/cryptic022</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cryptic022"/>
    <language>en</language>
    <item>
      <title>Sticky Header and Footer with Tailwind</title>
      <dc:creator>Pankaj Kumar</dc:creator>
      <pubDate>Sun, 21 Jun 2020 13:35:30 +0000</pubDate>
      <link>https://dev.to/cryptic022/sticky-header-and-footer-with-tailwind-2oik</link>
      <guid>https://dev.to/cryptic022/sticky-header-and-footer-with-tailwind-2oik</guid>
      <description>&lt;p&gt;Recently I started exploring Tailwind CSS framework. It is utility CSS framework fro building components. It gives us utility classes for creating customizable components. &lt;/p&gt;

&lt;p&gt;If you don't know about utility CSS, check out this article from tailwind creator Adam: &lt;a href="https://adamwathan.me/css-utility-classes-and-separation-of-concerns/" rel="noopener noreferrer"&gt;Utility CSS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I had to build similar UI like Spotify where header and footer are fixed. The only middle part is scrollable.&lt;/p&gt;

&lt;p&gt;It will be our final result:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk6h7k9qzm65gicedg1l9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk6h7k9qzm65gicedg1l9.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  First Step:
&lt;/h3&gt;

&lt;p&gt;This is our HTML code which contains a header, main and footer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F73gufxp6247m9xmhg01h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F73gufxp6247m9xmhg01h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Last Step:
&lt;/h3&gt;

&lt;p&gt;We want our max screen width of 100%. Our main block should be scrollable. Header and Footer should be stick to the same position always. We won't use &lt;code&gt;position: fixed&lt;/code&gt; class.  We will use flexbox superpowers here. &lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;h-screen&lt;/code&gt; to parent div. It will give max 100vh height.&lt;/p&gt;

&lt;p&gt;Add &lt;code&gt;flex-1 overflow-y-auto&lt;/code&gt; to the main block.&lt;/p&gt;

&lt;p&gt;Here &lt;code&gt;flex-1&lt;/code&gt; class is giving remaining space to the main block. Header and Footer will take space based on their content size.&lt;br&gt;
&lt;code&gt;overflow-y-auto&lt;/code&gt; class give the scrollable property for the main block. Try to add lot of content in main block. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6zwbipo8y6gd69yx101u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6zwbipo8y6gd69yx101u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it 🙂&lt;/p&gt;
&lt;h3&gt;
  
  
  Final Result
&lt;/h3&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/y7g7g"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>tailwindcss</category>
      <category>css</category>
      <category>flexbox</category>
    </item>
    <item>
      <title>AWS Networking Concepts</title>
      <dc:creator>Pankaj Kumar</dc:creator>
      <pubDate>Sat, 23 May 2020 14:25:13 +0000</pubDate>
      <link>https://dev.to/cryptic022/aws-networking-jargons-simplified-48c0</link>
      <guid>https://dev.to/cryptic022/aws-networking-jargons-simplified-48c0</guid>
      <description>&lt;p&gt;When we start learning AWS, the first thing we have to learn is networking concepts. Once you open an AWS account, you have to create your network space or you can use the default VPC.&lt;/p&gt;

&lt;p&gt;If you want hands-on practice on these services, you can open a free tier account with AWS and explore many products without spending a single penny. Some services are chargeable and their rates vary a lot depending on a particular region.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In this article NAT gateway is chargeable. Still, I would suggest you use &lt;a href="https://calculator.aws/#/"&gt;AWS ESTIMATE&lt;/a&gt; for other services as well.&lt;/p&gt;

&lt;p&gt;In this article, you will understand the main networking concepts: VPC, Subnets (private, public), CIDR, Elastic IP, Route Table, NAT Gateway, Internet Gateway, Security Group, NaCl&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This will be our final outcome&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Oc65hnOh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mpr1qw1t9x0rf7zjc758.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Oc65hnOh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mpr1qw1t9x0rf7zjc758.png" alt="VPC Dashboard after final outcome"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is VPC?
&lt;/h3&gt;

&lt;p&gt;VPC is way to logically separated resources when you’re working in AWS. You will be creating resources inside VPC so it won't be accessible from outside unless we give permission. These resources can communicate with only this VPC resources.&lt;/p&gt;

&lt;p&gt;We will be using VPC wizard templates to create VPC. We are using a template which will be creating VPC with private and public subnet (will explain in some time) for us.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Go to Launch VPC Wizard:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k1WP0iSs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cldwldqavgi02qpt8txl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k1WP0iSs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cldwldqavgi02qpt8txl.png" alt="VPC Wizard Template"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VPC Creation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4iJP9Pjq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aaysh4b68nlzkckaipm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4iJP9Pjq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aaysh4b68nlzkckaipm1.png" alt="VPC Creation Form"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you will see the above image, VPC requires a range of IP address. This range is configured using CIDR. In the example, we will be using 10.0.0.0/16 (means 65531 unique address) which can be used for a lot of AWS  resources.&lt;/p&gt;

&lt;p&gt;You can use this &lt;a href="https://cidr.xyz/"&gt;CIDR calculator&lt;/a&gt; for calculating the IP address range&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Subnet?
&lt;/h3&gt;

&lt;p&gt;A subnet is a smaller piece of network. We create different subnets based on our networking rules and our availability zones needs.&lt;br&gt;
In our example, we will be creating 2 subnets: private and public&lt;/p&gt;

&lt;p&gt;Public subnet traffic is routed to an internet gateway so resources of this subnet can be accessible from the internet. It will always have public IP for communication&lt;/p&gt;

&lt;p&gt;Internet Users → &lt;a href="http://dev.to"&gt;dev.to&lt;/a&gt; → Public IP&lt;/p&gt;

&lt;p&gt;Private subnet doesn’t have a route to the internet gateway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Our website server which needs to be accessible via the internet so it will be in Public Subnet. Our database servers will be in private subnet which should not be accessible via the internet.&lt;/p&gt;

&lt;p&gt;In an example, we are giving 251 IP address to both subnets and us-east-1 availability zone. You can choose based on your resources need and their availability demand.&lt;/p&gt;

&lt;p&gt;You can choose different availability zones for different subnets&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Internet Gateway?
&lt;/h3&gt;

&lt;p&gt;An AWS resource that gives subnet access to the public internet. We have chosen public subnet template so AWS will create this for us and attach it to the public subnet.&lt;br&gt;
You can attach internet gateway to any subnet and it will become Public Subnet. Don't try to attach to your database servers 😜. It can cause security issues for your database servers.&lt;/p&gt;

&lt;p&gt;I will show you internet gateway usage later in the article.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is NAT Gateway or NAT instance?
&lt;/h3&gt;

&lt;p&gt;We have seen that private subnets can't be accessible from the internet. Sometimes resources inside private subnet need internet access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Database servers need patching and need to download some packages from the internet. In this case, we will have to use a NAT gateway. It will always have public IP to communicate with the internet.&lt;br&gt;
We can use NAT instances as well. We just need to attach this to our private subnet. Then private subnet resources will communicate to the internet through NAT gateway.&lt;/p&gt;

&lt;p&gt;We have to select the public subnet at time of creating NAT Gateway. Each NAT gateway is created in a specific Availability Zone and implemented with redundancy in that zone.&lt;br&gt;
Multiple availability zones private subnets can share this NAT gateway.&lt;/p&gt;

&lt;p&gt;If the NAT availability zone is down, other availability zones resources will lose internet access. Ideally, we should create NAT for each availability zone and resources use the NAT gateway in the same Availability Zone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check this for more details:&lt;/strong&gt; &lt;a href="https://stackoverflow.com/questions/59525573/can-a-single-nat-gateway-span-across-multiple-az"&gt;NAT USAGE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check out the difference between&lt;/strong&gt; &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-comparison.html"&gt;NAT Gateway and NAT Instance&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Route Table?
&lt;/h3&gt;

&lt;p&gt;A routeing table is what decides how traffic flows between subnets. Route table would need to set up in order to define where services can access. &lt;/p&gt;

&lt;p&gt;Internet gateway attachment, NAT gateway attachment, transient gateway everything goes into route table for defining the route rules.&lt;/p&gt;

&lt;p&gt;Whenever we create VPC, AWS create default main route table for us. If we have to create a private subnet and attach a NAT gateway, we have to create a custom route table and attach it to a specific subnet.&lt;/p&gt;

&lt;p&gt;We are using Public/private subnet template in our example, AWS will create 2 route table&lt;/p&gt;

&lt;p&gt;for us. One is the main route table and another is a custom route table.&lt;/p&gt;

&lt;p&gt;You can go to any subnet and check which route table is attached to that subnet.&lt;br&gt;
In our example, go to public subnet and check the routeing table:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Select the public subnet → Scroll to end → Find route table column&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iX1MRN54--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/r67x81opd5gnbcdvzdpt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iX1MRN54--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/r67x81opd5gnbcdvzdpt.png" alt="Public Subnet Route Table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will find that it is using the main route table and using internet gateway route for accessing the internet. This internet gateway Id can be different.&lt;/p&gt;

&lt;p&gt;You can check the private subnet route table as well. Go to private subnet, it will use a custom route table and be using NAT for accessing the internet. Whenever private subnet needs internet access,&lt;/p&gt;

&lt;p&gt;we will have to add NAT in the subnet route table.&lt;/p&gt;

&lt;p&gt;Whenever you need custom routing for your subnets, you will have to create a custom route table and attach it to a specific subnet.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is an Elastic IP?
&lt;/h3&gt;

&lt;p&gt;Elastic IP addresses are used by AWS to manage its dynamic cloud computing services. Whenever we create instances in a public subnet, it will get different public IP. If we need public IP's which needs to fixed for some purpose, we have to allocate Elastic IP.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
We use Elastic IP's for creating a NAT gateway.&lt;br&gt;
We need to communicate with any third party API and they can allow only fix number of public IP from the client. In this case, we will have to allocate an Elastic IP and assign it to the resource.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now we come to the security part of VPC:&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Security group?
&lt;/h3&gt;

&lt;p&gt;A security group is a set of networking rules that are applied to a resource. A security group is responsible for defining what traffic (based on port and protocol) can enter or leave certain resources.&lt;/p&gt;

&lt;p&gt;Suppose you want to give permission to specific IP's to access the resource on a specific port. You need to create a security group with that permission and attach it to the resource. Multiple resources can use the same security group.&lt;/p&gt;

&lt;p&gt;Inbound Rules → Incoming traffic rules of resource&lt;/p&gt;

&lt;p&gt;Outbound Rules → Outgoing traffic rules of resource&lt;/p&gt;

&lt;p&gt;Go to any security group → Inbound rules (Incoming traffic rules) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8dphHjiQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vpmzsr83lrh9o4871ybu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8dphHjiQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vpmzsr83lrh9o4871ybu.png" alt="Security group Inbound Rules"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this above image, we have chosen only 3 ports for incoming traffic. For database instances, you will open a specific port to only limited IP's. All those rules go into a security group.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is NACL?
&lt;/h3&gt;

&lt;p&gt;Network ACLs control inbound and outbound traffic for your subnets.&lt;/p&gt;

&lt;p&gt;These are default rules which come with default NACL:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5vnRTSd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a1zzwkvslnlnu4lvgsgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5vnRTSd8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/a1zzwkvslnlnu4lvgsgh.png" alt="NACL Default rules"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we have to allow permission for specific IP's or specific port on the subnet level, we have to use NACL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;As per AWS documentation:&lt;/strong&gt;&lt;br&gt;
We recommend that you use network ACLs sparingly for the following reasons: they can be complex to manage, they are stateless, every IP address must be explicitly opened in each (inbound/outbound) direction, and they affect a complete subnet.&lt;/p&gt;

&lt;p&gt;More details on &lt;a href="https://docs.aws.amazon.com/quickstart/latest/vpc/security.html"&gt;&lt;strong&gt;NACL vs Security group differences&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In VPC dashboard, you will see other services as well like VPN, endpoints, endpoints service, transient gateway, VPC peering which we have not covered in this article. If you want to know more about these services, let me know. I will try to write those about as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;That was a lot. Hope you were able to understand these networking concepts. Now you can easily create infrastructure in AWS with this knowledge.&lt;br&gt;
Thanks a lot for reading. Let me know if you find this useful. It will motivate me to write more articles.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Terraform Best Practices</title>
      <dc:creator>Pankaj Kumar</dc:creator>
      <pubDate>Wed, 25 Dec 2019 11:52:34 +0000</pubDate>
      <link>https://dev.to/cryptic022/terraform-best-practices-2a1n</link>
      <guid>https://dev.to/cryptic022/terraform-best-practices-2a1n</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Original Post Published here : &lt;a href="https://pankajkumar.dev/"&gt;Terraform Best Practices&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Terraform is an open-source tool that allows you to define the infrastructure for a variety of cloud providers (e.g. AWS, Azure, Google Cloud, DigitalOcean, etc) using a simple, declarative programming language.&lt;/p&gt;

&lt;p&gt;This guide assumes that you have a basic idea of terraform. I have taken examples of Terraform with AWS provider. Concepts will be similar to other providers as well.&lt;/p&gt;

&lt;p&gt;I will be using this repo for explaining all the examples: &lt;a href="https://github.com/cryptic022/terraform-example"&gt;Terraform-examples&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Always use latest terraform version (Current version is terraform v0.12.x)
&lt;/h2&gt;

&lt;p&gt;We should always pick the latest terraform version. The reason is that sometimes terraform doesn't have backward compatibility. You will always be stuck with the chosen version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Always use var-file for terraform plan
&lt;/h2&gt;

&lt;p&gt;We should always use var-file for variables. It will be easy to maintain different variables for different environments and modules. There are different methods which can be used for variables like assign a string value to var variable, an Environment variable, var-file.&lt;br&gt;&lt;br&gt;
Checkout this guide for all options &lt;a href="https://bit.ly/2ZlVAaT"&gt;Input Variable guide&lt;/a&gt;&lt;br&gt;
Checkout this example &lt;a href="https://bit.ly/2s8Mken"&gt;Variable Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Manage s3 backend for tfstate files
&lt;/h2&gt;

&lt;p&gt;Whenever we create any resource with terraform (terraform apply), it maintains the state in tfstate file. Try to run &lt;a href="https://bit.ly/2s8Mken"&gt;Variable Example&lt;/a&gt;. It will create tfstate file in local. If we modify any resource or add, tfstate will be changed after each terraform apply.&lt;br&gt;
In the team , multiple team members will be modifying terraform code. So we should maintain tfstate at version control system (Example: S3).&lt;br&gt;
Checkout this example &lt;a href="https://bit.ly/2slW0Cf"&gt;S3 backend Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use dynamo db for locking tfstate modification
&lt;/h2&gt;

&lt;p&gt;Multiple team members will run terraform apply at the same time which can create issues. We should use dynamo DB for locking. It will not allow other terraform apply a process to change tfstate till the release of the lock.&lt;br&gt;
Checkout this example &lt;a href="https://bit.ly/2slW0Cf"&gt;S3 backend Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Enable version control on terraform state files bucket
&lt;/h2&gt;

&lt;p&gt;First, we should use s3 remote storage for managing tfstate. We should enable version control on this s3 remote.&lt;br&gt;
Reason: If any issue comes with current tfstate in production, we can always go back to the previous version.&lt;br&gt;
Checkout this example &lt;a href="https://bit.ly/2s8Mken"&gt;Variable Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use terraform import for existing resources
&lt;/h2&gt;

&lt;p&gt;Suppose we have created resources earlier. Now we want to use it with terraform code. It is possible with &lt;code&gt;terraform import&lt;/code&gt;. It will make these resources as part of terraform.&lt;br&gt;
Checkout this example &lt;a href="https://bit.ly/34Vhl2B"&gt;Import Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use shared modules
&lt;/h2&gt;

&lt;p&gt;Terraform community has shared generic modules on terraform registry like ecs-fargate , ecs-service, s3 bucket creation.&lt;br&gt;&lt;br&gt;
&lt;a href="https://registry.terraform.io/"&gt;Module Registry&lt;/a&gt;&lt;br&gt;
Checkout this example &lt;a href="https://bit.ly/2ZnNYVi"&gt;Share Module Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use terraform modules for mananging different environments(dev/stage/prod)
&lt;/h2&gt;

&lt;p&gt;A module is a container for multiple resources that are used together. We should use terraform modules for managing the code between different environment. Every terraform configuration has its root module which consists of resources defined in the .tf files in the main working directory. We wrap common resources in modules so it can be reused for a different environment. We can use the git version system for modules. Checkout share modules example. It is hosted on Github and we are directly using it.&lt;br&gt;
Checkout this example for modules structure: &lt;a href="https://github.com/cryptic022/terraform-example/tree/master/module-example"&gt;Module Example&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  If you want to learn terraform in detail, check out the below book:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://learning.oreilly.com/library/view/terraform-up/9781492046899/"&gt;Terraform in Detail&lt;/a&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>iac</category>
      <category>devops</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
