<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cloud Infrastructure on Sagar Panda | DevOps &amp; Cloud Infra Engineer</title><link>https://sagarpanda.com/categories/cloud-infrastructure/</link><description>Recent content in Cloud Infrastructure on Sagar Panda | DevOps &amp; Cloud Infra Engineer</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 22 Dec 2024 19:26:10 +0530</lastBuildDate><atom:link href="https://sagarpanda.com/categories/cloud-infrastructure/index.xml" rel="self" type="application/rss+xml"/><item><title>Terraform Modules - Simplify, Organise and Reuse Your IAC</title><link>https://sagarpanda.com/blogs/terraform/tf-module/</link><pubDate>Sun, 22 Dec 2024 19:26:10 +0530</pubDate><guid>https://sagarpanda.com/blogs/terraform/tf-module/</guid><description>&lt;p&gt;A &lt;strong&gt;Terraform module&lt;/strong&gt; is a container/template for multiple resources that are used together. Modules are a way to organize and reuse code in Terraform, making infrastructure management more efficient and maintainable.&lt;/p&gt;
&lt;p&gt;We first define the resource templates, and then we call the templates from outside of the module structures and we can even modify them as per our needs.&lt;/p&gt;
&lt;p&gt;A typical module module looks something this this:&lt;/p&gt;
&lt;div
 class="code-block-container border-border bg-card my-6 overflow-hidden rounded-xl border shadow-sm transition-all duration-200 ease-out hover:-translate-y-0.5 hover:shadow-md"
 data-code-block
 data-code-id="code-0"
 data-collapsible="true"
 data-default-state="expanded"
 data-collapsed="false"
 data-auto-collapse-lines="30"
 data-auto-collapse-height="400"
 data-collapsed-height="120"
&gt;
 
 &lt;div
 class="code-block-header bg-muted/30 border-border flex items-center justify-between border-b px-4 py-3"
 &gt;
 
 &lt;div class="flex items-center gap-2"&gt;
 &lt;div class="text-muted-foreground shrink-0"&gt;
 &lt;svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"&gt;
 &lt;path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" /&gt;
&lt;/svg&gt;
 &lt;/div&gt;
 &lt;span class="text-muted-foreground text-sm font-medium"&gt;
 PLAINTEXT
 &lt;/span&gt;
 &lt;/div&gt;

 
 &lt;div class="flex items-center gap-2"&gt;
 &lt;button
 class="collapse-code-btn text-muted-foreground hover:text-primary hover:bg-primary/10 focus:ring-primary/20 flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-all duration-200 ease-out focus:ring-2 focus:outline-none"
 type="button"
 data-code-action="toggle-collapse"
 data-label-expand="Expand"
 data-label-collapse="Collapse"
 title="Collapse"
 aria-label="Collapse"
 aria-controls="code-0"
 aria-expanded="true"
 &gt;
 &lt;span class="collapse-chevron transition-transform duration-200 ease-out"&gt;
 &lt;svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"&gt;
 &lt;path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /&gt;
&lt;/svg&gt;
 &lt;/span&gt;
 &lt;span class="collapse-text hidden sm:inline"&gt;Collapse&lt;/span&gt;
 &lt;/button&gt;
 &lt;button
 class="copy-code-btn text-muted-foreground hover:text-primary hover:bg-primary/10 focus:ring-primary/20 flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-all duration-200 ease-out focus:ring-2 focus:outline-none"
 type="button"
 data-code-action="copy"
 data-label-copy="Copy"
 data-label-copied="Copied"
 title="Copy"
 aria-label="Copy"
 &gt;
 &lt;span class="copy-icon"&gt;
 &lt;svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"&gt;
 &lt;path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /&gt;
&lt;/svg&gt;
 &lt;/span&gt;
 &lt;span class="copy-text hidden sm:inline"&gt;Copy&lt;/span&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;

 
 &lt;div class="code-block-content relative" id="code-0"&gt;
 &lt;pre tabindex="0"&gt;&lt;code&gt;.
├── main.tf
├── outputs.tf
├── README.md
└── variables.tf&lt;/code&gt;&lt;/pre&gt;
 &lt;div hidden data-code-source&gt;.
├── main.tf
├── outputs.tf
├── README.md
└── variables.tf&lt;/div&gt;
 
 &lt;div
 class="collapse-overlay to-card/90 pointer-events-none absolute inset-0 bg-linear-to-b from-transparent via-transparent opacity-0 transition-opacity duration-300"
 hidden
 &gt;
 &lt;button
 class="collapse-overlay-btn text-muted-foreground bg-card/80 border-border/50 hover:bg-primary/10 hover:text-primary hover:border-primary/30 absolute bottom-4 left-1/2 flex -translate-x-1/2 items-center justify-center rounded-full border p-2 backdrop-blur-sm transition-all duration-200"
 type="button"
 data-code-action="expand"
 aria-label="Expand"
 title="Expand"
 &gt;
 &lt;svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"&gt;
 &lt;path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /&gt;
&lt;/svg&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Automate AWS VPC Setup with Terraform</title><link>https://sagarpanda.com/blogs/terraform/terraform-aws-vpc/</link><pubDate>Fri, 20 Sep 2024 19:26:10 +0530</pubDate><guid>https://sagarpanda.com/blogs/terraform/terraform-aws-vpc/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;a href="#introduction" class="heading-anchor" aria-label="Link to this section"&gt;&lt;svg class="h-4 w-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"&gt;&lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The VPC is a logical private network that allows us to control how our resources, like servers, are connected and protected.&lt;/p&gt;
&lt;p&gt;With the help of VPC, we decide the range of IP addresses for the network, how we can divide the network into smaller parts, data flow into &amp;amp; out and rules for securing our resource.&lt;/p&gt;</description></item><item><title>Dynamic Data fetching — Data Sources in Terraform/OpenTofu</title><link>https://sagarpanda.com/blogs/terraform/terraform5/</link><pubDate>Sun, 12 May 2024 10:26:10 +0530</pubDate><guid>https://sagarpanda.com/blogs/terraform/terraform5/</guid><description>&lt;p&gt;I have migrated of OpenTofu. If you wish to migrate, the process is pretty simple.&lt;/p&gt;
&lt;p&gt;Steps to migrate existing terraform infra:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a
 href="https://opentofu.org/docs/intro/install/"target="_blank"
 rel="noopener noreferrer"
 class="inline-flex items-center gap-1"
 &gt;Install opentofu&lt;svg class="h-3 w-3 flex-shrink-0" id="external-link" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/&gt;&lt;/svg&gt;
 &lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Initialize opentofu just as you do with terraform.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;tofu init, tofu apply, tofu destroy etc. every command remain the same. Once you init, the provider info will be updated with tofu registry.&lt;/p&gt;</description></item><item><title>Terraform on AWS — Outputs, Indexing and Variables</title><link>https://sagarpanda.com/blogs/terraform/terraform2/</link><pubDate>Sun, 09 Jul 2023 10:26:10 +0530</pubDate><guid>https://sagarpanda.com/blogs/terraform/terraform2/</guid><description>&lt;p&gt;&lt;a
 href="https://sagarpanda.com/blogs/terraform/terraform-setup/"&gt;&lt;strong&gt;&lt;em&gt;In the previous article&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;, we setup tf and got familiar with it with basic example. Now lets proceed further.&lt;/p&gt;
&lt;p&gt;All configs can be found on &lt;a
 href="https://github.com/sagarkrp/Terraform_Automation"target="_blank"
 rel="noopener noreferrer"
 class="inline-flex items-center gap-1"
 &gt;GitHub&lt;svg class="h-3 w-3 flex-shrink-0" id="external-link" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/&gt;&lt;/svg&gt;
 &lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="displaying-output-in-tf"&gt;Displaying Output in TF:&lt;a href="#displaying-output-in-tf" class="heading-anchor" aria-label="Link to this section"&gt;&lt;svg class="h-4 w-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"&gt;&lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For every action we create we can generate output also to be shown on the terminal.&lt;/p&gt;</description></item><item><title>Infrastructure as Code (IAC) - Automation using Terraform 101</title><link>https://sagarpanda.com/blogs/terraform/terraform-setup/</link><pubDate>Sun, 02 Jul 2023 10:26:10 +0530</pubDate><guid>https://sagarpanda.com/blogs/terraform/terraform-setup/</guid><description>&lt;h2 id="what-is-terraform"&gt;What is Terraform:&lt;a href="#what-is-terraform" class="heading-anchor" aria-label="Link to this section"&gt;&lt;svg class="h-4 w-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"&gt;&lt;g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"&gt;&lt;path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/&gt;&lt;path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Terraform is an open-source infrastructure as code (IAC) tool that helps us to safely and predictably provision and manage infrastructure in any cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share.&lt;/p&gt;</description></item></channel></rss>