Terraform Interview Questions:
====================================
1).what is the difference between terraform import and terraform move into terraform into our envrionment?
Effect on Terraform state
* terraform import
* Adds an existing resource to the Terraform state.
* Does not create or modify the actual infrastructure.
* terraform mv
* Moves or renames an existing resource within the Terraform state only.
* No impact on real infrastructure.
==================
terraform import aws_instance.my_ec2 i-1234567890abcdef
=====================
terraform mv aws_instance.old_name aws_instance.new_name
=======================
2).write a block for ec2 using the Terraform?
3).which terraform version we have to used into terraform >
1.5 and 1.6 version we have to used into it …
4).can you explain me the terraform import usage into terraform >
What is Terraform import?
* terraform import is used to bring existing infrastructure into Terraform state
* The resource already exists in the cloud and was not created by Terraform
6).what is the biggest issue which u have faced while u are in organisations into it?
7).where do you store the state file and managers the state file into terraform >
8).what is the use of modules into terraform into it?
module "vpc" {
source = "./modules/vpc"
cidr_block = "10.0.0.0/16"
}
===========
variable "vpc_cidr" {
description = "CIDR block for the VPC"
type = string
default = "10.0.0.0/16"
}
==========
output "vpc_id" {
description = "The ID of the VPC"
value = aws_vpc.this.id
}
output "public_subnet_id" {
description = "The ID of the public subnet"
value = aws_subnet.public.id
}
9).How we can restore the terraform state file in our enviornment ?
10).what is the terraform taint command into terraform ?
Terraform taint – Explained
1️⃣ What is terraform taint?
* terraform taint marks a resource as “tainted” in the Terraform state
* Terraform will destroy and recreate this resource on the next terraform apply
* Useful when a resource is broken, misconfigured, or corrupted, but you don’t want to touch the rest of the infrastructure
===========
terraform taint
===============
11).How to destroy the any particular service with terraform >
To destroy a particular Terraform-managed resource, use terraform destroy -target=which safely deletes only that resource and updates the state.”
Linux interview Questions :
1).How to recover accidently deleted /etc/fstab into linux os ? anyone deleted this /etc/fstab .after this we can' boot ur os. boot into recovery mode . then go to the linux terminal page . here we have to execute the blkid command here it will list out the avilble partions and attached filesystems . if your deleting the /etc/fatab.that time root parttion won't be work now we can mount the root parttion in rw mode mount -t ext4 -0 rw,remount dev/sda1 / 2).VMSTAT command into linux ? 3).iostat and dstat command into linux os ? 4).LInux free command into linux os ? in this way we can check it our the memeory usage and swap memeory as well. then it will display out the , used,space avilble ,total ,buffer/catche abd shared what is free space we can execute the command like as the, free -b command : we will get the particular output for the bits so if you want to getto int the outpit in kilobytes : so we can execut ethe comamnd like as the, free -k free -g: it will sh...
Comments
Post a Comment