Terraspace Is A Terraform Framework that optimizes for infrastructure-as-code happiness. It provides an organized structure, and conventions over configurations, keeps your code DRY, and adds convenient tooling. You can keep your code DRY. Terraspace builds your Terraform project with the common app and config/terraform structure that gets built each deployment.
2. Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Join the session 5 minutes prior to the session start time. We start on
time and conclude on time!
Feedback
Make sure to submit a constructive feedback for all sessions as it is very
helpful for the presenter.
Silent Mode
Keep your mobile devices in silent mode, feel free to move out of session
in case you need to attend an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during the session.
3. 1. Introduction to Terraspace
2. Features of Terraspace
3. Terraspace Project Structure
4. Demo – Azure storage deployment
4.
5. What is terraspace?
Terraspace is a Terraform framework used for the infrastructure provisioning.
It provides an organized structure, conventions over configurations, keeps your code
DRY, and adds convenient tooling.
It makes it easier and more fun to work with Terraform.
It is open-source project written in Ruby programming .
6. Installation
Dependencies:
Terraspace currently only works on MacOSX and Linux.
Terraform is required .
Install the corresponding cloud provider CLI tool that you are using. Example:
o AWS: aws cli
o Azure: az cli
o GCP: gcloud cli
Setup :
sudo su
echo "deb https://apt.boltops.com stable main" > /etc/apt/sources.list.d/boltops.list
curl -s https://apt.boltops.com/boltops-key.public | apt-key add -
apt-get update
apt-get install -y terraspace
terraspace –v
Note : export TS_WRAPPERS=0 and export TS_VERSION_CHECK=0
8. Features
DRY: You can keep your code DRY. It provides organised file structure which has no
duplicated configuration files.
Multiple Environments: Tfvars & Layering allow you to the same code with different tfvars to create
multiple environments.
Deploy Multiple Stacks: The ability to deploy multiple stacks with a single command. Terraspace
calculates the dependency graph and deploys stacks in the right order. You can also target specific
stacks and deploy subgraphs.
Terrafile: Terraspace makes it easy to use Terraform modules sourced from your own git repositories,
other git repositories, or the Terraform Registry.
Generators: Built-in generators to quickly create the starter module. Focus on code instead of
boilerplate structure.
It also has rich support for automatic backend creation , testing framework , secret support,
terraspace cloud and enterprise support.
11. Description of Files & folders
Name Description
app/modules
Reusable modules or library code. Use terraspace
new module to generate a module.
app/stacks
Business specific modules. Use terraspace new
stack to generate a stack. It is often useful to start
here and then abstract generic logic to the
app/modules folder.
app/stacks/demo/tfvars
Within each stack folder, you can have a tfvars folder
and define different variables. You can use tfvars
layering to use the same code to create different
environments.
config/app.rb
Terraspace project-level settings. Configure things
like the logger and test framework.
config/terraform
Common code that gets built with the deployed
stack. It can be dynamically controlled to keep your
code DRY.
Terrafile
The Terrafile is where you define additional terraform
modules to be loaded by terraform bundle.
12. Modules & Stacks ?
Terraspace will look for files in the app/modules and app/stacks folders. Both folders contain
Terraform modules. Terraspace introduces the stack concept for organizational purposes.
• Modules are reusable pieces of code. Generally, it contains non-business specific logic.
• Stacks can be used to group together modules. Generally, this is where more business-specific
logic can go.