Terraform

How to destroy resources through Terraform?

In 3 ways we can destroy the resources through Terrafrom. 1.From the terrafrom init directroy – Where you keep the actual config files,2.Specifying the target with provider,3.Remove the resource code from your tf file. Option1: – From the terraform init directory #terraform destroy Here it will show clearly what are the resources can be deleted . In this example “yourec2”…

Continue Reading

Terraform

How to create repository in GitHub through Terraform?

Before Terraform steps first we have to create access in GitHub . Access in github can be granted through Personal Access Token. How to create Personal Access Token in GitHub? Login into Your github account. Click settings Click Developer Settings Click Personal Access token – Click Generate new Token if already not created . Enable repo in the scopes Now…

Continue Reading

Terraform

Understanding the variables in Terraform – Test

For this testing created “ter-demo” dir and created files under this directory. 1.vars.tf In this file we defined what are actual variables (like syntax) going to use and equivalent values options. For AWS_REGION and AMIS defined default options.For AWS_ACCEES_KEY and AWS_SECRET_KEY it can get input from other file or from user . 2.instance.tf This file has actual contents to create…

Continue Reading

Terraform

Terraform variable types and values

Types 1.String A sequence of Unicode characters representing some text Example : “hello” Strings are usually represented by a double-quoted sequence of Unicode characters, “like this”. 2.Number A numeric value . Numbers are represented by unquoted sequences of digits with or without a decimal point, like 15 or 6.283185 3.Bools Bools are represented by the unquoted symbols true and false. Bool values can be used in conditional logic.…

Continue Reading

Terraform

Launching your first aws ec2 instance through Terraform

Before launching aws ec2 instance need to setup aws iam user account . You can refer this article how to setup aws iam user account. 1.You can create “launch” directory (any name you can select) 2.Create instance.tf (any name.tf) file and update aws instance related information instance.tf provider “aws” { region = “us-west-2” access_key = “REPLACE-YOUR-ACCESS-KEY-HERE” secret_key = “REPLACE-YOUR-SECRET-KEY-HERE” }…

Continue Reading

Terraform

First Time Terraform Environment Setup in AWS

1.Create AWS Free tier account or use your existing account.https://signin.aws.amazon.com/ 2. To use Terraform in AWS environment first needs to be setup in user account . We have to generate accesskey and secretkey in IAM AWS. 3.Open IAM service and select user 4.Creating console access is optional , but programmatic access is mandatory 5.Create group and provide administrator access .…

Continue Reading

Terraform

Testing with variables in Terraform

After installation of Terraform you can practice with simple variable test. 1.As a first step you have to create main.tf file #vi main.tf variable “myvar” { type = string default = “hello terraform” } variable “mymap” { type = map(string) default = { mykey = “myvalue” } } variable “mylist” { type = list default = [1,2,3] } 2.Testing variables…

Continue Reading

Terraform

How to install Terraform on Linux

Installing Terraform on Linux is so simple , you no need to actually install like ohter software, you can just download the zip package , extract and update the path. 1.Install unzip package sudo yum install unzip sudo apt-get install unzip (ubuntu) 2. Confirm the latest version number on the terraform website: https://www.terraform.io/downloads.html 3. Download latest version of the terraform…

Continue Reading

AWS, AWS Interview Question, AWS Network

Is aws ec2 instance private ip static or dynamic?

A private IPv4 address is an IP address that’s not reachable over the Internet. You can use private IPv4 addresses for communication between instances in the same VPC. When an instance is launched, aws allocate a primary private IPv4 address for the instance from selected or from default subnet and vpc. An instance receives a primary private IP address from…

Continue Reading

Azure, Azure Interview Questions

Azure Backup Service in 5 minutes

The Azure Backup service provides simple, secure, and cost-effective solutions to back up your data and recover it from the Microsoft Azure cloud. Key Points: With Azure Backup service you can backup on-premise and cloud resources data. Azure Backup is Azure’s builtin backup service , which doesn’t require any infrastructure setup. Backup data’s are encrypted. You can easily backup and…

Continue Reading

Azure, Azure Interview Questions

What is the difference between Azure Fault domain and update domain

Fault Domain: Logical working domain in which the underlying hardware is sharing a common power source and switch network. This means that when VMs is created the Azure distributes the VM across the fault domain that limits the potential impact of hardware failure, power interruption or outages of the network. Update Domain: It is a logical group that undergoes maintenance…

Continue Reading

Azure

How to know status of your Azure service resource running fine?

We can get to know azure resource status by following 3 ways. Azure Status: A global view of the health of Azure services. It will list the azure service status for all region and all services. If something not working on your application or services or VM , you can refer here is something problem with Azure side. https://status.azure.com/en-us/status Service…

Continue Reading

AWS Interview Question

Difference between AWS EBS and EFS?

EBS and EFS both are storage services from AWS . EBS – Elastic Block Store EBS is a block storage service . EBS volumes designed to attach single AWS EC2 instanceYou can format the disk with your desired generic file systems like ext4,NTFS,XFS,ZFS etc.You can attache and detach from EC2 instance easilyYou can extend the disk volume size onlineHaving options…

Continue Reading