<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Joshua Welbeck's Tech blog]]></title><description><![CDATA[Learn about technology through insightful articles and guides.]]></description><link>https://blog.joshuawelbeck.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 10:36:37 GMT</lastBuildDate><atom:link href="https://blog.joshuawelbeck.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[1. Why Learn on the AWS Console First Before Using Terraform?]]></title><description><![CDATA[Introduction
Infrastructure as Code (IaC) has transformed how cloud infrastructure is managed, making deployments more scalable, reproducible, and efficient. However, before jumping into automation with Terraform, it's essential to first learn how to...]]></description><link>https://blog.joshuawelbeck.com/1-why-learn-on-the-aws-console-first-before-using-terraform</link><guid isPermaLink="true">https://blog.joshuawelbeck.com/1-why-learn-on-the-aws-console-first-before-using-terraform</guid><category><![CDATA[AWS]]></category><category><![CDATA[Terraform]]></category><dc:creator><![CDATA[Joshua Welbeck]]></dc:creator><pubDate>Mon, 17 Mar 2025 06:56:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/vZJdYl5JVXY/upload/8c0cf582d46494d75217cb224e070bb4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Infrastructure as Code (IaC) has transformed how cloud infrastructure is managed, making deployments more scalable, reproducible, and efficient. However, before jumping into automation with Terraform, it's essential to first learn how to create and manage resources using the cloud provider's console. This approach builds a strong foundation and helps avoid common pitfalls when transitioning to IaC.</p>
<h2 id="heading-why-start-with-the-cloud-console">Why Start with the Cloud Console?</h2>
<h3 id="heading-1-understanding-cloud-services-and-dependencies">1. <strong>Understanding Cloud Services and Dependencies</strong></h3>
<ul>
<li><p>Cloud providers offer a variety of services like compute, networking, and databases.</p>
</li>
<li><p>Creating resources manually helps you understand how different components interact.</p>
</li>
</ul>
<h3 id="heading-2-troubleshooting-and-debugging">2. <strong>Troubleshooting and Debugging</strong></h3>
<ul>
<li><p>When things go wrong in Terraform, knowledge of the console helps diagnose issues.</p>
</li>
<li><p>Knowing where to check logs, security settings, and dependencies is crucial.</p>
</li>
</ul>
<h3 id="heading-3-building-an-intuitive-mental-model">3. <strong>Building an Intuitive Mental Model</strong></h3>
<ul>
<li><p>Seeing the configurations in the UI makes it easier to relate them to Terraform code.</p>
</li>
<li><p>Helps in understanding default values, required parameters, and best practices.</p>
</li>
</ul>
<h3 id="heading-4-avoiding-the-black-box-effect">4. <strong>Avoiding the "Black Box" Effect</strong></h3>
<ul>
<li><p>Jumping straight into Terraform might lead to blindly copying configurations without truly understanding them.</p>
</li>
<li><p>Manual creation ensures you grasp how things work before automating them.</p>
</li>
</ul>
<h2 id="heading-step-by-step-manually-deploying-an-ec2-instance">Step-by-Step: Manually Deploying an EC2 Instance</h2>
<p>Let's walk through creating an EC2 instance manually in AWS to understand the process before automating it with Terraform.</p>
<h3 id="heading-1-navigate-to-ec2-in-the-aws-console"><strong>1. Navigate to EC2 in the AWS Console</strong></h3>
<ul>
<li><p>Log into your AWS account.</p>
</li>
<li><p>Go to the <strong>EC2 Dashboard</strong> and click on <strong>Launch Instance</strong>.</p>
</li>
</ul>
<h3 id="heading-2-choose-an-amazon-machine-image-ami"><strong>2. Choose an Amazon Machine Image (AMI)</strong></h3>
<ul>
<li><p>Select an OS (e.g., Amazon Linux, Ubuntu, Windows Server).</p>
</li>
<li><p>Understand why certain AMIs are better suited for specific workloads.</p>
</li>
</ul>
<h3 id="heading-3-select-an-instance-type"><strong>3. Select an Instance Type</strong></h3>
<ul>
<li><p>Choose a type based on compute power and memory needs (e.g., t2.micro for free-tier usage).</p>
</li>
<li><p>Learn about CPU, memory, and performance trade-offs.</p>
</li>
</ul>
<h3 id="heading-4-configure-instance-details"><strong>4. Configure Instance Details</strong></h3>
<ul>
<li><p>Set networking options (VPC, subnets, auto-assignment of public IPs).</p>
</li>
<li><p>Enable monitoring, IAM roles, and placement strategies.</p>
</li>
</ul>
<h3 id="heading-5-add-storage"><strong>5. Add Storage</strong></h3>
<ul>
<li>Define storage size, type (GP2, GP3 SSD, Magnetic, etc.), and encryption settings.</li>
</ul>
<h3 id="heading-6-configure-security-groups"><strong>6. Configure Security Groups</strong></h3>
<ul>
<li><p>Set inbound and outbound rules.</p>
</li>
<li><p>Understand why limiting access is crucial for security.</p>
</li>
</ul>
<h3 id="heading-7-launch-and-connect-to-the-instance"><strong>7. Launch and Connect to the Instance</strong></h3>
<ul>
<li>Connect via SSM.</li>
</ul>
<h2 id="heading-key-takeaways">Key Takeaways</h2>
<ul>
<li><p>Learning via the console helps you grasp cloud concepts, dependencies, and security settings.</p>
</li>
<li><p>Manual creation builds confidence before automating with Terraform.</p>
</li>
<li><p>Debugging Terraform issues becomes easier when you know how things work in the UI.</p>
</li>
</ul>
<h2 id="heading-whats-next">What’s Next?</h2>
<p>In the next article, we’ll take what we’ve learned and automate the deployment of an EC2 instance using Terraform. Stay tuned!</p>
]]></content:encoded></item><item><title><![CDATA[Store AWS SSM Session Logs in S3 for Long-Term Retention]]></title><description><![CDATA[Introduction
By default, AWS SSM Session Manager does not store logs permanently. While CloudWatch is great for real-time monitoring, S3 provides long-term log storage for security audits and compliance.  
This guide covers:✅ Creating an S3 bucket fo...]]></description><link>https://blog.joshuawelbeck.com/store-aws-ssm-session-logs-in-s3-for-long-term-retention</link><guid isPermaLink="true">https://blog.joshuawelbeck.com/store-aws-ssm-session-logs-in-s3-for-long-term-retention</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS s3]]></category><category><![CDATA[AWS Session Manager]]></category><dc:creator><![CDATA[Joshua Welbeck]]></dc:creator><pubDate>Fri, 28 Feb 2025 20:15:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/GNyjCePVRs8/upload/a52e5813b455ed9c7e98e218a4276996.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<p>By default, AWS SSM Session Manager does not store logs permanently. While CloudWatch is great for real-time monitoring, <strong>S3 provides long-term log storage</strong> for security audits and compliance.  </p>
<p>This guide covers:<br />✅ Creating an <strong>S3 bucket</strong> for SSM logs<br />✅ Enabling SSM session logging to S3<br />✅ Verifying logs are saved in S3  </p>
<h2 id="heading-step-1-create-an-s3-bucket-for-logging"><strong>Step 1: Create an S3 Bucket for Logging</strong></h2>
<ol>
<li>Navigate to <strong>AWS S3 Console</strong> → Click <strong>Create bucket</strong>.</li>
<li>Enter a <strong>unique bucket name</strong> (e.g., <code>ssm-session-logs-123</code>).</li>
<li>Choose the <strong>AWS region</strong> where your EC2 instances run.</li>
<li>Under <strong>Block Public Access settings</strong>, ensure public access is <strong>blocked</strong>.</li>
<li>Click <strong>Create bucket</strong>.</li>
</ol>
<h2 id="heading-step-2-attach-iam-permissions-for-s3-logging"><strong>Step 2: Attach IAM Permissions for S3 Logging</strong></h2>
<p>AWS SSM needs permission to write logs to the S3 bucket.</p>
<ol>
<li><strong>Go to</strong> the <strong>AWS IAM Console</strong> → Click <strong>Roles</strong>.</li>
<li>Select the IAM role attached to your EC2 instance (e.g., <code>SSMLoggingRole</code>).</li>
<li>Click <strong>Attach Policies</strong> → Choose <strong>AmazonS3FullAccess</strong>.</li>
<li>Click <strong>Save</strong>.</li>
</ol>
<h2 id="heading-step-3-enable-ssm-logging-to-s3"><strong>Step 3: Enable SSM Logging to S3</strong></h2>
<ol>
<li>Navigate to <strong>AWS Systems Manager Console</strong> → Click <strong>Session Manager</strong>.</li>
<li>In the left panel, click <strong>Preferences</strong>.</li>
<li>Click <strong>Edit</strong> and configure:<ul>
<li>✅ <strong>Enable S3 Logging</strong> → Select your <strong>S3 bucket</strong> from Step 1.</li>
</ul>
</li>
<li>Click <strong>Save</strong>.</li>
</ol>
<h2 id="heading-step-4-verify-logs-in-s3"><strong>Step 4: Verify Logs in S3</strong></h2>
<ol>
<li><strong>Start an SSM session</strong>:<pre><code class="lang-sh">aws ssm start-session --target &lt;INSTANCE_ID&gt;
</code></pre>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Enable CloudWatch Logging for AWS SSM Session Manager]]></title><description><![CDATA[Introduction
AWS Systems Manager (SSM) Session Manager provides secure access to EC2 instances, but logging session activity is crucial for auditing and compliance. By enabling CloudWatch logging, you can track who accessed instances, what commands w...]]></description><link>https://blog.joshuawelbeck.com/enable-cloudwatch-logging-for-aws-ssm-session-manager</link><guid isPermaLink="true">https://blog.joshuawelbeck.com/enable-cloudwatch-logging-for-aws-ssm-session-manager</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS CloudWatch]]></category><category><![CDATA[CloudWatch Logs]]></category><dc:creator><![CDATA[Joshua Welbeck]]></dc:creator><pubDate>Fri, 28 Feb 2025 20:14:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/YvZKRE9VFVE/upload/b7545fda80db00e74d20a52e5584ca42.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<p>AWS Systems Manager (SSM) Session Manager provides secure access to EC2 instances, but logging session activity is crucial for auditing and compliance. By enabling CloudWatch logging, you can track who accessed instances, what commands were run, and store logs securely.</p>
<h2 id="heading-step-1-create-a-cloudwatch-log-group"><strong>Step 1: Create a CloudWatch Log Group</strong></h2>
<ol>
<li>Navigate to <strong>AWS CloudWatch Console</strong> → Click <strong>Logs</strong> → <strong>Log groups</strong>.</li>
<li>Click <strong>Create log group</strong>.</li>
<li>Enter a <strong>Log Group Name</strong> (e.g., <code>/aws/ssm/session-logs</code>).</li>
<li>Choose an appropriate <strong>Retention period</strong>.</li>
<li>Click <strong>Create</strong>.</li>
</ol>
<h2 id="heading-step-2-update-iam-role-to-allow-logging"><strong>Step 2: Update IAM Role to Allow Logging</strong></h2>
<p>The IAM role attached to EC2 instances must have permission to write to CloudWatch Logs.</p>
<ol>
<li>Go to <strong>AWS IAM Console</strong> → <strong>Roles</strong>.</li>
<li>Find and select the <code>EC2SSMRole</code> role used for SSM.</li>
<li>Click <strong>Attach Policies</strong> → Search for <code>CloudWatchLogsFullAccess</code> (or create a custom policy if needed).</li>
<li>Click <strong>Attach policy</strong>.</li>
</ol>
<h2 id="heading-step-3-enable-session-logging-in-ssm"><strong>Step 3: Enable Session Logging in SSM</strong></h2>
<ol>
<li>Go to <strong>AWS Systems Manager Console</strong> → <strong>Session Manager</strong>.</li>
<li>Click <strong>Preferences</strong>.</li>
<li>Click <strong>Edit</strong> and enable <strong>Session logging</strong>.</li>
<li>Select <strong>CloudWatch Logs</strong>.</li>
<li>Choose the <strong>Log group</strong> created in Step 1 (<code>/aws/ssm/session-logs</code>).</li>
<li>Click <strong>Save</strong>.</li>
</ol>
<h2 id="heading-step-4-start-a-session-and-verify-logging"><strong>Step 4: Start a Session and Verify Logging</strong></h2>
<ol>
<li>Open a new SSM session:<pre><code class="lang-sh">aws ssm start-session --target &lt;INSTANCE_ID&gt;
</code></pre>
</li>
<li>Run some commands inside the session.</li>
<li>Check the <strong>CloudWatch Logs Console</strong> → Navigate to <code>/aws/ssm/session-logs</code> to see logs.</li>
</ol>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<ul>
<li><strong>Enhanced security and auditing</strong> with detailed session logs.</li>
<li><strong>Easy tracking of user actions</strong> for compliance and troubleshooting.</li>
<li><strong>Seamless integration with CloudWatch</strong> for centralized logging.</li>
</ul>
<p>Now your SSM sessions are fully logged and auditable! 🚀</p>
]]></content:encoded></item><item><title><![CDATA[Ditch SSH: Securely Connect to EC2 with AWS SSM Session Manager]]></title><description><![CDATA[Introduction
Why move away from SSH?

Managing SSH keys is a hassle
Open SSH ports expose security risks
No built-in logging for SSH sessions

What is AWS Systems Manager (SSM) Session Manager?

Secure, agent-based access to EC2
Works over AWS APIs, ...]]></description><link>https://blog.joshuawelbeck.com/ditch-ssh-securely-connect-to-ec2-with-aws-ssm-session-manager</link><guid isPermaLink="true">https://blog.joshuawelbeck.com/ditch-ssh-securely-connect-to-ec2-with-aws-ssm-session-manager</guid><category><![CDATA[AWS]]></category><category><![CDATA[AWS SSM]]></category><category><![CDATA[ssh]]></category><dc:creator><![CDATA[Joshua Welbeck]]></dc:creator><pubDate>Fri, 28 Feb 2025 20:10:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/_Kmtj6UIlGo/upload/f7f899a09ba66d35598d4bac83fc51cf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<h3 id="heading-why-move-away-from-ssh">Why move away from SSH?</h3>
<ul>
<li>Managing SSH keys is a hassle</li>
<li>Open SSH ports expose security risks</li>
<li>No built-in logging for SSH sessions</li>
</ul>
<h3 id="heading-what-is-aws-systems-manager-ssm-session-manager">What is AWS Systems Manager (SSM) Session Manager?</h3>
<ul>
<li>Secure, agent-based access to EC2</li>
<li>Works over AWS APIs, no open ports required</li>
</ul>
<blockquote>
<p><strong>Note:</strong> Enabling SSM does not automatically disable SSH. If you previously used SSH, it will still be available unless explicitly disabled.</p>
</blockquote>
<h2 id="heading-step-1-create-an-iam-role-for-ssm"><strong>Step 1: Create an IAM Role for SSM</strong></h2>
<p>Before launching an EC2 instance, create an IAM role with the necessary permissions:</p>
<ol>
<li>Go to the <strong>AWS IAM Console</strong> → Click <strong>Roles</strong> → Click <strong>Create Role</strong></li>
<li>Select <strong>AWS Service</strong> → Choose <strong>EC2</strong> as the trusted entity</li>
<li>Attach the policy <strong>AmazonSSMManagedInstanceCore</strong></li>
<li>Name the role (e.g., <code>EC2SSMRole</code>) and create it</li>
</ol>
<p>This role will allow your EC2 instance to communicate with AWS Systems Manager.</p>
<h2 id="heading-step-2-create-an-ec2-instance-for-new-instances"><strong>Step 2: Create an EC2 Instance</strong> (For New Instances)</h2>
<p>If you don’t have an EC2 instance yet, follow these steps:</p>
<ol>
<li>Go to <strong>AWS EC2 Console</strong> → Click <strong>Launch Instance</strong></li>
<li>Choose <strong>Amazon Linux 2</strong> (or Ubuntu)</li>
<li>In the IAM Role section, select the <strong>EC2SSMRole</strong> (created in Step 1).</li>
<li>Launch the instance</li>
</ol>
<blockquote>
<p><strong>Important:</strong> If you select the IAM role during instance creation, the SSM Agent will be preinstalled and no manual installation is required.</p>
<p><strong>If you skipped adding the IAM role, you may need to manually install the SSM Agent (see Step 3).</strong></p>
</blockquote>
<h2 id="heading-step-3-enable-ssm-on-existing-instances"><strong>Step 3: Enable SSM on Existing Instances</strong></h2>
<blockquote>
<p><strong>Skip this step if you selected the IAM role during instance creation.</strong></p>
</blockquote>
<p>If your EC2 instance is already running and does not have the SSM Agent installed, follow these steps:</p>
<h3 id="heading-attach-iam-role-to-an-existing-instance"><strong>Attach IAM Role to an Existing Instance</strong></h3>
<ol>
<li>Navigate to <strong>AWS EC2 Console</strong> → Select your instance</li>
<li>Click <strong>Actions</strong> → <strong>Security</strong> → <strong>Modify IAM Role</strong></li>
<li>Attach the <code>EC2SSMRole</code> created in Step 1</li>
</ol>
<h3 id="heading-manually-install-the-ssm-agent"><strong>Manually Install the SSM Agent</strong></h3>
<p>For <strong>Amazon Linux 2 &amp; RHEL</strong>:</p>
<pre><code class="lang-sh">sudo yum install -y amazon-ssm-agent
sudo systemctl <span class="hljs-built_in">enable</span> amazon-ssm-agent
sudo systemctl start amazon-ssm-agent
</code></pre>
<p>For <strong>Ubuntu</strong>:</p>
<pre><code class="lang-sh">sudo snap install amazon-ssm-agent --classic
sudo systemctl <span class="hljs-built_in">enable</span> amazon-ssm-agent
sudo systemctl start amazon-ssm-agent
</code></pre>
<p>Verify installation:</p>
<pre><code class="lang-sh">sudo systemctl status amazon-ssm-agent
</code></pre>
<h2 id="heading-step-4-connect-to-ec2-via-ssm"><strong>Step 4: Connect to EC2 via SSM</strong></h2>
<h3 id="heading-option-1-aws-console"><strong>Option 1: AWS Console</strong></h3>
<ol>
<li>Navigate to <strong>AWS Systems Manager &gt; Session Manager</strong></li>
<li>Select your EC2 instance and click <strong>Start Session</strong></li>
</ol>
<h3 id="heading-option-2-aws-cli"><strong>Option 2: AWS CLI</strong></h3>
<p>Run the following command to start an SSM session:</p>
<pre><code class="lang-sh">aws ssm start-session --target &lt;INSTANCE_ID&gt;
</code></pre>
<h2 id="heading-step-5-disable-ssh-access-highly-recommended"><strong>Step 5: Disable SSH Access (Highly Recommended)</strong></h2>
<blockquote>
<p><strong>Important:</strong> If you previously used SSH, it remains enabled unless manually disabled.</p>
</blockquote>
<h3 id="heading-using-aws-console"><strong>Using AWS Console</strong></h3>
<ol>
<li>Navigate to <strong>EC2 &gt; Security Groups</strong> in the AWS Console.</li>
<li>Select the security group attached to your EC2 instance.</li>
<li>In the <strong>Inbound rules</strong> tab, locate the rule allowing SSH (port 22).</li>
<li>Click <strong>Edit inbound rules</strong>, remove the SSH rule, and save changes.</li>
</ol>
<h3 id="heading-using-aws-cli"><strong>Using AWS CLI</strong></h3>
<pre><code class="lang-sh">aws ec2 revoke-security-group-ingress --group-id &lt;SECURITY_GROUP_ID&gt; --protocol tcp --port 22 --cidr 0.0.0.0/0
</code></pre>
<h3 id="heading-disable-ssh-service-on-ec2"><strong>Disable SSH Service on EC2</strong></h3>
<ol>
<li>Stop and disable the SSH service:<pre><code class="lang-sh">sudo systemctl stop sshd
sudo systemctl <span class="hljs-built_in">disable</span> sshd
</code></pre>
</li>
<li>To check that SSH is disabled, run:<pre><code class="lang-sh">sudo systemctl status sshd
</code></pre>
</li>
</ol>
<h2 id="heading-step-6-enable-logging-for-auditing-optional-but-recommended"><strong>Step 6: Enable Logging for Auditing (Optional but Recommended)</strong></h2>
<ul>
<li>Configure <a target="_blank" href="https://blog.joshuawelbeck.com/enable-cloudwatch-logging-for-aws-ssm-session-manager"><strong>AWS CloudWatch Logs</strong></a> to record all session activity</li>
<li>Set up an <a target="_blank" href="https://blog.joshuawelbeck.com/store-aws-ssm-session-logs-in-s3-for-long-term-retention"><strong>S3 bucket</strong></a> for long-term storage</li>
</ul>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<ul>
<li><strong>No more SSH key management</strong></li>
<li><strong>Increased security</strong> (no open ports)</li>
<li><strong>Built-in logging and auditing</strong></li>
<li><strong>Easier access control using IAM policies</strong></li>
<li><strong>Option to fully disable SSH for enhanced security</strong></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Terraform Basics]]></title><description><![CDATA[Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp. It allows users to define, provision, and manage infrastructure across various cloud providers (like AWS, Azure, and GCP) and on-premises environments using a decla...]]></description><link>https://blog.joshuawelbeck.com/terraform-basics</link><guid isPermaLink="true">https://blog.joshuawelbeck.com/terraform-basics</guid><category><![CDATA[Terraform]]></category><category><![CDATA[#IaC]]></category><dc:creator><![CDATA[Joshua Welbeck]]></dc:creator><pubDate>Wed, 27 Nov 2024 11:23:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1732706584490/edc049b3-6528-45f0-828a-d65db2074de8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp. It allows users to define, provision, and manage infrastructure across various cloud providers (like AWS, Azure, and GCP) and on-premises environments using a declarative configuration language known as <strong>HCL (HashiCorp Configuration Language)</strong>.</p>
<p>Terraform is popular because:</p>
<ul>
<li><p>It supports multiple cloud providers (AWS, Azure, Google Cloud).</p>
</li>
<li><p>It provides a unified workflow.</p>
</li>
<li><p>It maintains an infrastructure state file to track resources.</p>
</li>
<li><p>It uses a modular approach to manage complex systems.</p>
</li>
</ul>
<hr />
<h3 id="heading-key-terraform-commands"><strong>Key Terraform Commands</strong></h3>
<p>Here are the most common terraform commands you will run into:</p>
<h4 id="heading-1-terraform-init">1. <code>terraform init</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Prepares the working directory for Terraform operations.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Downloads provider plugins.</p>
</li>
<li><p>Initializes the backend for storing the Terraform state.</p>
</li>
<li><p>Verifies the configuration files.</p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-2-terraform-validate">2. <code>terraform validate</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Checks the configuration files for syntax or logical errors.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Ensures that the configuration is syntactically valid.</p>
</li>
<li><p>Validates against the provider's schema but does not connect to the cloud.</p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-3-terraform-fmt">3. <code>terraform fmt</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Formats the configuration files to match the standard style conventions.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Ensures consistent indentation and spacing.</p>
</li>
<li><p>Makes code easier to read and maintain.</p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-4-terraform-plan">4. <code>terraform plan</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Creates an execution plan showing what actions Terraform will take.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Highlights the changes required to achieve the desired state.</p>
</li>
<li><p>Outputs actions like resource additions, modifications, or deletions without applying them.</p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-5-terraform-apply">5. <code>terraform apply</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Executes the actions defined in the execution plan created by <code>terraform plan</code>.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Creates, updates, or deletes resources in the infrastructure.</p>
</li>
<li><p>Requires user confirmation before execution unless the <code>-auto-approve</code> flag is used.</p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-6-terraform-plan-destroy">6. <code>terraform plan -destroy</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Simulates the destruction of resources without actually executing it.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Generates a plan detailing which resources will be removed.</p>
</li>
<li><p>Useful for previewing the impact of a <code>terraform destroy</code> command.</p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-7-terraform-destroy">7. <code>terraform destroy</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Removes all resources defined in the Terraform configuration.</p>
</li>
<li><p><strong>Note</strong>: Always run <code>terraform plan -destroy</code> before running any <code>terraform destroy</code></p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Deletes the infrastructure safely and ensures resources are destroyed in the correct order.</p>
</li>
<li><p>You can also target specific resources using the <strong>target</strong> flag instead of destroying all the resources.</p>
</li>
<li><p>eg. <code>terraform destroy --target aws_instance.instance_name</code></p>
</li>
</ul>
</li>
</ul>
<h4 id="heading-8-terraform-import">8. <code>terraform import</code></h4>
<ul>
<li><p><strong>Purpose</strong>: Brings existing infrastructure into Terraform's management.</p>
</li>
<li><p><strong>What it does</strong>:</p>
<ul>
<li><p>Adds resources not originally created with Terraform to the state file.</p>
</li>
<li><p>Does not generate configuration files automatically; you must write the configuration manually.</p>
</li>
</ul>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Handy Linux terminal commands for beginners]]></title><description><![CDATA[1. Accessing the help pages
Here are two ways to view the help or manual page of any Linux command.
a.    man command – Manual. 
This command is used to view the user manual page for any Linux command.
Syntax:  man [command]
To run it simply type man...]]></description><link>https://blog.joshuawelbeck.com/handy-linux-terminal-commands-for-beginners</link><guid isPermaLink="true">https://blog.joshuawelbeck.com/handy-linux-terminal-commands-for-beginners</guid><category><![CDATA[Linux]]></category><category><![CDATA[terminal command]]></category><category><![CDATA[linux for beginners]]></category><category><![CDATA[linux-basics]]></category><dc:creator><![CDATA[Joshua Welbeck]]></dc:creator><pubDate>Sun, 24 Apr 2022 13:35:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1650822918721/mU5eCrZXd.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>1. Accessing the help pages</strong></p>
<p>Here are two ways to view the help or manual page of any Linux command.</p>
<p><strong>a.    man</strong> command – Manual. </p>
<p>This command is used to view the user manual page for any Linux command.</p>
<p>Syntax:  man [command]</p>
<p>To run it simply type <strong>man</strong> followed by the command you want to view the manual page for.</p>
<p>eg.  <code>man man</code>
 – This will display the manual page for the <strong>man</strong> command</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650805884379/6GtoXYfJW.png" alt="man page.png" /></p>
<ul>
<li><p>Press h in the man page to view the help section of the manual</p>
</li>
<li><p>To exit the man page, press q on the keyboard</p>
</li>
</ul>
<p><strong>b. --help</strong> command - This provides information on a particular command.</p>
<p>Syntax: [command] --help</p>
<p>Eg. <code>man --help</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650805897198/WtMbUBsAX.png" alt="help.png" /></p>
<p><strong>2. Working with files and directories (folders)</strong></p>
<p>One of the most common tasks we perform on our computers is navigating directories or folders using a GUI application like <strong>Windows Explorer</strong> in Microsoft Windows or <strong>Finder</strong> in Apple MacOS. 
Below are some commands for performing common tasks when working with files and folders:</p>
<p><strong>a.    pwd</strong> command – Print working directory.</p>
<p>This command shows you the folder you are currently working in.</p>
<p>Command: <code>pwd</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806052563/EOpnVJFNJ.png" alt="pwd.png" /></p>
<p>From the image above, the <strong>pwd</strong> command shows that I am working in the /home/josh directory.</p>
<p><strong>b.    ls</strong> command – List</p>
<p>This command is used to display the contents of a folder</p>
<p>Command: <code>ls</code></p>
<p>This will display the contents of the current folder.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806061057/DAvjhKeQB.png" alt="ls.png" /></p>
<p><strong>c.    mkdir</strong> command – Make directory</p>
<p>This command is used to create a folder or directory</p>
<p>Syntax: mkdir [foldername]</p>
<p>Eg. <code>mkdir tutorials</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806095241/da1eaqUyz.png" alt="mkdir.png" /></p>
<p>In this example, I created a folder called <strong>tutorials</strong>, then I used the <code>ls</code> command to confirm that it was created.</p>
<p><strong>d.    cd</strong> command – change directory</p>
<p>This is used to navigate to a different directory or folder.</p>
<p>Syntax: cd [foldername]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806269365/F986hHqAG.png" alt="cd.png" /></p>
<p>Eg. <code>cd tutorials</code></p>
<p>This will change my working directory to the <strong>tutorials</strong> directory.
This means that my current working directory will change from <strong>/home/josh</strong> to <strong>/home/josh/tutorials</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806299317/_W163mICZ.png" alt="cd 2.png" /></p>
<p><strong>e.    cp</strong> command – Copy </p>
<p>This command is used to create a copy of a file</p>
<p>Syntax – cp [source] [destination]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806360403/hlE_YXR6z.png" alt="cp.png" /></p>
<p>Eg. 1. <code>cp file1.txt notes.txt</code></p>
<p>This will create a copy of <strong>file1.txt</strong> and name the copy <strong>notes.txt</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806373563/Fo0eEYWQv.png" alt="cp 2.png" /></p>
<p>Eg. 2. <code>cp file1.txt tutorials/</code></p>
<p>This will create a copy of <strong>file1.txt</strong> in the <strong>tutorials</strong> folder.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806459973/YkJSiHp1u.png" alt="cp 3.png" /></p>
<p><strong>f.    mv</strong> command – Move</p>
<p>This command has two uses – 
It can be used to <strong>move</strong> files from one location to another.
It can also used to <strong>rename</strong> files or directories.</p>
<p>Eg. 1. Moving <strong>file1.txt</strong> to the <strong>tutorials</strong> directory</p>
<p>Command: <code>mv file1.txt tutorials</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806479984/RsEGA0RD2.png" alt="mv.png" /></p>
<p><strong>File1.txt</strong> is now in the <strong>tutorials</strong> directory</p>
<p>Eg. 2. Renaming a file with mv</p>
<p>Command: <code>mv file1.txt renamed.txt</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806487585/tdJrN4QA9.png" alt="mv 2.png" /></p>
<p>This changes the name of <strong>file1.txt</strong> to <strong>renamed.txt</strong></p>
<p><strong>g.    rm</strong> command – Remove</p>
<p>This is used to delete files.</p>
<p>Syntax: rm [filename]</p>
<p>Eg. Deleting <strong>renamed.txt</strong></p>
<p>Command: <code>rm renamed.txt</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650806529003/dBicLAWTs.png" alt="rm.png" /></p>
<p>You can view more information about all the commands used by accessing their respective <strong>help</strong> and <strong>manual</strong> pages.</p>
]]></content:encoded></item></channel></rss>