Learn Terraform with Azure by Building a Dev Environment - Full Course for Beginners
This project will guide you through Terraform basics as you utilize Visual Studio Code (on Windows, Mac, or Linux!) to deploy Azure resources and an Azure VM that you can SSH into to have your own redeployable environment that will be perfect for your own future projects!
✏️ Derek Morgan created this course. Check out more of his courses at: morethancertified.com
🔗 LinkedIn: / derekm1215
🔗 Twitter: / derekm1215
⭐️ Course Contents ⭐️
⌨️ (0:00:00) Intro
⌨️ (0:01:51) VSCode Setup
⌨️ (0:05:24) Terraform Provider Init
⌨️ (0:11:26) A Resource Group
⌨️ (0:16:57) A Virtual Network and Referencing other Resources
⌨️ (0:23:29) Terraform State
⌨️ (0:27:17) Terraform Destroy
⌨️ (0:30:29) A Subnet
⌨️ (0:35:36) A Security Group
⌨️ (0:41:51) Security Group Associations
⌨️ (0:44:00) A Public IP
⌨️ (0:47:40) A Network Interface
⌨️ (0:52:45) A Key Pair
⌨️ (0:57:57) Custom Data
⌨️ (1:02:24) SSH Config Scripts
⌨️ (1:05:56) The Provisioner
⌨️ (1:14:53) Data Sources
⌨️ (1:19:04) Outputs
⌨️ (1:23:09) Variables
⌨️ (1:26:41) Variable Precedence
⌨️ (1:31:09) Conditionals
🎉 Thanks to our Champion and Sponsor supporters:
👾 Raymond Odero
👾 Agustín Kussrow
👾 aldo ferretti
👾 Otis Morgan
👾 DeezMaster
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news
Пікірлер: 140
Great video covering all the small details! I noticed one thing where explanation of VM code is missed is custom data section.
finally I found the lessons I can easily follow and feel my in demand skills improving with every minute.
Excellent video. I'm a beginner user of Terraform. ONLY 16 mins into the video and already feel astonished. Great feeling of accomplishment when I created a RG and see the outcome in the Azure portal. I've learned so much with just a few minutes. Great work with explaining the Terraform concepts and commands. It makes learning fun and effortless.
@RocketRift
2 ай бұрын
Exactly! I landed a Azure support engineer role after completing this course.
I've been watching courses on Pluralsight/ACloudGuru and felt like I wasn't getting anywhere. I've learned more from this 1 hour video which was far more engaging and hands-on than I did in any of theirs. Thanks Derek.
Good explaining .tf resources plus typing out the objects helps with beginners. Great job!
Thanks Derek for putting this together and a well thought out example. Learnt a ton. Super Thanks.
from minute 53, creating an ssh-pair! Where is the VM creating?? it's like the most important stuff and it's missing :(
@dusty2445
6 ай бұрын
The SSH key is being created on the host that the terraform is being run from, not in the Azure VM
Just finished the whole course, really fabtastic and easy to follow and explained, well done Derek, do you have other courses ike this So many thanks for your efforts
Great tutorial! Thanks for taking time to explain everything in details.
Awesome tutorial, this definitely helped me get a better grip on terraform with Azure and i was able to complete all the executions with some troubleshooting to get it fixed, definitely this was fun to learn. Thank you so much :)
Thank you so much for this brilliant training course, every command worked and I learned so much about terraform and azure
Brooooo I was just about to do your aws terraform project, so glad I found this before I started because I like working with azure a lot better
Just started the video and i had to like the video immediately the moment heard him saying resume project with terraform. Cos that's exactly what I needed. Hope i won't be disappointed
I could not find the moment when the whole linux vm was added, you just jumped over to the SSH Key generation. Was this part of the video before? After "0:47:40 " there is suddly a linux-vm on th screen which never was created before :-( please check if this video is not missing this part.
@sanidhiya7718
8 ай бұрын
Yes same
@lecardinal1
6 ай бұрын
agree. so after 47mins should we try to invent by ourself what is missing ?
This has been a really good learning tool, thanks a lot!
Great video, but I think you might be missing a chapter on deploying the linux VM.
@LaurenceNairne
Жыл бұрын
I was about to comment the same thing - all of a sudden we have a VM block in main.tf :D
@dand9022
Жыл бұрын
@@LaurenceNairne I noticed as well but the vm wasn't deployed yet. All you need to do is copy and paste the linux vm code and pick up from creating the ssh keys
@JimboXiii
10 ай бұрын
glad I wasn't the only one to spot this, thought I was going mad for a moment
Is it just me or does the video jump past the Linux VM part and go straight to creating the key pair after creating the NIC?
Nice video with good explanation all through. Just one correction, around 34th minute regarding 'address_prefixes' we cannot provide multiple CIDR range here. The address_prefixes argument in the Terraform azurerm_subnet resource is used to specify the CIDR range for the subnet. However, it can only take one CIDR range. The reason why it is called address_prefixes (plural) is because it is compatible with the Azure Resource Manager API, which allows you to specify multiple CIDR ranges for a subnet. However, this feature is not yet supported by the Terraform AzureRM provider. If you need to use multiple CIDR ranges in your virtual network, you can create multiple subnets. Each subnet can have its own CIDR range. You can then connect the subnets to each other using virtual network peering.
Well, it was really useful. Great presentation, thank you!
Awesome video!!.. just needed where the resources mentioned in the video are placed. Need it for the docker bit
I'm about 20 minutes in, and this course is good. My only ask is that you posted the code to a github to inspect.
Updating my resume immediately
Mind-blowing course
Invaluable info. Thank you.
Guys If you are having a problem in which you are not able to see public IP at 57:30, just change allocation_method = "Dynamic" to allocation_method = "Static"
Another Great Job :)
Love the course, but one suggestion make the font bigger next time, I tried on my end to no avail I'm old 😃 thanks
can anyone share the course resource which he is referring to for creating customdata.tpl and linux-ssh-script.tpl?
Excellent video. Just a small sugestion: try using a Chrome extension named Dark Reader or similar. The contrasts going from VSCode (dark) to Terraform documentation (white) can really destroy people's eyes (like me).
Derek, you said a couple of times "the file can be found in the Resources section of the lesson/course". but where am I suppose to find it?
Very great video, thank you!!! Is there a public repo with used files?
Thank you so much !!
thanks for what your doing, was going through this course, had issues with creating a network interphase card as can be seen on the diagram, am out of options pls help
Fantastic video. You have managed to take something quite complicated to teach and have found a way to turbo charge teaching it in a very short amount of time. Thank you and keep up the great work.
Well Explained 🙂🙂
Derk, at minute 1H:24 I agree it is a good idea to use variables and we might run terraform on different OSes but any related operation to ssh using the openssh ssh-keygen on the win10 bix does not work, I copied everything to a fedora 35 box and everything works like a charm, so as I said in an earlier thread terraform cannot decode mtcazurekey correctly
Hello. Thanks for the great video. I recently attended a Microsoft DevOps session where they are heavily promoting Bicep. Will terraform be sidelined because of this in your opinion? Thanks once again for the video
@tylerkhudson
Жыл бұрын
Bicep is just like Terraform however, its an Azure only desired state configuration (DSC). Whereas Terraform can be use for multi-cloud (Azure, AWS, etc). So I would suggest Terraform is higher valued
Oh This man is amazing I bought his course on Udemy !)!)
Make a video also in azure ai and ml projects💯💫
Is there a full azure-terraform course we can purchase?
seems like lost a part about how to create vm and fix the public ip problem between the part of network interface and the key pair ?
@LaurenceNairne
Жыл бұрын
Did you ever work this out?
@emiliocamacho
Жыл бұрын
@@LaurenceNairne This is the VM block missing from the video. resource "azurerm_linux_virtual_machine" "mtc-vm" { name = "mtv-vm" resource_group_name = azurerm_resource_group.mtc-rg.name location = azurerm_resource_group.mtc-rg.location size = "Standard_B1s" admin_username = "adminuser" network_interface_ids = [azurerm_network_interface.mtc-nic.id] admin_ssh_key { username = "adminuser" public_key = file("~/.ssh/mtcazurekey.pub") } os_disk { caching = "ReadWrite" storage_account_type = "Standard_LRS" } source_image_reference { publisher = "Canonical" offer = "UbuntuServer" sku = "18.04-LTS" version = "latest" } }
@lakerfan4life308
9 ай бұрын
unable to SSH into VM. port 22 is blocked. getting "connection timed out"
@lakerfan4life308
9 ай бұрын
Never mind. I resolved my issue. Had the wrong setting in my network_security rule. Changed direction value from Outbound to Inbound
@philmegaw3125
2 ай бұрын
@@emiliocamacho Thanks for this - it all makes sense now!
Amazing thank you
What a calm and soothing voice, you are a born teacher. Amazing video and lots to learn from you. God bless.
Where can I find the course resource files? Not seeing customdata.tpl contents in here.
Will you do a video with Azure Devops integration ?
Unnecessary content removed from this video results in compressed and effective content. Thanks for the detailed and great review!
danke!
Hey for the vm section, I am a bit lost. cant seem to apply the settings made. Any help?
Hi, keep getting the Error: terraform: The term 'terraform' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. Followed the exact same code on your video, even copied the code from the docs, still fails. project is stored on another drive, will this cause an issue?
@jasoncoombes8913
Жыл бұрын
Hi, I just fixed this by installing Terraform, copying the file path of where terraform is installed, searching "edit environment variables for your account" -> path -> edit -> add the path where the terraform.exe exists -> relaunching VS Studio. Hope this helps.
@brandonwaddell2583
Жыл бұрын
@@jasoncoombes8913 I had the same issue on a Win 10 machine, used chocolatey to install terraform and it worked
In flow it seems you skipped to showcase the entire vm scripts to us . Please share in details with ssh key portion. I am performing the same from scratch ,so ...
Is there a repo with the .TF and other files?
I seem to be running into an issue early on, in that after installing the Terraform extension (the same one that is being used here), I cannot run any commands. Terraform stymied me with the "fmt" command referenced at 09:10 - as it couldn't find the command. I'm using Visual Code Studio on Rocky Linux , and unsure how to proceed from here, as if I'm getting errors this early on, then I'm sure to be experiencing multiple issues later.
is the code available in a repo?
I like the video
This video would also for Cloud Security people work or for administrator?
Thanks bruv
I am not sure what I am doing wrong. I have confirmed that my azure account is connected, confirmed Terraform is installed. However when I do terraform init, it shows in terminal that it has been initialized successfully, however, it doesn't create any of the other files/folder as shown in the video. I have set my version to =3.0.0. I would appreciate any help with this! :)
Ermm, how are you able to run terraform fmt? You didn't explain installing any terraform stuff for the console I've installed the terraform extension for VSCode but there's no cmdlet called terraform
Why would you just skip the part where you have entered the code for the VM?
Not how you pronounce Azure (in intro), but looks really interesting 😊
@MorethanCertified
2 жыл бұрын
Yeah, I get that a lot. Blame it on my Southern American roots.
very good course. Better then paid ones
Where did you install terraform
I guess you skipped the Virtual Machine deployment part in the video, found it on your website. Thanks.
i love you beriik morgan
Please make video on restful API
Hi Derek, I started watching this course, when I issue "terraform init", I get a message "Terraform has been successfully initialized!" but no files no directory terraform is created. Thanks for your help
@eliassal1
Жыл бұрын
Please ignore this question as I noticed that when I copied it from the doc there was "features" and not "feature" it seems that the S was not correct what is strange is that even an error exits terrafom said init was successful in spite of the fact it did not indicate that there was a syntax error
@tomisinodunuga8422
Жыл бұрын
You need to save the file in your VS.code. You can put your VS.code in autosave better still
@harryjb28
Жыл бұрын
@@tomisinodunuga8422 Thank you for this :)
@brandonwaddell2583
Жыл бұрын
@@tomisinodunuga8422 you’re a lifesaver
@iqbalhakim3953
9 ай бұрын
@@tomisinodunuga8422 my man
Things seem to completely fall apart around the hour mark. We need something more for ssh access. The VM is not allowing ssh access.
Hello codecamp, a small request. Can you teach how to create A.I app or anything to make it play games? Not any simple games but high end games. I want to improve by playing with A.I.
While doing az login, I'm getting "No subscriptions found". Please help clearing this error
how much is it gonna cost using azure cloud at the end of the project?
Can't see the resource file here. Can you help?
Please upload AWS solution architect course SAA-C03 latest.
At 53:05 entire section is skipped
PLEASE HELP IT KEEPS SAYING No changes. Your infrastructure matches the configuration. Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
@sweetman1994
2 ай бұрын
Save the tab
i am having issues with the tpl file is there another way i could run a bash file with terraform
@DavidMunoz-kd2tp
Жыл бұрын
Make sure bash script is good. Also Look here: custom_data = filebase64("${path.module}/customdata.tpl") hope this helps!
hah, when logging into the VM, I am told permissions for my key are too open, and it will be ignored... So I can't actually log in -__-
Or provide me link 🔗 of any course on api
What is Terraform? Seems like that should have been mentioned in the beginning now
@LaurenceNairne
Жыл бұрын
I don't agree - - it's for terraform to explain what their tools do. It's for other content creators to try and give a great resource for *how to use them*
@liamconverse8950
Жыл бұрын
@@LaurenceNairne Well you you have the right to be wrong lol
I configured the provisioner but when i do a 'terraform apply -auto-approve' I get following error in the output of the apply: azurerm_linux_virtual_machine.mtc-machine (local-exec): Executing: ["bash" "-c" "cat > ~/.ssh/config Host $(hostname) Hostname $(hostname) User $(user) IdentityFile $(identityfile) EOF "] azurerm_linux_virtual_machine.mtc-machine (local-exec): bash: user: command not found azurerm_linux_virtual_machine.mtc-machine (local-exec): bash: identityfile: command not found when i cat the ~/.ssh/config file it has: Host My-MacBook HostName My-MackBook User IdentityFile any hints on how to fix??
where is the VM creation part
@AdrianVrabie
Жыл бұрын
I don't see it either? Was it cut on purpose?
Make tutorial of wso2 please
I can't seem to find the customdata.tpl code, can anyone help?
@Dannydod1
Жыл бұрын
I typed out the bash script, I have the following error response usermod: user 'ubuntu' does not exist
we need Bash scripting (full course)
@observermanj8904
2 жыл бұрын
Inshallah
@ahmadaljenyat3907
Жыл бұрын
Inshallah
Terraform with gcp please
It doesn't matter if you're tall, short, thin, fat, rich, poor at the end of the day it's Night !
Where's the customdata.tpl file?
Unfortunatly you skipped the entire vm creation part and directly jumpped into the ssh key gen part
I studying css 6h 2years ago in your channel, but when i fast foward the subtitle is broken, can you fix it, i have to study at school in 2 weaks
"just like so" or "just like this"
Note: We also need to install terraform.
This video skips the ENTIRE portion regarding creating a VM, and skips from creating a network interface straight to generating a key pair.
Is there an AWS version of this? None of the companies I want to apply to would ever use Azure.
@STHLMsoderort
2 жыл бұрын
What kind of company are you applying to? I think in Europe Azure is used widely.
@tylerkhudson
Жыл бұрын
kzread.info/dash/bejne/m4aVw8tqeaXScpM.html
Human language - so what can I do with that? :D
Firstt!!
@yahyaabulhaj6840
2 жыл бұрын
Nah, it's clear i am!
You skipped the creation of the VM, which is the whole point of this video, isn't it?
@bmw428
Ай бұрын
It’s in his course on his website linked here
First i guess
@yahyaabulhaj6840
2 жыл бұрын
Yep
Well don't work anymore do another video on discord python bot
@ilovefoxes9987
2 жыл бұрын
Because it's outdated
Fun Fact: if you write fun fact, people will read it
Its a good video, but because of resources not provided, it made this vidoe almost uselesss.
This is great but no one uses azure or gcp. digital ocean, linode or aws is the way to go.
@MorethanCertified
2 жыл бұрын
Then check out the one covering AWS! But I would disagree that DO and Linode compete with GCP or Azure directly.