How to Import Existing Azure Resources Into Terraform Super Easy!!
HTML-код
- Опубликовано: 8 фев 2025
- Do you have a cloud environment that needs to import existing azure resources into terraform? This video goes through a simple step by step process on how to do that a safe way.
Once you are able to import your existing azure resources into terraform, you will be able to automate how you create, delete and update your cloud infrastructure.
This video goes through how to import and azure resource group and an azure virtual network. Drop a comment below if you have questions on other imports.
ABOUT OUR CHANNEL
My channel covers various topics about networking, automation and cloud technologies . We cover lots of cool stuff such as cisco, terraform, aws, firewalls, security and more
Check out my channel here:
/ @letmetechyou
Don’t forget to subscribe!
CHECK OUT MY OTHER VIDEOS on Terraform Here:
• Learning Terraform for...
FIND MY BLOG AT
letmetechyou.com
GET IN TOUCH
Contact us at info@letmetechyou.com for questions and video ideas. Наука
Check out my latest video on how to import using terraforms import block using a for_each ruclips.net/video/nYlw773UEp4/видео.html
This video helped me solving import problem in my org. I want to appreciate you.
Thanks I’m glad it helped
Awesome LetmeTechYou.. I was trying Azure Terraffy which wasn't working due to various unknown reasons. But by doing this, Terraform itself becomes a learning process.
Thanks. I’m glad it helped. Hope I can continue to make videos that could be of benefit
Awesome Video and exactly what I wanted to know. You are awesome.
Glad it was helpful!
Thank you Kevin great stuff! . perhaps can use both tools - aztfexport to create the exported tf config, refactor the code and then run terraform import .. should help speed up the process if there are lots of resources to import... will give this a try ..
Thanks. Check out my other video on how to use the import block which i think is a lot easier. ruclips.net/video/nYlw773UEp4/видео.html
I have 30 resources, I wanted to import all of them, Is there any other way to get them using single command ? or Azure CLI command without Terraform? az resource list -g is not giving complete details about resource from the resource properties. Is there anyway to get complete details of the resource using Azure CLI? Please suggest
yes you can use a tool called aztfy. here is an article i created talking about that letmetechyou.com/import-your-entire-azure-environment-using-terrafy/
First thanks for creating this video and I have one question to ask. After watching this, I imported a Terraform Resource Group successfully. Subsequently, I created all the resources under that resource group, such as VM, network, subnet, public IP, etc. Now, when I am trying to run Terraform destroy, it is stating that it will delete everything, including the Resource Group. However, I don't want that because I didn't create it; I imported it. Please suggest a solution
Once you import a resource under terraform management any commands you run against it will affect that resource also. That is because it’s it’s now loaded into the state file.
@@letmetechyou so what option I have now to delete everything except RG.
Thanks
yea no problem
Goddd i wish i would have seen this video laat week i had an entire hub and spoke firewall with policies a bastion box and a host pool with intune registration set up and fsync with GOP policy and shared managed storage and started over to work with terriform realising i didnt have to. 😂😂
oh dang that sucks lol. Yea I have found it easier sometimes to do imports where it makes since. What I also do sometimes is use a tool call aztfy what allows you to easily import full resource groups into terraform ruclips.net/video/oOokX83DqMU/видео.html I'll save the terraform config and adjust it to how I like with the naming and then do my own imports. But you can also have the tool import the config into your tfstate as well
@@letmetechyou wow thanks! Going to have to play around with that. I just got devops pipeline with tfstate storage backend in a storage account functioning so onward
How should we interact with a blob storage
Great video...used this to import subnet into VM template. Have you worked with the AZAPI provider?
No I never used that one. What are some things you use that provider for.
Hi , Can we use the name of the resource while executing the import command instead of id of the resource, Can we code the terraform provider in such a way that it will allow us to use the name while executing import command.
No I think you have to use the id. But you could look into the new method that terraform has. You can use what’s called an import block.
iam unable to do the same thing through pipelines, could you please post a video how to do the same process using azure pipeline script
Sure I can.
How to import resources directly from Azure Pipelines. Because in my environment resources provisionning need to be automated through pipelines. And I can't use Terrafy as it's not compliant to our policies
Since importing is a manual process you would just have to add that step into your pipeline to import in the resources that you want. You would just need to adjust the command to import in the specific resources one by one
That is only easy for test resources. For complex architectures, this is not an option...
@@danidelavlasca yea only for single resources. I use this method in an org with massive architecture. ruclips.net/video/nYlw773UEp4/видео.htmlsi=D1OIcNE2zrrFL8_Z I’ve import in thousands of resources with this method with ease.