Terraform v0.12 overhauls language syntax & improves functionality

Share

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.

The post Terraform v0.12 overhauls language syntax & improves functionality appeared first on JAXenter.

Source : JAXenter