SlideShare a Scribd company logo
1 of 18
Download to read offline
TERRAFORM 0.13:
RISE OF THE MODULES_
Marko Bevc
BUILDING
BLOCKS_
“Abstraction of common blocks of
configuration into a reusable
infrastructure elements.”
— @sheriffjackson, 2018 blog
DRY code – Don’t Repeat Yourself
Everything is a module!
ABOUT
ME_ ●
Senior IT Consultant at The Scale Factory (DevOps consultancy,
AWS advanced consulting partner and K8s service provider)
●
IT system engineering and design background with extensive
Linux and virtualization experience
●
Certifications and competencies: AWS, CKA, RHEL, Hashi stack
●
Open source contributor and supporter
●
Fan of automation/simplifying things, hiking, cycling and travelling
TOPICS
COVERED_
●
Terraform time line
●
Module improvements
●
Provider ecosystem
●
Other enhancements and breaking
changes
●
How to get started and a demo
●
Conclusions and path forward
TERRAFORM
TIME LINE_
• Pre-v0.10 era (provisioners, state ENV, remote
state and locking)
• Period v0.10 – v0.11 (workspaces, core/provider
split, TF registry (private), module providers,
streamlined APPLY)
• Big changes with v0.12 (HCL2: 1st
class
expressions, gen.types, iterations/dyn.blocks,
structural plans and better error messages)
• Module and provider improvements in v0.13
HISTORY
2014 (initial v0.1.0) 2020 (v0.13) v0.14..1.0*2017 (v0.9-0.11) 2019 (v0.12)
MODULE
EXPANSION_
●
Improved module usability and functionality
●
Create multiple instances of a module from a single
module block:
– count (tuple/list)
– for_each (map)
●
Simplified configuration logic and better automation
●
Can create some indirect module-level dependencies
●
Cannot use provider blocks per module instance! *
(i.e. AWS regions)
locals {
resources = {
prod = "prod-eks"
qa = "qa-eks"
dev = "dev-eks"
}
}
module "eks" {
source = "terraform-aws-modules/eks/aws"
for_each = local.resources
cluster_name = each.value
cluster_version = "1.17"
subnets = ["subnet-abcde012", "subnet-bcde012a", "subnet-fghi345a"]
vpc_id = "vpc-1234556abcdef"
worker_groups = [
{
name = each.key
instance_type = "m4.large"
asg_max_size = 3
}
]
}
eks-clusters.tf
MODULE
DEPENDENCIES_
• Dependencies types:
– implicit
– explicit
• Previously module instances were NOT nodes in dependency graph
(just separate namespaces, dependencies via I/O values)
• depends_on meta-argument ensures order of module resource
changes – create after any dependent resource changes have been
applied
• Far more coarse declaration of dependency than encouraged – last
resort! (*auto deps: easier to maintain and maximise concurrency)
resource "aws_iam_policy_attachment" "example" {
name = "example"
roles = [aws_iam_role.example.name]
policy_arn = aws_iam_policy.example.arn
}
module "uses-role" {
# ...
depends_on = [aws_iam_policy_attachment.example]
}
PROVIDER
ECOSYSTEM_
• Improvements to Terraform Provider Registry
• Automatic install of 3rd
party providers
• Provider source block with namespace separation, defaults to
HashiCorp’s providers: [registry.terraform.io/][hashicorp/]type
• One provider per module, but nesting not recommended!
• Simplifying the installation of community providers:
– Official HashiCorp supported providers
– Partner-supported providers (needs required_providers now)
– Locally installed providers (3rd
party provider plugins):
./plugins/example.com/myorg/customplugin/0.1/linux_amd64/
OTHER
ENHANCEMENTS_
●
Custom variable validation rules (experimental since
v0.12, zero or more rules)
●
Terraform Cloud streamlined authentication process
(terraform login connects CLI to TF Cloud)
●
Providers mirror (terraform providers mirror)
●
Terraform CLI supports TLS 1.3
●
Breaking changes:
– Source for non-default providers
– Locking was improved and changes to the
TableStore schema now require a primary key
named LockID of type String
– macOS builds of Terraform CLI are no longer
compatible with macOS 10.10 Yosemite
– Terraform CLI now requires FreeBSD 11.2 or later.
variable "image_id" {
type = string
description = "The id of the machine image (AMI) to use for the server."
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^ami-", var.image_id))
error_message = "The image_id value must be a valid AMI id, starting
with "ami-"."
}
}
# NOT needed anymore
terraform {
experiments = [variable_validation]
}
Variable custom validation rules
HOW TO
GET STARTED_
●
Get binary from: releases.hashicorp.com
●
Ensure no pending configuration changes
●
Versioning or backup of code
●
Data resource reads can no longer be disabled - deps
●
Destroy-time provisioners cannot refer to other
resources – deprecated
●
New hierarchical namespace - explicit source for any
not HashiCorp-maintained providers
●
New directory structure for manually-installed
providers
●
terraform 0.13upgrade (gradual one release jumps)
●
Follow CHANGELOG for more details
TIME FOR
DEMO!_
CONCLUSIONS_
& TAKEAWAYS
●
Module improvements: expansion (count, for_each) and
dependencies
●
Provider source and hierarchical namespace – wider ecosystem
and required source, terraform mirror to avoid re-download
●
Custom validation rules for input variables
●
Streamlined Terraform Cloud auth CLI process
●
Improved state locking and schema changes
●
v0.14 (path to v1.0): possible features(CLI/Cloud parity, sensitive
values, import, module testing)
●
Resources:
– https://www.scalefactory.com/blog/2020/06/25/what-we-are-looking-forward-to-in-terraform-
0.13/
– https://www.hashicorp.com/blog/announcing-the-terraform-0-13-beta/
– https://www.hashicorp.com/blog/custom-variable-validation-in-terraform-0-13/
– https://www.terraform.io/docs/configuration/syntax.html
– https://www.hashicorp.com/blog/hashicorp-terraform-modules-as-building-blocks-for/
– https://www.hashicorp.com/resources/the-path-to-terraform-1-0/
– https://www.hashicorp.com/blog/announcing-terraform-0-12/
– https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
FURTHER
READING_
KEEP IN
TOUCH_
https://www.scalefactory.com/
@_MarkoB
@mbevc1
@mbevc1
https://www.linkedin.com/in/marko-bevc/
https://www.scalefactory.com/Web:
Twitter:
GitHub:
GitLab:
LinkedIn:

More Related Content

What's hot

Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum
 
Mule compatible technologies
Mule compatible technologiesMule compatible technologies
Mule compatible technologieshimajareddys
 
WebLogic Administration course outline
WebLogic Administration course outlineWebLogic Administration course outline
WebLogic Administration course outlineVybhava Technologies
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgradeDevelopers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrademCloud
 
Introduction to the Globus PaaS (GlobusWorld Tour - STFC)
Introduction to the Globus PaaS (GlobusWorld Tour - STFC)Introduction to the Globus PaaS (GlobusWorld Tour - STFC)
Introduction to the Globus PaaS (GlobusWorld Tour - STFC)Globus
 
Introduction to Role Based Administration in WildFly 8
Introduction to Role Based Administration in WildFly 8Introduction to Role Based Administration in WildFly 8
Introduction to Role Based Administration in WildFly 8Dimitris Andreadis
 
Stored Procedure With In Out Parameters in Mule 3.6
 Stored Procedure With In Out Parameters in Mule 3.6 Stored Procedure With In Out Parameters in Mule 3.6
Stored Procedure With In Out Parameters in Mule 3.6Sashidhar Rao GDS
 
An introduction into Oracle VM V3.x
An introduction into Oracle VM V3.xAn introduction into Oracle VM V3.x
An introduction into Oracle VM V3.xMarco Gralike
 
Introduction to Wildfly 8 - Marchioni
Introduction to Wildfly 8 -  MarchioniIntroduction to Wildfly 8 -  Marchioni
Introduction to Wildfly 8 - MarchioniCodemotion
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadmCloud
 
Scala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macrosScala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macrosebiznext
 
MuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of LoopingMuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of Loopingakashdprajapati
 
Mule system properties
Mule system propertiesMule system properties
Mule system propertiesGandham38
 

What's hot (20)

Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORM
 
Mule technologies
Mule technologiesMule technologies
Mule technologies
 
Mule compatible technologies
Mule compatible technologiesMule compatible technologies
Mule compatible technologies
 
WebLogic Administration course outline
WebLogic Administration course outlineWebLogic Administration course outline
WebLogic Administration course outline
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgradeDevelopers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
Developers’ mDay 2019. - Bogdan Kecman, Oracle – MySQL 8.0 – why upgrade
 
Introduction to the Globus PaaS (GlobusWorld Tour - STFC)
Introduction to the Globus PaaS (GlobusWorld Tour - STFC)Introduction to the Globus PaaS (GlobusWorld Tour - STFC)
Introduction to the Globus PaaS (GlobusWorld Tour - STFC)
 
Introduction to Role Based Administration in WildFly 8
Introduction to Role Based Administration in WildFly 8Introduction to Role Based Administration in WildFly 8
Introduction to Role Based Administration in WildFly 8
 
Stored Procedure With In Out Parameters in Mule 3.6
 Stored Procedure With In Out Parameters in Mule 3.6 Stored Procedure With In Out Parameters in Mule 3.6
Stored Procedure With In Out Parameters in Mule 3.6
 
Mule overview-ppt
Mule overview-pptMule overview-ppt
Mule overview-ppt
 
Asp.Net MVC3 - Basics
Asp.Net MVC3 - BasicsAsp.Net MVC3 - Basics
Asp.Net MVC3 - Basics
 
An introduction into Oracle VM V3.x
An introduction into Oracle VM V3.xAn introduction into Oracle VM V3.x
An introduction into Oracle VM V3.x
 
Introduction to Wildfly 8 - Marchioni
Introduction to Wildfly 8 -  MarchioniIntroduction to Wildfly 8 -  Marchioni
Introduction to Wildfly 8 - Marchioni
 
Enabling Security For ActiveMQ JMX Access
Enabling Security For ActiveMQ JMX AccessEnabling Security For ActiveMQ JMX Access
Enabling Security For ActiveMQ JMX Access
 
PostgreSQL News
PostgreSQL NewsPostgreSQL News
PostgreSQL News
 
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sadDevelopers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
Developers’ mDay 2021: Bogdan Kecman, Oracle – MySQL nekad i sad
 
Scala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macrosScala io2013 : Our journey from UML/MDD to Scala macros
Scala io2013 : Our journey from UML/MDD to Scala macros
 
MuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of LoopingMuleSoft ESB Filtering data instead of Looping
MuleSoft ESB Filtering data instead of Looping
 
Mule Requester Usage Demo
Mule Requester Usage DemoMule Requester Usage Demo
Mule Requester Usage Demo
 
Mule system properties
Mule system propertiesMule system properties
Mule system properties
 

Similar to Terraform 0.13: Rise of the modules

Terraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesTerraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesMarko Bevc
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
NonStop SQL/MX DBS Explained
NonStop SQL/MX DBS ExplainedNonStop SQL/MX DBS Explained
NonStop SQL/MX DBS ExplainedFrans Jongma
 
Introduction To Apache Mesos
Introduction To Apache MesosIntroduction To Apache Mesos
Introduction To Apache MesosJoe Stein
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Airflow presentation
Airflow presentationAirflow presentation
Airflow presentationIlias Okacha
 
Flying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS LambdaFlying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS LambdaSerkan Özal
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassPaul Withers
 
airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxVIJAYAPRABAP
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...Frank Munz
 
Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly - Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly - Giulio Vian
 
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellCCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellwalk2talk srl
 
airflow web UI and CLI.pptx
airflow web UI and CLI.pptxairflow web UI and CLI.pptx
airflow web UI and CLI.pptxVIJAYAPRABAP
 
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Alex Maclinovsky
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)zznate
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Uri Cohen
 
From Legacy Database to Domain Layer Using a New Cincom VisualWorks Tool
From Legacy Database to Domain Layer Using a New Cincom VisualWorks ToolFrom Legacy Database to Domain Layer Using a New Cincom VisualWorks Tool
From Legacy Database to Domain Layer Using a New Cincom VisualWorks ToolESUG
 

Similar to Terraform 0.13: Rise of the modules (20)

Terraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modulesTerraform 0.13: Rise of the modules
Terraform 0.13: Rise of the modules
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
NonStop SQL/MX DBS Explained
NonStop SQL/MX DBS ExplainedNonStop SQL/MX DBS Explained
NonStop SQL/MX DBS Explained
 
Introduction To Apache Mesos
Introduction To Apache MesosIntroduction To Apache Mesos
Introduction To Apache Mesos
 
Oracle OpenWorld 2014 Review Part Four - PaaS Middleware
Oracle OpenWorld 2014 Review Part Four - PaaS MiddlewareOracle OpenWorld 2014 Review Part Four - PaaS Middleware
Oracle OpenWorld 2014 Review Part Four - PaaS Middleware
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Kamailio - Secure Communication
Kamailio - Secure CommunicationKamailio - Secure Communication
Kamailio - Secure Communication
 
Airflow presentation
Airflow presentationAirflow presentation
Airflow presentation
 
Flying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS LambdaFlying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS Lambda
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptx
 
TechBeats #2
TechBeats #2TechBeats #2
TechBeats #2
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
 
Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly - Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly -
 
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellCCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShell
 
airflow web UI and CLI.pptx
airflow web UI and CLI.pptxairflow web UI and CLI.pptx
airflow web UI and CLI.pptx
 
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
From Legacy Database to Domain Layer Using a New Cincom VisualWorks Tool
From Legacy Database to Domain Layer Using a New Cincom VisualWorks ToolFrom Legacy Database to Domain Layer Using a New Cincom VisualWorks Tool
From Legacy Database to Domain Layer Using a New Cincom VisualWorks Tool
 

More from Marko Bevc

Using HCP Waypoint
Using HCP WaypointUsing HCP Waypoint
Using HCP WaypointMarko Bevc
 
Efficient Kubernetes scaling using Karpenter
Efficient Kubernetes scaling using KarpenterEfficient Kubernetes scaling using Karpenter
Efficient Kubernetes scaling using KarpenterMarko Bevc
 
Nodeless scaling with Karpenter
Nodeless scaling with KarpenterNodeless scaling with Karpenter
Nodeless scaling with KarpenterMarko Bevc
 
Seamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodesSeamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodesMarko Bevc
 
How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?Marko Bevc
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Marko Bevc
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Marko Bevc
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Marko Bevc
 
Commodified IaC using Terraform Cloud
Commodified IaC using Terraform CloudCommodified IaC using Terraform Cloud
Commodified IaC using Terraform CloudMarko Bevc
 

More from Marko Bevc (9)

Using HCP Waypoint
Using HCP WaypointUsing HCP Waypoint
Using HCP Waypoint
 
Efficient Kubernetes scaling using Karpenter
Efficient Kubernetes scaling using KarpenterEfficient Kubernetes scaling using Karpenter
Efficient Kubernetes scaling using Karpenter
 
Nodeless scaling with Karpenter
Nodeless scaling with KarpenterNodeless scaling with Karpenter
Nodeless scaling with Karpenter
 
Seamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodesSeamless scaling of Kubernetes nodes
Seamless scaling of Kubernetes nodes
 
How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?How secure are your Terraform sensitive values?
How secure are your Terraform sensitive values?
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
Commodified IaC using Terraform Cloud
Commodified IaC using Terraform CloudCommodified IaC using Terraform Cloud
Commodified IaC using Terraform Cloud
 

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Terraform 0.13: Rise of the modules

  • 1.
  • 2. TERRAFORM 0.13: RISE OF THE MODULES_ Marko Bevc
  • 3. BUILDING BLOCKS_ “Abstraction of common blocks of configuration into a reusable infrastructure elements.” — @sheriffjackson, 2018 blog DRY code – Don’t Repeat Yourself Everything is a module!
  • 4. ABOUT ME_ ● Senior IT Consultant at The Scale Factory (DevOps consultancy, AWS advanced consulting partner and K8s service provider) ● IT system engineering and design background with extensive Linux and virtualization experience ● Certifications and competencies: AWS, CKA, RHEL, Hashi stack ● Open source contributor and supporter ● Fan of automation/simplifying things, hiking, cycling and travelling
  • 5. TOPICS COVERED_ ● Terraform time line ● Module improvements ● Provider ecosystem ● Other enhancements and breaking changes ● How to get started and a demo ● Conclusions and path forward
  • 6. TERRAFORM TIME LINE_ • Pre-v0.10 era (provisioners, state ENV, remote state and locking) • Period v0.10 – v0.11 (workspaces, core/provider split, TF registry (private), module providers, streamlined APPLY) • Big changes with v0.12 (HCL2: 1st class expressions, gen.types, iterations/dyn.blocks, structural plans and better error messages) • Module and provider improvements in v0.13 HISTORY 2014 (initial v0.1.0) 2020 (v0.13) v0.14..1.0*2017 (v0.9-0.11) 2019 (v0.12)
  • 7. MODULE EXPANSION_ ● Improved module usability and functionality ● Create multiple instances of a module from a single module block: – count (tuple/list) – for_each (map) ● Simplified configuration logic and better automation ● Can create some indirect module-level dependencies ● Cannot use provider blocks per module instance! * (i.e. AWS regions)
  • 8. locals { resources = { prod = "prod-eks" qa = "qa-eks" dev = "dev-eks" } } module "eks" { source = "terraform-aws-modules/eks/aws" for_each = local.resources cluster_name = each.value cluster_version = "1.17" subnets = ["subnet-abcde012", "subnet-bcde012a", "subnet-fghi345a"] vpc_id = "vpc-1234556abcdef" worker_groups = [ { name = each.key instance_type = "m4.large" asg_max_size = 3 } ] } eks-clusters.tf
  • 9. MODULE DEPENDENCIES_ • Dependencies types: – implicit – explicit • Previously module instances were NOT nodes in dependency graph (just separate namespaces, dependencies via I/O values) • depends_on meta-argument ensures order of module resource changes – create after any dependent resource changes have been applied • Far more coarse declaration of dependency than encouraged – last resort! (*auto deps: easier to maintain and maximise concurrency)
  • 10. resource "aws_iam_policy_attachment" "example" { name = "example" roles = [aws_iam_role.example.name] policy_arn = aws_iam_policy.example.arn } module "uses-role" { # ... depends_on = [aws_iam_policy_attachment.example] }
  • 11. PROVIDER ECOSYSTEM_ • Improvements to Terraform Provider Registry • Automatic install of 3rd party providers • Provider source block with namespace separation, defaults to HashiCorp’s providers: [registry.terraform.io/][hashicorp/]type • One provider per module, but nesting not recommended! • Simplifying the installation of community providers: – Official HashiCorp supported providers – Partner-supported providers (needs required_providers now) – Locally installed providers (3rd party provider plugins): ./plugins/example.com/myorg/customplugin/0.1/linux_amd64/
  • 12. OTHER ENHANCEMENTS_ ● Custom variable validation rules (experimental since v0.12, zero or more rules) ● Terraform Cloud streamlined authentication process (terraform login connects CLI to TF Cloud) ● Providers mirror (terraform providers mirror) ● Terraform CLI supports TLS 1.3 ● Breaking changes: – Source for non-default providers – Locking was improved and changes to the TableStore schema now require a primary key named LockID of type String – macOS builds of Terraform CLI are no longer compatible with macOS 10.10 Yosemite – Terraform CLI now requires FreeBSD 11.2 or later.
  • 13. variable "image_id" { type = string description = "The id of the machine image (AMI) to use for the server." validation { # regex(...) fails if it cannot find a match condition = can(regex("^ami-", var.image_id)) error_message = "The image_id value must be a valid AMI id, starting with "ami-"." } } # NOT needed anymore terraform { experiments = [variable_validation] } Variable custom validation rules
  • 14. HOW TO GET STARTED_ ● Get binary from: releases.hashicorp.com ● Ensure no pending configuration changes ● Versioning or backup of code ● Data resource reads can no longer be disabled - deps ● Destroy-time provisioners cannot refer to other resources – deprecated ● New hierarchical namespace - explicit source for any not HashiCorp-maintained providers ● New directory structure for manually-installed providers ● terraform 0.13upgrade (gradual one release jumps) ● Follow CHANGELOG for more details
  • 16. CONCLUSIONS_ & TAKEAWAYS ● Module improvements: expansion (count, for_each) and dependencies ● Provider source and hierarchical namespace – wider ecosystem and required source, terraform mirror to avoid re-download ● Custom validation rules for input variables ● Streamlined Terraform Cloud auth CLI process ● Improved state locking and schema changes ● v0.14 (path to v1.0): possible features(CLI/Cloud parity, sensitive values, import, module testing)
  • 17. ● Resources: – https://www.scalefactory.com/blog/2020/06/25/what-we-are-looking-forward-to-in-terraform- 0.13/ – https://www.hashicorp.com/blog/announcing-the-terraform-0-13-beta/ – https://www.hashicorp.com/blog/custom-variable-validation-in-terraform-0-13/ – https://www.terraform.io/docs/configuration/syntax.html – https://www.hashicorp.com/blog/hashicorp-terraform-modules-as-building-blocks-for/ – https://www.hashicorp.com/resources/the-path-to-terraform-1-0/ – https://www.hashicorp.com/blog/announcing-terraform-0-12/ – https://en.wikipedia.org/wiki/Don%27t_repeat_yourself FURTHER READING_