Cloud Institution

Terraform

Illustration of running your first Terraform program on AWS with a Terraform logo.
AWS, Cloud Computing, DevOps, Terraform

Running your First Terraform Program on AWS

Run Your First Terraform Program on AWS Terraform is an open-source infrastructure as code tool that allows you to build, change, and manage infrastructure in a consistent and repeatable manner using simple configuration files.  If you’re new to Terraform and looking to leverage its power for managing infrastructure on AWS, this guide is for you. Terraform on AWS is the Infrastructure as Code (IaC) tool, simplifies cloud resource provisioning, allowing you to automate and manage infrastructure efficiently. Let’s dive into how to run your first Terraform program on AWS. 1. Prerequisites 1.1 AWS Account Set up an AWS account at aws.amazon.com 1.2 Terraform Installation  Download and install Terraform 1.3 Visual Studio Code Installation Install Visual Studio Code (VS Code). Install the HashiCorp Terraform extension in VS Code for syntax support and code completion.  After Installing the extension, Set Up the Project Directory. 1.4 Set Up the Project Directory Create a new folder for your Terraform project files. Inside this folder, create a new file named main.tf Now, go to AWS Terraform Provider : Please navigate to the Provider section to obtain the base configuration code. Copy this code and paste it into your main.tf file for use in your Terraform project. Here is the Code, Terraform provider  Copy this code and paste it in main.tfterraform {required_providers {aws = {source = “hashicorp/aws”version = “5.75.1”}}}provider “aws” {# Configuration options} Copy this code and paste it in main.tf To Configure the aws into terraform, go terminal type the following commands   Type aws configure and give enter : After applying commands, it will ask you to enter the aws access key id   To get the Access ID, go to AWS console and go to the Security Credentials. Go to Create Access key and create the key After creating, you will get the Access key and Secret Access key Copy the Access key and paste it in the terminal After entering the access and secret keys, it will prompt you for the region and output format. Leave it as it is and press Enter.   Now we should run our code. To run the resources, type the following commands: terraform init The terraform init command initializes your working directory by downloading provider plugins, setting up backend configuration, loading modules, and preparing Terraform to manage infrastructure based on your configuration files.Before we move on  to next step, we will add one IAM user using terraform. Go to the aws terraform provider and search IAM. You will get the code to create IAM using terraform. Here is the code, aws_iam_user Copy the code and paste it in our main.tf file provider “aws” {region = “us-east-1” # Change to your desired AWS region}resource “aws_iam_user” “example_user” {name = “example-user” # Define the IAM user name} Here you can add any name and any region to create IAM Users Now give the command called terraform plan The terraform plan command previews changes Terraform will make to align the actual infrastructure with your configuration, and give the blue print like structure.     Now follow the command called terraform apply The terraform apply command executes the planned changes, creating, updating and resources to match your configuration   Give yes to perform actions . You have successfully initialized your first Terraform code configuration in AWS. To check the IAM user, go to the aws console and search iam and go to users The user was successfully added   Now the last command called terraform destroy  Give yes to make destroy all resources. The terraform destroy command removes all resources managed by Terraform in your configuration, effectively deleting the infrastructure. To check, go to the aws console and go to the IAM Users Here there is no resource to display, because the resource was destroyed using terraform   Thus the users to display. For  more AWS Question and Answer Click here  Stay Updated! Follow us on Facebook, LinkedIn, and Instagram for the latest updates, success stories, and career tips. For  more information Visit Cloud Institution 

Terraform Installation Using Windows displayed in bold white letters.
DevOps, Terraform

Terraform Installation on Windows

Terraform Installation on Windows Master the process of installing Terraform on Windows with our comprehensive guide. First and foremost, not only do we provide clear, step-by-step instructions to help you set up Terraform efficiently, but we also empower you to manage and automate your infrastructure as code seamlessly. In addition, as you follow along, you’ll learn how to configure your environment properly, optimize your workflow, and start automating your infrastructure effortlessly. Furthermore, this guide is perfect for both beginners looking to get started and experienced professionals aiming to streamline their DevOps practices. Ultimately, by the end, you’ll have the confidence and skills to take full advantage of Terraform’s capabilities. How to Install Terraform on Windows: Step-by-Step Guide Step 1 :Download Terraform for Windows . To get started with Terraform on Windows, you’ll need to download the installer. Visit the official Terraform website click here. Step 2: Download the ARM64 Version for Windows. If your computer uses a 64-bit ARM architecture, follow these steps:       1.Locate and click on the “ARM64” option under the Windows section to download the 64-bit ARM version of Terraform.     2.This will start the download of a .zip file containing the Terraform executable specifically built for ARM-based Windows systems. Step 3 : Create a New Folder called terraform in C: drive and then  Extract the Zip File. Step 4 : Open Environment Variables Settings        1.Open the Start Menu: Click on the Windows icon on your taskbar or press the Windows key on your keyboard.      2.Type “Environment Variables”: In the search bar, start typing Environment Variables. You should see an option labeled Edit the system environment variables appear in the search results.                    Step 5 : click Environment Variables, the Environment Variables window will open. Here, you can view and modify the environment variables for your system Step 6: In the Environment Variables window, click the PATH Variable and then click the Edit button. This will open the Edit Environment Variable window, where you can add the path. Step 7: Copy a Path which is created in the C: drive folder called terraform.  In the Edit Environment Variable window, click the New button.  Step 8: Once the path is added, click OK to save the changes and close the Edit Environment Variable window. Finally, click OK in the Environment Variables window to apply all changes. Step 9: To Verify Terraform Installation, Open the Command Prompt. Type the following command and press Enter terraform –version   If Terraform was installed and configured correctly, as a result the terminal should display the version of Terraform installed, like this:                    After following the steps for downloading, extracting, and configuring Terraform, you have successfully installed it on your Windows system.   Welcome to Cloud Institution – Your Pathway to Mastery in IT & Cloud Technologies Are you ready to embark on a journey that transforms your career in the world of IT? Firstly, welcome to Cloud Institution, Bangalore’s premier destination for mastering cutting-edge technologies. Moreover, our institution is at the core of BTM Layout and is committed to providing world-class training that empowers you to excel in today’s competitive tech landscape. Why Choose Cloud Institution?    1.Expert Instructors & Full-Time Trainers At Cloud Institution, we take pride in our team of certified, seasoned professionals who bring real-world experience and a passion for teaching. Our full-time trainers are dedicated to helping you understand complex concepts and equipping you with the practical skills required for success.   2.Comprehensive Course Offerings We offer a wide range of industry-relevant courses that keep you at the forefront of technology: Cloud Computing at Cloud Institution: Master the Future with Our Cloud Computing Courses: Hands-On Training, Expert Guidance, and Global Certification to Elevate Your IT Career! AWS (Amazon Web Services) at Cloud Institution: Master the most widely adopted cloud platform, with in-depth training on AWS services and tools. Azure at Cloud Institution: Dive into Microsoft’s powerful cloud computing services, from infrastructure to advanced development. Python Full Stack at Cloud Institution: Gain expertise in front-end and back-end web development using Python, one of the most in-demand programming languages. Java Full Stack at Cloud Institution: Build scalable, efficient applications with our comprehensive Java Full Stack training. DevOps at Cloud Institution: Learn the practices and tools that ensure faster delivery and greater reliability in software development and operations. Terraform at Cloud Institution: Get hands-on experience in infrastructure as code (IAC) and automate your cloud infrastructure using Terraform.  3.Global Certifications for a Competitive Edge Our courses come with globally recognized certifications that open doors to numerous opportunities worldwide. We ensure our students are well-prepared to ace certification exams and stand out in the global tech marketplace. What Sets Us Apart? Top Institution in Bangalore: Our reputation speaks for itself! Cloud Institution has been consistently rated as the best training center, with Outstanding reviews from our students. Real-World Training & Live Projects: We emphasize practical, hands-on learning experiences that mirror real-world scenarios, helping you become job-ready from day one. Personalized Learning: Whether you are a beginner or looking to upskill, our courses are designed to cater to all proficiency levels. With small batch sizes and one-on-one mentorship, we ensure a personalized learning experience. Our Students’ Success Stories Our students have achieved extraordinary success, securing positions in top companies worldwide. They rate us highly, praising our structured courses, supportive trainers, and the exceptional skills they have acquired. We are proud to be their trusted partner in career advancement. Start Your Journey Today! Ready to elevate your career with Cloud Institution? Enroll now and join thousands of successful IT professionals who have realized their dreams through our top-tier training programs. Contact us today to learn more about our courses, schedules, and how we can shape your future. At Cloud Institution, your success is our mission!   Your future in IT and Cloud Technologies begins here – at Cloud Institution, Bangalore. For  more

Scroll to Top