From the course: Learning Terraform

Unlock the full course today

Join today to access over 23,500 courses taught by industry experts.

Split out your data

Split out your data - Terraform Tutorial

From the course: Learning Terraform

Split out your data

“

- [Instructor] We're about ready to convert our code into a module but first we'll need to do some work to pull out the configurable values. The way I like to tackle this kind of thing is to start by duplicating my entire code file into the variables file. That saves a lot of back and forth with copy and paste. To get started, open up main.tf and we'll just highlight the entire thing and copy it and then open up your variables and you can paste that in. If we go back up to the top, the goal here is to find anything we think will work better as a variable. So anything we might want to configure later on. If that isn't making sense, just follow along, I think it'll start to make sense as we go. So to start with, we have some values that might change for our app_ami. We have the filter and then the owner that goes along with it. So if I highlight this and delete and then delete these sections and this part, I just have the values then that I'm trying to replace. So we can use this to…

Contents