Terraform Interview Questions: ==================================== 1).what is the difference between terraform import and terraform move into terraform into our env 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.”

Comments

Popular posts from this blog

Aws Interview Questions

Linux interview Questions :