How to use Terraform import? - Part 22

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 60

  • @Kumbutranjaami
    @Kumbutranjaami Місяць тому +3

    It was an awesome video. One thing you have to make very clear in your video that "terraform import" will never give you terraform code, it just import the current state into your state file. Reconstructing the code as in your case was so easy because you created a very basic EC2 instance. If you want to do the same thing in a complex environment, writing complex terraform code is still on your head even after using "terraform import".

  • @aniruddhatope2388
    @aniruddhatope2388 9 місяців тому +4

    Hey Rahul,
    Thanks for this awesome tutorial, I had interview yesterday on terraform and got selected today by following ur tutorials. Many thanks.

    • @RahulWagh
      @RahulWagh  9 місяців тому

      Gr8 to hear that and i wish you a good luck with the new job

  • @singhbrozz1996
    @singhbrozz1996 6 місяців тому

    The way you are explaining any skill set , it's awesome . I learned terraform in a week from your youtube channel.

  • @brahmadarapaneni4561
    @brahmadarapaneni4561 Рік тому +2

    How to import dynamically

  • @sabahb1759
    @sabahb1759 8 місяців тому

    Thanks Rahul, awesome tutorial. I got access to 2 udemy courses for terraform but none of them are this lucid & clear. This shud be called - Terraform Made Easy by Rahul Wagh :D

  • @supersoniqamanyi3075
    @supersoniqamanyi3075 11 місяців тому

    Best Terraform Teacher

  • @Shubham__Saroj
    @Shubham__Saroj Рік тому

    Thanks for such a great explaination.

  • @ankitbhujbal741
    @ankitbhujbal741 Рік тому

    Nice explanation and practical!!

  • @RahulSharmaSingularity
    @RahulSharmaSingularity 6 місяців тому

    Superb as always !

    • @RahulWagh
      @RahulWagh  6 місяців тому

      Thank you! Cheers!

  • @happylearningtricks
    @happylearningtricks Рік тому

    very helpful video - thank you

  • @saugatasarkar3787
    @saugatasarkar3787 Рік тому

    @Rahul very nice explanation.

  • @sany2k8
    @sany2k8 8 місяців тому

    Great explanation with example ❤.Though I have used the terraform import earlier it clears my concept a bit more. Btw: I was expecting when I will run terraform import it will automatically reconstruct my resources also 😂

    • @RahulWagh
      @RahulWagh  8 місяців тому

      NO it will not reconstruct the resource

    • @sany2k8
      @sany2k8 8 місяців тому

      @@RahulWagh Yes I know but that was my expectations actually 😂, thanks for the reply 👍

  • @thamizharasanrp7404
    @thamizharasanrp7404 Рік тому

    @Rahul terraform import command will be challenging to use in complex arch rite . Thanks for the video. Keep rocking.....

    • @RahulWagh
      @RahulWagh  Рік тому +1

      Yeah it’s absolutely true. It is very difficult to use terraform import on very large project. You should always use this for debugging troubleshooting purposes

  • @sabahb1759
    @sabahb1759 8 місяців тому

    in terraform 1.5, import block is newly added which makes it easier with 'id' & 'to'. Alhamdullilah :)

    • @RahulWagh
      @RahulWagh  8 місяців тому

      The video is getting older now so yes it has changed

  • @yogitechsolution3863
    @yogitechsolution3863 Рік тому

    Very useful! Thanks a lot! :)

  • @vinayKP-y7g
    @vinayKP-y7g 4 місяці тому +1

    Error: resource address "aws_instance.ec2_example" does not exist in the configuration.
    Before importing this resource, please create its configuration in the root module. For example:
    resource "aws_instance" "ec2_example" {
    # (resource arguments)
    Getting this error while importing, what is the root module.

  • @leamon9024
    @leamon9024 11 місяців тому

    Thanks for the video. Could you also talk about "config-driven" import in Terraform?

  • @ansitakumari5532
    @ansitakumari5532 5 місяців тому +1

    Hey,
    There is person A, who created few resources through terraform nd all those resources have been recorded in statefile. Now this person A, made some resources manually and did not use terraform, so all those manually created resources have not been recorded in statefile.
    Now, person B comes, he doesn't know what all resources have been manually added and now his job is to import all those manually added resources to the terraform in statefile.
    So, my question is - is there any way that person B can figure out what all resources have been changed manually??

  • @mirzashahnawaz2984
    @mirzashahnawaz2984 9 місяців тому

    Many many thanks.

    • @RahulWagh
      @RahulWagh  9 місяців тому

      You are most welcome

  • @-XSX-
    @-XSX- Рік тому +1

    Terraform import is not very widely covered topic, thanks for sharing this session.
    Recently I was searching Amazon for the best book that I can purchase for Ansible, and I was looking for someone, who can guide me on this, i just can not unnoticed the Ansible book you have on shelf.
    I have , Ansible for DevOps by Jeff Geerling , Ansible Playbook Essential by Gourav Shah and Mastering Ansible by Jesse Keating to choose from.
    I work on servers and used Ansible for Config Management and services orchestration, which book should I go for, is Ansible for DevOps covers all necessary topics ? Please guide.....

  • @purvakmistry2128
    @purvakmistry2128 Рік тому +1

    Can we import entire S3 resources to terraform state in one go? or do we need to do one by one s3 buckets import?

    • @RahulWagh
      @RahulWagh  Рік тому +1

      If you know all the attributes then you can do in one go otherwise you have to go one by one

  • @prmdheeraj8041
    @prmdheeraj8041 2 місяці тому

    After import which file gets updated ? Statefile ?

  • @AnimeshTiwari1
    @AnimeshTiwari1 4 місяці тому

    Thanks mate . It became very simple after you explain.
    Question : If I modify any imported resources using the terraform , will it work in real infra also ?

  • @hameedaliali9271
    @hameedaliali9271 Рік тому

    Thanks for posting interesting sessions on Terraforms.. Can you post some demos of using Templates for spinning up AWS instances or GCP instances. I am basically looking to see how we can define an Test Environment that consists of some components as Template and use this template to instantiate the actual Test Environment.....

  • @AmiteshRaikwar
    @AmiteshRaikwar Рік тому

    I am importing existing env in my state file but when I run it it recreate instances again which were already running or were in off state

  • @durairajgopal3277
    @durairajgopal3277 7 місяців тому

    super bro

  • @AmiteshRaikwar
    @AmiteshRaikwar Рік тому

    Difference between terraform pull & import?

  • @gauravpande7746
    @gauravpande7746 Рік тому +1

    Hi , how do we know what all necessary attributes needs to kept in the resources after importing?

    • @RahulWagh
      @RahulWagh  Рік тому +1

      Yes you need to know all the attribute

    • @gauravpande7746
      @gauravpande7746 Рік тому

      @@RahulWagh thanks and is there any command to import the whole infra at once eg. I have bunch of GCS buckets , bunch of vpc , compute engines etc..?

  • @funvideo1400
    @funvideo1400 7 місяців тому

    Hi Rahul,
    I have below requirnment,
    I have enabled Cross account setting on my main monitoring account and now i want to run the CFT to enable Cross account Cross region setting on all other AWS account to share there metric data with monitoring account. For that we need to built the terraform code.. so will you please help with any link or document for the same.
    Regards
    Rajiv

  • @shashiprakash6420
    @shashiprakash6420 2 місяці тому

    you should have also show tfstate file before and after import

  • @rodneyeffah9171
    @rodneyeffah9171 Рік тому

    Hi Rahul, I am having issues with importing aws Security Groups. Can you help with this please? When you have in ingress; ports 135-139. How do you code this please?

  • @KrishnaMotors-qb3fs
    @KrishnaMotors-qb3fs Рік тому

    Can i use terraform instead of ansible ?

  • @Heisennburg
    @Heisennburg 7 місяців тому

    If we have to again define the resource block on our own even after doing import. What is the sense of then importing it ??
    Is it just to update the state file ??

    • @RahulWagh
      @RahulWagh  7 місяців тому

      You do not understood the importance of the import block. You can still define the resource block even after the import

  • @ankitshukla8075
    @ankitshukla8075 Рік тому

    Hi @Rahul I am requesting you to complete all the topics based on TCA003 ToC. Thanks in Advance.

    • @RahulWagh
      @RahulWagh  Рік тому

      Hi Ankit if you have followd all the 22 session from terraform playlist then i think you should be able to crack Terraform TCA003 ToC

  • @yuvrajjambhle9061
    @yuvrajjambhle9061 10 місяців тому

    Can we delete existing aws resource using terraform, which is created manually? I asking for secrets from aws secret manager

  • @shantipahari
    @shantipahari Рік тому

    how to use imported resources? i imported vpc but how do i use the vpc to launch instance?

    • @RahulWagh
      @RahulWagh  Рік тому

      If you have imported the resources then i am assuming that the VPC is already setup on the AWS. But anyway after you have done the import, after that you simply need to run the terraform apply command.

  • @2mahender
    @2mahender Рік тому

    then what is the purpose of data block?

    • @RahulWagh
      @RahulWagh  Рік тому +2

      Well data sources are always limited to the single resources although you can loop it but terraform import is cli(command line) utility to import more than one resource into your terraform code stack

  • @sabahb1759
    @sabahb1759 8 місяців тому

    Is this course sufficient to crack terraform associate exam 003?

    • @RahulWagh
      @RahulWagh  8 місяців тому

      Yes it is if you have followed all the chapters

  • @samgaming321
    @samgaming321 2 місяці тому

    This really doesn't help in real time scenario😮😢