diff --git a/README.md b/README.md index 95d887e..31b8048 100644 --- a/README.md +++ b/README.md @@ -5583,6 +5583,35 @@ The Terraform Registry provides a centralized location for official and communit It is also common in the community to use a tool called terragrunt to explicitly inject variables between modules. +
+What is Terraform import?
+ +Terraform import is used to import existing infrastucture. It allows you to bring resources created by some other means (eg. manually launched cloud resources) and bring it under Terraform management. +
+ +
+How do you import existing resource using Terraform import?
+ +1. Identify which resource you want to import. +2. Write terraform code matching configuration of that resource. +3. Run terraform command terraform import RESOURCE ID
+ +eg. Let's say you want to import an aws instance. Then you'll perform following: +1. Identify that aws instance in console +2. Refer to it's configuration and write Terraform code which will look something like: +``` +resource "aws_instance" "tf_aws_instance" { + ami = data.aws_ami.ubuntu.id + instance_type = "t3.micro" + + tags = { + Name = "import-me" + } +} +``` +3. Run terraform command terraform import aws_instance.tf_aws_instance i-12345678 +
+ ## Containers ### Containers Exercises