- In this lesson, we're gonna learn about
the HashiCorp configuration language, commonly known as HCL.
This is the,
the configuration language that we use to tell Terraform
the state that we want our cloud provider to be in,
so we're gonna list all the resources that are required
for our solution,
using HCL.
So let's just start out talking about the project layout
for a Terraform project.
You can see here, if you look at my screen,
we've got,
we've got three files
in a folder.
Okay, so Terraform is
specified by its context, so a folder
with
HCL files or .tf files constitutes what's called a module.
Now in this case, it's the root module,
and we'll get into some modules in
a later lesson.
But for right now, you need to know
that everything in this directory
is considered to be part of the Terraform configuration.
It doesn't matter which of these files
the resources or other objects are listed in.
By convention,
there's always a file called main.tf,
outputs.tf, and variables.tf.
Main is typically where all the resources are declared.
Outputs is where the outputs are declared,
and variables are where the variables are declared,
and we'll talk about what outputs and variables are,
we haven't gone over that yet.
But we'll talk about that soon.
Sometimes, if main becomes very large,
there will be additional TF files in here,
but that's usually a good time to start using modules.
And again, we'll talk about those in a later lesson.
But for now, just realize that
the contents of the directory
define the extent of the Terraform configuration.
And that is not recursive, so it's
everything in the top level here.
You can do a normal
Terraforming knit.
And...
Okay, now this has read
the configuration in all three of these files
in order to do
its plan and,
and a knit.
It doesn't matter which of these files
you list your resource in.
It doesn't matter what order your resources are listed in.
So we'll talk about that as we get further into this.