Jeremy's IT Lab
Day 63 Part 2Automation

Terraform

22m7 chapters85 cues12 cards
Day 63 Part 2YT: VAwUaffejWU
00:00 / 22:29

Synchronized Transcript

85 cues indexed • Click dialogue or words to jump
Jeremy

Hi from Tokyo Japan and welcome to Jeremy's IT Lab in this video we are covering another recent addition to the CCNA exam Terraform the exam blueprint previously listed anible puppet and Chef as the configuration management tools you need to know for the exam Cisco recently changed.

Jeremy

That to anible and Terraform however I'm keeping puppet and Chef in the course for two reasons first notice the wording of the new exam topic recognize the capabilities of configuration management mechanisms such as anible and Terraform for me the words such as imply that there.

Jeremy

Could be others on the exam second puppet and shef help illustrate key Concepts like comparing the agentless architecture of anible and Terraform to the agent-based architecture of puppet and Chef.

Jeremy

So instead of modifying the previous video I'm adding this new one to focus on form before we get started let me take a minute to shill my books acing the CC exam volumes 1 and two these books cover everything on the latest version of the CCNA exam including the topics of this.

Jeremy

Video the very final chapter chapter 25 of volume 2 focuses on Ansible and Terraform and also includes a bit about puppet and Chef I always recommend using books in combination with a video course.

Jeremy

So if you want to get my books check out the links on the screen now to buy them directly from the publisher or find them on Amazon now let's get started.

Jeremy

So what are we going to cover in this video of course the focus is on Terraform but I'll take the opportunity to introduce a few new Concepts specifically we'll talk about the concept of infrastructure as code IAC Terraform and the other tools we've covered are examples of IAC then we'll.

Jeremy

Compare infrastructure provisioning and configuration management whereas anible is primarily used for for configuration management Terraform leads towards provisioning we'll then cover the concepts of mutable and immutable infrastructure and procedural versus declarative approaches.

Jeremy

Finally we'll shift our Focus to Terraform itself and cover its Basics okay let's begin first let's look at the concept of infrastructure as code actually we've already covered it I just didn't use the specific term in the last video infrastructure as code IAC is is the.

Jeremy

Practice of provisioning and managing infrastructure such as servers networks and Cloud resources using machine readable configuration files code instead of manual configuration via CLI or or GUI that probably sounds familiar.

Jeremy

Because anible puppet and Chef are examples of IAC configuration management tools for example anible manages device configurations using several files that are used by the control node we covered these in the previous video anible uses Playbook inventory.

Jeremy

Template and variable files anible runs on the control node and uses these files to manage the infrastructure instead of configuring the devices via the CLI or GUI their configurations are managed via these code files hence the term infrastructure as as code Terraform.

Jeremy

On the other hand is an IAC based provisioning tool that automates the creation of infrastructure resources in the next slide I'll click clarify the difference between configuration management and provisioning.

Jeremy

But Terraform is primarily used for used for provisioning so to summarize infrastructure as code automates infrastructure deployment and management ensuring consistency scalability and repeatability basically the various benefits of automation that we covered in previous videos.

Jeremy

So I mentioned that anible puppet and Chef are primarily configuration management tools whereas Terraform is primarily a provisioning tool.

Jeremy

Let's clarify what the difference is first what is configuration management tools like anible puppet and Chef manage existing infrastructure by installing software configuring settings and maintaining system State this ensures consistency by applying and enforcing.

Jeremy

Configurations across multiple devices again these are the benefits of anible puppet and Chef that I covered in the previous previous video as for infrastructure provisioning it creates modifies and deletes infrastructure resources such as servers and network infrastructure.

Jeremy

For example creating virtual servers and routers on a cloud platform like AWS but the focus is on initial setup rather than ongoing configuration management to summarize configuration management tools work on already existing systems whereas provisioning tools build infrastructure.

Jeremy

From scratch of course these tools can be used together together for example Terraform a provisioning tool and anible a configuration management tool often work as a pair Terraform Provisions infrastructure creating VMS Network infrastructure storage and other.

Jeremy

Resources while anible provides ongoing configuration and management maintaining those systems with all of that said both Terraform and anible have some overlap each can perform both provisioning and configuration management to some extent.

Jeremy

But their strengths are different so they're often used together one major difference between infrastructure provisioning and management tools is the approach they take with the infrastructure is the infrastructure mutable or immutable configuration management tools typically use a mutable.

Jeremy

Infrastructure approach this means that infrastructure can be modified after deployment such as applying updates patches or configuration changes in other other words changes are made in place meaning existing resources are updated rather than replaced.

Jeremy

This is just like when you manually modify a device's configuration in the in the CLI so when using a mutable approach if you want to update the config of this VM anible or a similar tool would simply update the config while leaving the VM itself in place only the relevant settings.

Jeremy

Are settings are changed so what's the alternative to mutable mutable infrastructure provisioning tools like Terraform typically employ an immutable infrastructure approach this means that infrastructure cannot be changed after deployment.

Jeremy

So any changes you make involve replacing the previous resource with a new one if you want to update the configuration of this VM Terraform or a similar tool would have to create an updated instance of the VM with the configuration changes applied.

Jeremy

And then destroy the old instance one benefit of this approach is that there is no configuration drift each deployment starts from a fresh predefined State there's no opportunity for individual changes to accumulate with each configuration configuration drift isn't a major issue.

Jeremy

When anible or other mutable infrastructure tools are properly managed but terraforms immutable approach virtually eliminates the risk altogether the final concept we'll cover before focusing on Terraform itself is the difference between a procedural and declarative.

Jeremy

Approach some tools take a procedural approach to managing infrastructure also called an imperative imperative approach this means that the tool follows explicit steps in a specific order to achieve the desired outcome.

Jeremy

So the user the engineer using the tool must Define each specific action in the correct order to configure the infrastructure this provides greater control than the declarative approach will'll cover.

Jeremy

Next but is more demanding on the user they have to know exactly which steps are required to achieve their desired end result and in which order those steps should be executed then there is the declarative approach which defines the desired end State instead of the specific steps the tool itself.

Jeremy

Such as Terraform figures out the steps needed to achieve the goal this makes it easier to maintain and ensure consistency across deployments because the user doesn't have to worry about ordering individual commands and configurations on each platform they only have to think about defining what they want.

Jeremy

The final result to be so to summarize a procedural approach focuses on how to make changes with explicit steps for example when configuring a new router configure the router's host name with host name R1 configure the IP address of g01 with the IP address command.

Jeremy

Enable the interface with no shutdown and so on these are the specific configurations needed on a Cisco router and the steps would be different different.

Jeremy

If it was a juniper router for example a declarative approach on the other hand focuses on what the final State Should Be You Can Tell Terraform create a router named R1 with IP address 192.168.1.1 24 on its g01 interface ensuring the interface is enabled Terraform.

Jeremy

Should then figure out the necessary steps to achieve that end state so I've mentioned that Terraform uses a declarative approach but you're probably wondering about the others.

Jeremy

Here's a table I've categorized anible and Chef as procedural but it's worth noting that they do have some declarative elements as well especially anible people who use anible a lot might get angry at me for categorizing anible as procedural.

Jeremy

But red hat the company that owns and develops anible also says it is procedural so for your CCNA studies I'd say it's best to consider anible a procedural tool meanwhile Terraform and puppet use a Clara of approach allowing you to define the desired end State and let the tool figure.

Jeremy

Out the rest for you finally let's move on to Terraform which is an open source IAC tool developed by Hashi Corp an American company that was acquired by IBM in 2025 as I've mentioned a few times it is primarily a provisioning tool focused.

Jeremy

On deploying infrastructure resources on various cloud and on-prem Platforms in Terraform these platforms are called providers and include AWS Azure gcp kubernetes and many more it supports over 1,000 different providers for CCNA students this includes.

Jeremy

Integrations with Cisco platforms like Catalyst Center ACI which is application Centric infrastructure Cisco's data center SDN solution and IOS XE which is the type of IOS you'll find on Modern Cisco devices like Catalyst switches like anable.

Jeremy

Terraform uses a push model and is agentless it doesn't require a software agent on infrastructure it Provisions or manages okay.

Jeremy

Now let's see how Terraform actually works at the core of Terraform is Terraform core this is the main Terraform software typically running on a Linux server that processes configurations and interacts with providers an engineer creates Terraform configuration files which.

Jeremy

Specify the desired end state in a declar ative fashion it's up to Terraform core to take that desired end State and deploy the necessary infrastructure on the appropriate provider or providers such as deploying Cloud resources on AWS it does this via each provider's apis.

Jeremy

And one more key element is the state file which Terraform uses to track the state of the deployed infrastructure by comparing the current state of the infrastructure to the desired end State defined in the configuration files Terraform can identify which actions it needs.

Jeremy

To take and in which order to achieve the desired result to summarize these are terraforms four key components all working together to provision and manage manage infrastructure Terraform core the core software developed by hashicorp configuration files which an engineer creates to define the.

Jeremy

Desired end state of the infrastructure the state file which tracks the current state of the deployed infrastructure and and the providers the platforms on which the infrastructure is deployed.

Jeremy

Let's cover a few more key points about Terraform the basic Terraform workflow consists of three main steps the first is write in which you define the desired end state of your infrastructure resources in configuration files.

Jeremy

The second step is plan where Terraform analyzes your configuration files and shows you exactly what changes will be made this lets you to review and confirm the changes before applying them and the.

Jeremy

Third step is apply where Terraform executes the plan to provision and manage the infrastructure resources that's basically how it works.

Jeremy

If you think back to Ansible hopefully you remember that anible itself is written in Python while its playbooks are written in YAML so what about about Terraform while Terraform core is written in go the configuration files that Define the desired end state are written in Hashi Corp configuration.

Jeremy

Language language HCL HCL is an example of a domain specific language DSL which is specialized for a particular purpose like puppets DSL mentioned in the previous previous video since dsls are designed for specific tasks they make complex operations simpler and they.

Jeremy

Require less effort compared to general purpose languages like python or go the downside is that HCL is another thing you have to learn specifically to use Tera form.

Jeremy

But it's relatively simple compared to learning a full programming language so the key points to remember here are the three steps of the Terraform workflow write plan and apply and also.

Jeremy

Remember that Terraform core is written in go while the configuration files you make are written in Hashi Corp configuration language HCL which is a domain specific language.

Jeremy

Okay those are the basics of Terraform now here's a one slide summary before we move on to the quiz infrastructure as code is the practice of provisioning and managing infrastructure using machine readable configuration files instead of manual configuration anible puppet chef and.

Jeremy

Terraform are all examples of IAC tools but not all IAC tools are used for the exact same purpose configuration management tools like anible puppet and Chef focus on managing existing infrastructure doing things like installing software configuring settings and generally maintaining.

Jeremy

The state of your your systems infrastructure provisioning tools like Terraform on the other hand focus on creating modifying and deleting infrastructure infrastructure resources that doesn't mean that anible can't be used to provision resources or Terraform can't be used to make configuration changes it's.

Jeremy

Just that each tool is better fit for a different purpose we then covered mutable infrastructure which means that the infrastructure can be modified after deployment and immutable infrastructure meaning that it cannot be changed after deployment any changes involve replacing the previous.

Jeremy

Resource with a new updated version and then deleting the old one provisioning tools like Terraform use an immutable approach whereas management tools like anible use a mutable approach to to infrastructure we then compared the procedural and declarative approaches a procedural also called.

Jeremy

Imperative approach follows explicit steps steps in a specific order to achieve the desired outcome and these steps must be specified by the engineer using the tool a declarative approach defines the desired end State and the IAC tool such as Terraform figures out the steps needed.

Jeremy

To achieve that goal and in which order they should be executed okay finally we looked at Terraform itself it's an open- Source IAC tool developed by Hashi Corp it's primarily a provisioning tool used for deploying infrastructure on providers like AWS.

Jeremy

Azure gcp kubernetes Etc Terraform interacts with these providers via their apis like anible it uses a push model and is and is agentless its main components are Terraform core the configuration files where you specify the desired end State the state.

Jeremy

File that tracks the current state of the infrastructure and the providers the basic workflow consists of three main steps rate plan and apply you could also add a fourth step there destroy in which you delete the resources after they are no longer needed.

Jeremy

But these three are considered the main the main steps Terraform core is written in go and the configuration files are written in Hashi Corp configuration language which is a domain specific language all right.

Jeremy

That's what we covered in this video just a very high level overview of Terraform but as long as you know these Basics you should be ready for the CCNA exam.

Jeremy

Now let's do a short quiz to test your understanding here's quiz question one which of the following are characteristics of Terraform select two pause the video.

Jeremy

Now to think about your answers okay the answers are B declarative and C immutable infrastructure Terraform uses a declarative approach in which you specify the desired end State and Terraform takes takes care of the rest for you it also uses immutable infrastructure where.

Jeremy

A particular resource can't be changed after provisioning to change a resource Terraform will deploy a new version of the resource and then delete the old one instead.

Jeremy

Okay next question here's question two what are the three main steps of the Terraform workflow pause the video now to think about your answer.

Jeremy

Okay the answer is D WR plan apply in the right step you define the desired state of your infrastructure in configuration files in the plan step you verify the changes that will be executed before applying them.

Jeremy

And then in apply Terraform applies whatever changes necessary to bring the infrastructure in line with the desired State now let's do one more question.

Jeremy

Here's quiz question three which of the following IAC tools are focused on configuration management select three pause the video.

Jeremy

Now to think about your answers okay the answers are a c and d anible chef and puppet are primarily used for configuration management whereas Terraform is a provisioning tool to take advantage of.

Jeremy

The strengths of each it's fairly common to use a combination such as Terraform and anible these tools aren't exclusive and can can be used be used together.

Jeremy

Okay that's all for this video we covered some additional concepts related to infrastructure as code that weren't covered in the previous video and then focused on the basics of Terraform a very popular IAC provisioning tool for the CCNA exam I recommend knowing the basics of Terraform introduced in this video you should also.

Jeremy

Be able to compare and contrast it with the other tools we covered in the previous video anible puppet and Chef I hope this video was helpful thanks for watching before finishing this video.

Jeremy

Let me thank my jcmp level channel members who support me through YouTube channel membership to become a member please click the join button under the video thanks to yonathan MAA George Gustavo maedo Marcel Lord dros Hera Zak Shaw mayor Salman Mark Jackson.

Jeremy

Bold c1u Gerald Guam Hector Hernandez arpad conz F feet oad Daniel Brown Jose Alvarez jusan yavuz Samuel Tavarez Kevin Hayes Brian Grant Gori gev Addison Pereira madm Mark 50484 Alexander Straton dmj 2 Steve.

Jeremy

Cox Jasper Yim Pedro Hartman tricky Mickey 123456 Jefferson steel Flex toxic cenan cinar Wilmer Romero Daniel Andrade dragos George Philip yovanovich Sunny igu hello BPDU edifer mikal chapski Haman jabal Puri.

Jeremy

Darush D Juan Morales Gonzalo Nicolas doomed Soul Julio Maya egreso Hashem Roda Anand Aban Clyde Muro bindo orando Flores Adrien Martinez gg7 Ray Enriquez Tobe hedin MDS Electro naria.

Jeremy

G Gant Henrietta SAU yuk shika Uma Shankar Sharma Alara beler sebz James Corley Alexi usov seram gasam excelus Captain Flamingo to be like our superheroes muhamad Balta Tazo ganad opero.

Jeremy

Muhammad Mateo Falcone omole Seline genre be good Zack Ross I'm me 87 cind on KD Marco Christ ready Adventures limited DB Foreigner and Manuel morote sorry.

Jeremy

If I pronounced your name incorrectly but thank you so much for your support thanks to you and my other supporters I am able to make these videos and release them for free on YouTube.

Jeremy

So I really appreciate the support another great way to support the channel is to like the video leave a comment subscribe and most importantly share this video with others.

Jeremy

So if this video was helpful I'd appreciate it if you did any of those thanks for watching [Music].

Keyboard shortcuts

Shortcuts are ignored while you are typing in a search box, note field, or the scratchpad.

Playback

SpaceK
Play or pause
←→
Seek 5 seconds
JL
Seek 10 seconds
C
Toggle in-video captions

Scrubber (when focused)

←→
Seek 5 seconds
Shift←/→
Seek 10 seconds
Page UpPage Down
Seek 30 seconds
HomeEnd
Jump to start or end

Flashcards

Space
Reveal the answer
1234
Grade Again / Hard / Good / Easy

Navigation

←→
Move between study-mode tabs
HomeEnd
First or last study-mode tab
?
Open or close this sheet