days
-4
0
hours
-1
-9
minutes
0
-2
seconds
-1
0
search
Latest features

Terraform v0.12 overhauls language syntax & improves functionality

Sarah Schlothauer
terraform
© Shutterstock / Dotted Yeti

The latest release of HashiCorp’s Terraform is here. Version 0.12 overhauls the language, adding several improvements and changes. New features include first-class expression syntax, a generalized type system, iteration constructs, and more. Follow the upgrade guide to begin.

All eyes on Terraform: The recent bi-annual ThoughtWorks report listed this infrastructure as code software tool as a recommended UI dev environment. Now, a new release breaches the horizon.

On May 22, 2019, the Terraform team at Hashicorp announced the latest update: Terraform 0.12. Version 0.12 includes some new features and several improvements focused on config language improvements.

Language improvements

This update overhauls the language syntax. From the 0.12.0 changelog:

The focus of v0.12.0 was on improvements to the Terraform language made in response to all of the feedback and experience gathered on prior versions. We hope that these language improvements will help to make configurations for more complex situations more readable, and improve the usability of re-usable modules.

However, an overhaul of this kind inevitably means that 100% compatibility is not possible. The updated language is designed to be broadly compatible with the 0.11 language as documented, but some of the improvements required a slightly stricter parser and language model in order to resolve ambiguity or to give better feedback in error messages.

SEE ALSO: 10 things to consider while developing mobile apps with React Native

With v0.12, previous limitations of Terraform’s syntax and language engine have been altered.

It also adds several requested features from the community.

New features

Some of the highlights added to Terraform 0.12 include:

  • First-class expressions: This new syntax change integrates expressions. Use expressions directly as argument values instead of using string interpolation syntax.
  • for expressions: Create complex type value via transforming another complex type value
  • Nullable argument values: Leave an argument value unset
  • jsondecode and csvdecode interpolation functions
  • New built-in functions:templatefile , formatdate, and reverse
  • Improved error messages: Error messages now includes additional contextual info and suggests actions to take for common issues.
  • dynamic blocks: Dynamically generates nested configuration blocks for resources.
  • New plan renderer: Re-structures plan output and integrates the new type system
  • Generalized type system: Richer type system introduces new options for passing objects and other values between modules.
  • Improved JSON-based variant syntax: See the notes and changes here.
  • Various bug fixes
terraform

Improved, contextualized error messages. Source.

See the full list of what’s new in the changelog on GitHub.

Upgrading to the latest version

Upgrading to the new release? Follow the upgrade guide for in-depth steps, commonly encountered issues, and the pre-upgrade checklist. As previously mentioned in the changelog, the overhaul in this new release can create compatibility issues.

SEE ALSO: Create, debug, and deploy Java & Python applications with AWS Toolkit for IntelliJ

The changelog also presents incompatibilities and notes for the update.

For further learning, HashiCorp provides various lessons about building infrastructure in AWS, migrating to the cloud from local state storage, and more.

Download the v0.12 package here.

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of