Awesome course! UPDATE: After watching this course here on UA-cam I went ahead and purchased Derek's course provided in the description. I have to say hands down this is the best Terraform course on the internet! (Believe me, I have watched courses here on UA-cam and on Udemy). I have the Terraform Associate Certification and the title of Derek's course, more than certified, really does justice to the course! The Hashicorp certification is a joke compared to what Derek teaches in the course, and for just $29.99 it's a freebie. The course is worth more than 10X that. My Terraform skills have really improved thanks to this course and Derek I cannot thank you enough for the depth of the course! So for anyone really looking to take their Terraform skills to the next level, forget Udemy courses, Derek's morethancertified Terraform course is on a level by itself. Thank you!!!
Great course - been using TF for about 6 months and this really gave a lot of useful information and optimizations plus using them well in TF. Thank you.
This course was beautiful and very much effective, I faced a lot of issues while getting along with the course, but eventually I made it out and in the process I was able to grasp what exactly is Terraform and how to work with it. I want say that I have learnt it completely or mastered it, but I have a clear vision on what is terraform and I thank Derrick for bringing such a simple yet wonderful course to us for FREE!!
to anybody else who follows this tutorial - it seems in the time that this video was made - a new change was made at 9:44 from terraform. You will now see that on this same terraform page that you have to add a new variable to shared credentials tf file: shared_config_files and then populate the .config file with header like so: [default] region=your-region and output=json then add to be safe: [profile your_custom_profile_name e.g vscode] region=your-region and output=json
You can also remove the shared_config_files line completely, and change shared_credentials_files to shared_credentials_file. You'll also need to remove the [ ] brackets, but other than that should be good to go.
To anyone else following this advice, you must also completely close Visual Studio Code (VSC) in order for the changes in the path variables to take place. After that you should be good.
No word of thank you could justify your effort and explanation. You are just just awesome. I really appreciate the hard work. HUGE humble request please!! Bring a next video and include Modules, data, ENV_VARIABLES (how to use them), also would be nice if you could include a reat time project (mid-->expert level please). I am new to terraform but your video is a great source of learning. many thanks
Nice tutorial, a really nice way for me to get started with Terraform. It was at time challenging to follow along because of the scripts that were not available, but I made it to the end. It took me two days.
For those who are getting stuck with launching an instance: If you get an error saying that query has no results, it's because data "aws_ami' "example" is used with already registered AMIs. Try using aws_ami_ids instead. Browse the documentation as it is always changing
Thanks for this awesome video. Everything worked for me except I couldn't SSH into my instance via VS code. However, I am able to ssh in using Putty. Once again thank you so much this is a very well put together course. Appreciate it. I like to learn Terraform for Kubernetese.
Did anyone have an issue with docker not being installed in the instance after following the instructions to build the userdata.tpl file. Thanks in advance.
Same here. And I never recalled him actually providing the .tpl script to copy, so I typed by hand. May have to find a way to install all these manually or with another solution. That's the problem with these FreeCodeCamp videos. My suggestion: downvote and try to combine with a different solution
Currently stuck on the SSH Config Script(1:05:08). I installed "remote ssh" but when input "~/.ssh/config" in the terminal i get an error because the file does not exist. Any tips on how to sort this? thanks in advance
do you have another example on setting up SSH config scripts? I'm getting an error and I don't have a config file on my .ssh folder. Thank you and more power!
Same thing happened with me as well, but we can do it manually, Install the “remote ssh” plugin , open command pallet, search for “ssh” and click on ”add host” ….it’ll generate the config file….after that when you’ll search for “connect to host” on command pallet…it’ll work same as shown in the tutorial
Hello Derek, AWESOME Tutorial!! I have been following this class and executing as you're executing the tasks. I am experiencing an issue when attempting to execute the bootstrap in the userdata.tpl file. The script is complaining about the "#!/bin/bash". The server did deploy, but docker was not installed. I am not seeing the issue with this standard bash command. Any advice?
i have been troubleshooting this but can't get it resolved. "Error: creating EC2 Instance: InvalidParameterValue: The architecture 'x86_64' of the specified instance type does not match the architecture 'arm64' of the specified AMI. Specify an instance type and an AMI that have matching architectures, and try again. You can use 'describe-instance-types' or 'describe-images' to discover the architecture of the instance type or AMI."
Great course, but would be nice if userdata.tpl file was provided somewhere as making sure I copied it correctly took up some time. I checked the link provided in the description but couldn't find it.
I have been following the tutorial exactly as showed, but I cannot ping the public IP of the EC2 instances I create. Does anyone know why that is? I have been stuck for a while now and need help.
I understood. I was using the wrong personal IP, I have mistakenly put the internal IP rather than the external IP, I was trying to use a private network IP address which obviously prevented me to connect to the EC2 instance
One weird thing I'm experiencing: my route table has the 'name' tag set to 'dev_public_rt', and the tag shows as such in the AWS console; however, the 'Name' column is still blank for it in the console's 'Route tables' list, unlike how it shows in this video 39:28. I know I can manually add that label easily, but wondering if something is different on the code level...
@@justinshobby Hi Justin, and thanks for the note! Sadly setting the tag to 'Name' instead of 'name' didn't work for me still - the 'Name' column for the RT remains blank.
Hay Derek, i couldnot use the provisioner block on this course. When i ran the terraform plan it says the provisioner block is not expected here. What can i do here as an alternative.Thanks
I was able to make SSH connection work from VScode. But, I don't understand what the purpose is to have direct SSH link from inside VScode. Don't you do the same thing with separate SSH connections from putty? Or, you want to run tests directly from EC2 instance with code managed by VScode, version control type of stuff?
I love the video. There's just one thing I don't understand well: I don't know why, but there were two "sudo" in sequence in that userdata. Did that not cause any errors?
@Rodrigo Araújo e Castro When Ubuntu EC2 instance is provisioned/created, you're allowed to access using default user which is ubuntu in this case. you can't access with root user. However, ubuntu user is already present in sudoer file to run any sudo command without password. That's why when you're running super admin commands(apt update && apt install package-name) with ubuntu user, you have to pass sudo first. Hope this helps.
@@radegold3122 still didn"t figure it out: is this what you mean? add-content -path c:/users/.ssh/config -value @' Host ${hostname} HostName ${hostname} User ${user} IdentityFile ${identityfile} '@
I get this error msg in my "aws_vpc" "mtc_vpc" resource: enable_dns_hostnames = true A reference to a resource type must be followed by at least one attribute access, specifying the resource name. Any suggestions, please?
Trying to go through the tutorial now and it seems I cannot run 'terraform init' around 11:49 in the video. It gives me a; "terraform : The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." Anyone know how to fix this?
It sounds like it was not installed correctly. As the other comment states, it's probably an environment variable issue. Make sure you follow the instructions very closely here: learn.hashicorp.com/tutorials/terraform/install-cli
This is great... Please please please... Can you break it up into chatpers and (bitesize) sections with appropriate names/labels so that one can easily reference particular aspects?
42:45 In Ingress option of SG, where you mention we can put our own IP address (to make sure we are the only 1 who can access our instance). I tried to implement that by checking my ip from google & when i ran 'terraform plan' it says: │ Error: "" is not a valid CIDR block: invalid CIDR address: "" │ │ with aws_security_group.my_sg, │ on main.tf line 68, in resource "aws_security_group" "my_sg": │ 68: resource "aws_security_group" "my_sg" { What could possibly the solution to this ? Do i need to assign my VPC (+Subnet) CIDR value to be matching to my current IP to follow this step ?
The video was nice.. it would have been even more beneficial if there was some explanation on the resources itself..like what is subnet and what is routingtable etc. Maybe a separate video on that..
I figured we can do it manually, Install the “remote ssh” plugin , open command pallet, search for “ssh” and click on ”add host” ….it’ll generate the config file….after that when you’ll search for “connect to host” on command pallet…it’ll work same as shown in the tutorial
Sorry Im starting this GREAT tutorial im amazed by, but where is the script for the boostrap the EC2 installing docker?? hahahah I cant find it anywhere or even on the official page, can someone paste it here? thanks!
Hello, Great video. Just an update regarding the shared_credentials_files, I struggle with the format of the string. The one that works needed the square bracket around the string. This format works ["C:/users/nameofuser/.aws/credentials" ]
Great tutorial! however, I'm having trouble trying to ssh into the instance. I keep getting a connection timeout. Any help or suggestions would be greatly appreciated.
@@calebemmanuel5178 can you share the link to the script files. I typed out the userdata however when I ssh into the instance docker isn't installed :(
can someone tell me why I did the userdata.tpl file when I spin up the EC2 it says I have to install docker. I literally copied the code from MTC's github but it docker isn't install on the EC2 instance? Please help!
Sometimes it takes a bit for Docker to become installed. You may have to wait a few minutes for it to work. Also, ensure you're using the right Ubuntu instance. If you use CentOS or a distribution that doesn't utilize apt, it will fail.
Awesome course! UPDATE: After watching this course here on UA-cam I went ahead and purchased Derek's course provided in the description. I have to say hands down this is the best Terraform course on the internet! (Believe me, I have watched courses here on UA-cam and on Udemy). I have the Terraform Associate Certification and the title of Derek's course, more than certified, really does justice to the course! The Hashicorp certification is a joke compared to what Derek teaches in the course, and for just $29.99 it's a freebie. The course is worth more than 10X that. My Terraform skills have really improved thanks to this course and Derek I cannot thank you enough for the depth of the course! So for anyone really looking to take their Terraform skills to the next level, forget Udemy courses, Derek's morethancertified Terraform course is on a level by itself. Thank you!!!
[45:25] AWS AMI
[51:15] Key Pair
[55:01] EC2 Instance
[59:55] Userdata
[1:05:07] SSH Config Scripts
[1:08:28] Provisioners
[1:15:37] Terraform Apply -replace
[1:19:56] Variables in Terraform
[1:24:22] Variable Precedence
[1:30:12] Conditionals
[1:35:41] Outputs
I love your explanation style. 100% calm, focused and clear. Anybody will understand this video, even those who just begin with Terraform.
Great course - been using TF for about 6 months and this really gave a lot of useful information and optimizations plus using them well in TF. Thank you.
46:45 AMI
50:58 key pair
59:54 user data
01:05:08 vscode connect to ec2 instance
01:08:20 provisioner (vs to ec2 ssh connection)
This course was beautiful and very much effective, I faced a lot of issues while getting along with the course, but eventually I made it out and in the process I was able to grasp what exactly is Terraform and how to work with it. I want say that I have learnt it completely or mastered it, but I have a clear vision on what is terraform and I thank Derrick for bringing such a simple yet wonderful course to us for FREE!!
to anybody else who follows this tutorial - it seems in the time that this video was made - a new change was made at 9:44 from terraform.
You will now see that on this same terraform page that you have to add a new variable to shared credentials tf file:
shared_config_files and then populate the .config file with header like so: [default] region=your-region and output=json then add to be safe: [profile your_custom_profile_name e.g vscode] region=your-region and output=json
i'm using shared_config_files using array too
You can also remove the shared_config_files line completely, and change shared_credentials_files to shared_credentials_file. You'll also need to remove the [ ] brackets, but other than that should be good to go.
if anyone has any problem with this do remove profile = "vscode"
To anyone else following this advice, you must also completely close Visual Studio Code (VSC) in order for the changes in the path variables to take place. After that you should be good.
I was looking for a simple yet comprehensive terraform course , and I found this , just like so!! 😉
This tutorial was really amazing. I knew nothing about terraform and now I can deploy my projects!
No word of thank you could justify your effort and explanation. You are just just awesome. I really appreciate the hard work.
HUGE humble request please!! Bring a next video and include Modules, data, ENV_VARIABLES (how to use them), also would be nice if you could include a reat time project (mid-->expert level please).
I am new to terraform but your video is a great source of learning. many thanks
Nice tutorial, a really nice way for me to get started with Terraform. It was at time challenging to follow along because of the scripts that were not available, but I made it to the end. It took me two days.
The timing is impeccable, just started working with terraform today
Fr same lol
I hope it helps!
@@FreeStyleSloth 5m 5th t44tt54rrrre de bo⁰0 p] p
Same😅
For those who are getting stuck with launching an instance:
If you get an error saying that query has no results, it's because data "aws_ami' "example" is used with already registered AMIs. Try using aws_ami_ids instead. Browse the documentation as it is always changing
This was definitely worth going through for someone who is trying to learn more about Terraform!
Thanks for this awesome video. Everything worked for me except I couldn't SSH into my instance via VS code. However, I am able to ssh in using Putty. Once again thank you so much this is a very well put together course. Appreciate it. I like to learn Terraform for Kubernetese.
It's now or never for me in my path to becoming a cloud administrator. And it starts here
Okay
Hey, how's it going for you?
@@Dru-y4s it’s going good, went one step further to cloud engineering!
Really appreciate! I'm a new on terraform and not good at english all were very clear and understood me.
Really amazing course! easy to follow and understand the concepts. Thanks for sharing, I enjoyed it a lot!
Very engaging and helpful course for a beginner like me. I would love to watch and learn how terraform works with gitlab cicd pipeline to deploy.
Good stuff. Did anyone count how many times the instructor spoke "just like so"? 😀
Did anyone have an issue with docker not being installed in the instance after following the instructions to build the userdata.tpl file. Thanks in advance.
Same here. And I never recalled him actually providing the .tpl script to copy, so I typed by hand. May have to find a way to install all these manually or with another solution. That's the problem with these FreeCodeCamp videos.
My suggestion: downvote and try to combine with a different solution
That was perfect - clearly stated, described. Thank You!
one of best teachers
Thank you for the Great explanation!..Excellent content.
Loved it. Kudos!
Just looked at this yesterday and now today here is a vid... Wow
This was a great walkthrough. Thanks for taking the time to make it :clap: :bows:
Currently stuck on the SSH Config Script(1:05:08). I installed "remote ssh" but when input "~/.ssh/config" in the terminal i get an error because the file does not exist. Any tips on how to sort this? thanks in advance
Very nice, just like so 🙂
Great content, thanks for sharing.!
Very useful content every day you puplished valuable contents thanks very much fot that 😍🌸👍
Thank you very much Derek Morgan !!! it is very detailed and simple to follow and do in parallel...
Super easy to follow tutorial. Great explanation too!
Thank you for this offering 👍
A very detailed explanation helpful for beginners
Great Video, Just like that!
Take a shot for every time he says "Just like so"
do you have another example on setting up SSH config scripts? I'm getting an error and I don't have a config file on my .ssh folder. Thank you and more power!
Same thing happened with me as well, but we can do it manually,
Install the “remote ssh” plugin , open command pallet, search for “ssh” and click on ”add host” ….it’ll generate the config file….after that when you’ll search for “connect to host” on command pallet…it’ll work same as shown in the tutorial
Thank you for this!@@aniruddhsingh1725
Very high quality content and perfectly explained.
Super cool tutorial thanks to creating it.
Hi Derek. Thanks for this training. It is one of the best. Where can I find the script for the Docker? Thanks
Excellent course, Thanks a ton
Thank you, just like so.
i think there may be an issue with the userdata piece. Docker does not seem to install.
Same thing on my end. I ended up installing it manually while I was connected to the EC2 via SSH.
Where can I find tpl-template file?
Great video, thank you so much!
Very very nice contents...💯
great learning experience any one can suggest next level up recommendation
Amazing, congratulations..
Awesome video!
bro how do you managed to get the cidr block at 15:59
Where's the script for userdata.tpl at 1:01:00 into the video ?
I can't get the script to install docker, I couldn't find it either so I typed it
Hello Derek, AWESOME Tutorial!! I have been following this class and executing as you're executing the tasks. I am experiencing an issue when attempting to execute the bootstrap in the userdata.tpl file. The script is complaining about the "#!/bin/bash". The server did deploy, but docker was not installed. I am not seeing the issue with this standard bash command. Any advice?
i have been troubleshooting this but can't get it resolved. "Error: creating EC2 Instance: InvalidParameterValue: The architecture 'x86_64' of the specified instance type does not match the architecture 'arm64' of the specified AMI. Specify an instance type and an AMI that have matching architectures, and try again. You can use 'describe-instance-types' or 'describe-images' to discover the architecture of the instance type or AMI."
@Nodir F Yes. I just resolved it. the problem is the image type selected. so instead of using ubuntu -22-armd64, I look for the one with amd64.
I need to add that I changed the machine type as well.
Great course, but would be nice if userdata.tpl file was provided somewhere as making sure I copied it correctly took up some time. I checked the link provided in the description but couldn't find it.
Okay
I was thinking the same, but surely without a doubt one of the most practical and functional videos out here about Terraform with AWS.
don't be lazy, just type it out.
I have been following the tutorial exactly as showed, but I cannot ping the public IP of the EC2 instances I create. Does anyone know why that is? I have been stuck for a while now and need help.
I understood. I was using the wrong personal IP, I have mistakenly put the internal IP rather than the external IP, I was trying to use a private network IP address which obviously prevented me to connect to the EC2 instance
One weird thing I'm experiencing: my route table has the 'name' tag set to 'dev_public_rt', and the tag shows as such in the AWS console; however, the 'Name' column is still blank for it in the console's 'Route tables' list, unlike how it shows in this video 39:28. I know I can manually add that label easily, but wondering if something is different on the code level...
Hey, can you try setting it to Name = "dev_public_rt" and see if it will work? * I used Name instead of name on my end, and it worked as expected.
@@justinshobby Hi Justin, and thanks for the note! Sadly setting the tag to 'Name' instead of 'name' didn't work for me still - the 'Name' column for the RT remains blank.
01:29:18 - dev.tfvars file creation
I cant find my ssh config script it is not at the location ~/.ssh
Have you been able to figure this out?
Hay Derek, i couldnot use the provisioner block on this course. When i ran the terraform plan it says the provisioner block is not expected here.
What can i do here as an alternative.Thanks
I was able to make SSH connection work from VScode. But, I don't understand what the purpose is to have direct SSH link from inside VScode. Don't you do the same thing with separate SSH connections from putty? Or, you want to run tests directly from EC2 instance with code managed by VScode, version control type of stuff?
Hay Derek, please can you help show me where to find the userdata script for this course.Thanks
I love the video. There's just one thing I don't understand well: I don't know why, but there were two "sudo" in sequence in that userdata. Did that not cause any errors?
@Rodrigo Araújo e Castro When Ubuntu EC2 instance is provisioned/created, you're allowed to access using default user which is ubuntu in this case. you can't access with root user. However, ubuntu user is already present in sudoer file to run any sudo command without password. That's why when you're running super admin commands(apt update && apt install package-name) with ubuntu user, you have to pass sudo first. Hope this helps.
@@DevOpsHawk I mean why using "sudo sudo"? It worked with only one "sudo" before each command.
But it's alright. Thanks.
My bad, I overlooked "sudo sudo" in userdata.tpl(second last line) file. That's a typo mistake, I believe.
it is causing error how do we ssh using mac ?
@@shaunrod114 No, I don't use Mac. It was a typo, as it was told already.
really good stuff but need to zoom in on code for the viewer. It was hard to see.
Any heads-up on terraform with azure?
has anybody found a workaround, for the "cat ~/.ssh/config" command not pulling the instance IP into the ssh config file?
nevermind, figured it out. i was using "()" instead of {} in the windows-ssh-config.tpl file
@@radegold3122 still didn"t figure it out: is this what you mean?
add-content -path c:/users/.ssh/config -value @'
Host ${hostname}
HostName ${hostname}
User ${user}
IdentityFile ${identityfile}
'@
Thanks! 🙏
I get this error msg in my "aws_vpc" "mtc_vpc" resource: enable_dns_hostnames = true A reference to a resource type must be followed by at least one attribute access, specifying the resource name. Any suggestions, please?
Trying to go through the tutorial now and it seems I cannot run 'terraform init' around 11:49 in the video. It gives me a;
"terraform : The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."
Anyone know how to fix this?
Maybe it's an environment variable issue. Check on Google for fix as per your OS.
It sounds like it was not installed correctly. As the other comment states, it's probably an environment variable issue. Make sure you follow the instructions very closely here: learn.hashicorp.com/tutorials/terraform/install-cli
Yes, because you need to download and install terraform, which was skipped in the video.
@@screechwork6362 yup this
This is great... Please please please... Can you break it up into chatpers and (bitesize) sections with appropriate names/labels so that one can easily reference particular aspects?
42:45 In Ingress option of SG, where you mention we can put our own IP address (to make sure we are the only 1 who can access our instance).
I tried to implement that by checking my ip from google & when i ran 'terraform plan' it says:
│ Error: "" is not a valid CIDR block: invalid CIDR address: ""
│
│ with aws_security_group.my_sg,
│ on main.tf line 68, in resource "aws_security_group" "my_sg":
│ 68: resource "aws_security_group" "my_sg" {
What could possibly the solution to this ?
Do i need to assign my VPC (+Subnet) CIDR value to be matching to my current IP to follow this step ?
The video was nice.. it would have been even more beneficial if there was some explanation on the resources itself..like what is subnet and what is routingtable etc. Maybe a separate video on that..
Adrian Cantrill does a good job at that. This course asumes that you know some AWS already. I would recommend ua-cam.com/users/LearnCantrill
There is no config file in my .ssh directory. how do I get it?
I figured we can do it manually,
Install the “remote ssh” plugin , open command pallet, search for “ssh” and click on ”add host” ….it’ll generate the config file….after that when you’ll search for “connect to host” on command pallet…it’ll work same as shown in the tutorial
Thankyou verymuch ..@@gideondavid9074
Excellent help. Thanks a million.
Great video, except that local provisionar it was a bouncer.
Sorry Im starting this GREAT tutorial im amazed by, but where is the script for the boostrap the EC2 installing docker?? hahahah I cant find it anywhere or even on the official page, can someone paste it here? thanks!
Is there a way to have AWS account without using credit card?
Hello, Great video. Just an update regarding the shared_credentials_files, I struggle with the format of the string. The one that works needed the square bracket around the string. This format works ["C:/users/nameofuser/.aws/credentials" ]
Having trouble with connection 22 errors. cannot connect via SSH
I like your way
Is the cidr_block just whatever we want or should it be something specific? I don't think that part was well explained.
buenas noches ! Consulta, que tiempo se necesita para ser PRO en Terraform ? Saludos Cristian de Argentina
how did you run a windows script on ubuntu
Hi Derek
Please can you share the link to the script for the Linux ssh file?
Thanks
On point
Great tutorial! however, I'm having trouble trying to ssh into the instance. I keep getting a connection timeout.
Any help or suggestions would be greatly appreciated.
Check the security group if it has port 22 enabled.
did you manage to solve it? I am having the same problem
Hello I can't find the script files, for both boostraping the instances and for the windows ssh config
I found it thanks!
@@calebemmanuel5178 can you share the link to the script files. I typed out the userdata however when I ssh into the instance docker isn't installed :(
Great
You need to install terraform binaries in your PC before following this tutorial otherwise even the first command "terraform init" will not work
where, c/drive
@@golieanyirenda anywhere. just place path of that exe file of terraform to your environment variable path
Its better keep your profile in credentials and export it rather than configuring in vscode i will chose cli wsl
Where's that userdata.tpl script?
on 12:00 facing issue
I think the block device was small?
And just like so!
I need some help. I’m stuck on the terraform init command. It’s saying terraform is not recognized
Saw the comment below saying installing terraform was skipped in the video.
I’m getting
install terraform and aws cli - those are the prereqs.
Is this mv7 mic?
Where is the code for future reference?
I can't see the resources on AWS console for vscode user.
Figured it out: Global view.
@@marq_8976 or you can select the region in which your created stated in the code which is "us-west-2"
can someone tell me why I did the userdata.tpl file when I spin up the EC2 it says I have to install docker. I literally copied the code from MTC's github but it docker isn't install on the EC2 instance? Please help!
Sometimes it takes a bit for Docker to become installed. You may have to wait a few minutes for it to work. Also, ensure you're using the right Ubuntu instance. If you use CentOS or a distribution that doesn't utilize apt, it will fail.
Dont forget to "terraform destroy" after the end of this course 😅