[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-682026-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-682026-en":130,"doc-similar-682026":165},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","introduction-to-terraformopentofu-and-their-packaging-in-pkgsrc","Introduction to Terraform/OpenTofu and their Packaging in pkgsrc","","Infrastructure as Code (IaC) uses machine-readable configuration files to manage and provision IT infrastructure. The document explains Terraform and OpenTofu as cloud-agnostic IaC tools with declarative HCL workflows and provider/module ecosystems. It describes Terraform’s typical lifecycle—init, plan, and apply—and core concepts such as providers, resources, data sources, modules, and state. It then motivates why packaging in pkgsrc matters, outlines Terraform package setup, and proposes a migration/testing path from Terraform to OpenTofu.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/introduction-to-terraformopentofu-and-their-packaging-in-pkgsrc/682026/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/introduction-to-terraformopentofu-and-their-packaging-in-pkgsrc/682026.png","ImageObject",300,407,{"name":42,"@type":43},"Kyle","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-25","2026-11-06",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",6,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What is Infrastructure as Code (IaC) in the context of this document?","Question",{"text":63,"@type":64},"IaC manages and provisions an organization’s IT infrastructure using machine-readable configuration files, instead of physical hardware configuration or interactive tools.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What are Terraform’s core concepts mentioned here?",{"text":68,"@type":64},"Terraform uses Terraform configuration files (.tf) plus providers, resources, data sources, modules (collections of .tf files), and a state that maps real resources to configuration and metadata.",{"name":70,"@type":61,"acceptedAnswer":71},"Why is packaging Terraform/OpenTofu in pkgsrc important, and what is the document’s next step?",{"text":72,"@type":64},"The document motivates that proper packaging matters, then describes how Terraform packages are handled in pkgsrc and discusses a migration/testing path from Terraform to OpenTofu.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},682026,1793958615,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":97,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":55,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":144,"preview_page_count":97,"preview_urls":145},3985741905716,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","Introduction to Terraform/OpenTofu and their packaging in pkgsrc  \nLeonardo Taccari  \n\u003C[leot@NetBSD.org](leot@NetBSD.org)>  \nThe NetBSD Foundation  \nEuroBSDCon 2025-NetBSD Summit September 26th 2025  \nZagreb, Croatia  \nOutline  \nInfrastructure as Code (IaC), Terraform and OpenTofu  \nInfrastructure as Code (IaC)  \nTerraform  \nSimple example: private S3 bucket  \nModule example: private S3 bucket  \nOpenTofu  \nWhy packaging is important!  \nTerraform/OpenTofu in pkgsrc  \nTerraform packages in pkgsrc  \nMigration path from Terraform to OpenTofu Testing Terraform to OpenTofu migration Terraform configuration to forbid provider registries  \nPossible open questions  \nConclusions  \nReferences  \nInfrastructure as Code (IaC), Terraform and OpenTofu  \nInfrastructure as Code (IaC)  \nThe process of managing and provisioning an organization’s IT infrastructure using machine-readable configuration files, rather than employing physical hardware configuration or interactive configuration tools. 1  \n1 From NIST SP 800-172.  \nTerraform  \nTerraform 2 is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files. 3  \n2 From now on, at least for introduction, everything that we say about Terraform is valid also for OpenTofu.  \n3 From old Terraform homepage: [https://www.terraform.io/](https://www.terraform.io/) .  \nTerraform  \n▶ Infrastructure as Code (IaC) tool  \n▶ Declarative Language (HCL: HashiCorp Configuration Language)  \n▶ Cloud-agnostic  \n▶ Thousands of providers and modules available  \n▶ Encourage infrastructure changes in two steps:  \n▶ planning phase  \n▶ deployment of resources  \nTerraform: how it works?  \n@  \ný  \nÅ  \nTerraform configuration files ( .tf)  \nTerraform provider(s)  \nProvider(s) API  \nTerraform: glossary  \nprovider plugin that supplies a collection of resources and data sources for managing infrastructure with a particular vendor  \nresource represents an actual piece of infrastructure  \ndata source similar to resource but can only be used to read data module collection of .tf files kept together in a directory  \nstate map real world resources to configuration, keeping track of metadata and to improve performance in large infrastructures  \nTerraform: typical workflow  \nTerraform development workflow from Terraform in Depth by Robert Hafner.  \ninit initializes a new or existing Terraform working directory by creating initial files, loading any remote state, downloading providers and modules  \nplan generates a speculative execution plan, showing all the actions (create, updates (in place), destroy) Terraform will do  \napply creates or updates infrastructure according to Terraform configuration files  \nTerraform: flowchart of Terraform execution plan  \nFlowchart of Terraform execution plan from Terraform in Action by Scott Winkler.  \n10 / 46","cbCaiqMqmpsdE17l","https://ap.wps.com/l/cbCaiqMqmpsdE17l","pdf",461832,46,"English","# Infrastructure as Code (IaC), Terraform and OpenTofu\n## Infrastructure as Code (IaC)\n## Terraform\n## OpenTofu\n## Why packaging is important!\n## Terraform/OpenTofu in pkgsrc\n## Possible open questions\n## Conclusions\n## References","[{\"question\":\"What is Infrastructure as Code (IaC) in the context of this document?\",\"answer\":\"IaC manages and provisions an organization’s IT infrastructure using machine-readable configuration files, instead of physical hardware configuration or interactive tools.\"},{\"question\":\"What are Terraform’s core concepts mentioned here?\",\"answer\":\"Terraform uses Terraform configuration files (.tf) plus providers, resources, data sources, modules (collections of .tf files), and a state that maps real resources to configuration and metadata.\"},{\"question\":\"Why is packaging Terraform/OpenTofu in pkgsrc important, and what is the document’s next step?\",\"answer\":\"The document motivates that proper packaging matters, then describes how Terraform packages are handled in pkgsrc and discusses a migration/testing path from Terraform to OpenTofu.\"}]","Introduction to Terraform/OpenTofu and their Packaging in pkgsrc | PDF",116,[146,150,153,157,161],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/9db472fd8232d0b536f355b07fc25571.webp",983,736,{"page_no":26,"url":151,"width":152,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/c5340bfb7a51074c3fdfec9322f14ca3.webp",982,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/db66baa9b211d9c728d451dd7c49b127.webp",981,735,{"page_no":33,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/cb7b70a7a4655349837ede27468b46a3.webp",980,734,{"page_no":97,"url":162,"width":163,"height":164},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/69437c6f0e44faa639e15ecba8e5c460.webp",979,733,{"list":166,"token":11},[167,173,179,185,190,196,201,208,214,221],{"doc_id":168,"doc_title":169,"file_type":137,"home_preview_img_url":170,"slug":171,"view_count":97,"category_name":29,"create_tm":172},682024,"Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998415734/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=wvRyoQSZ6aOC%2BT4efwFQxdj7mdE%3D","hashicorp-terraform-deep-dive-with-no-fear-victor-turbinsky-texuna",1793958605,{"doc_id":174,"doc_title":175,"file_type":137,"home_preview_img_url":176,"slug":177,"view_count":105,"category_name":29,"create_tm":178},682032,"Introduction to Terraform OSS on AWS - Technical Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332318/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=Qdmc2qzhX020FBTh43qaPEKdCpA%3D","introduction-to-terraform-oss-on-aws-technical-guide",1793958631,{"doc_id":180,"doc_title":181,"file_type":137,"home_preview_img_url":182,"slug":183,"view_count":97,"category_name":29,"create_tm":184},682028,"Automating Infrastructure Provisioning Using Terraform","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332210/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=Poqs9%2BpTs3oownh5FddUTHGES3o%3D","automating-infrastructure-provisioning-using-terraform",1793958622,{"doc_id":186,"doc_title":187,"file_type":137,"home_preview_img_url":188,"slug":189,"view_count":97,"category_name":29,"create_tm":172},682023,"Terraform for Developers - Essentials of Infrastructure Automation and Provisioning","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999331896/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=e5spHjbcSRjvze5gyTUwx57i7sc%3D","terraform-for-developers-essentials-of-infrastructure-automation-and-provisioning",{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":33,"category_name":29,"create_tm":195},682027,"cours-terraform - Terraform-Infrastructure-as-Code (IaC)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332234/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=ossbFVidUFHt6zJtGB2VPhsMUUQ%3D","cours-terraform-terraform-infrastructure-as-code-iac",1793958620,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":105,"category_name":29,"create_tm":184},682029,"Cloud Automation using Terraform (IAC) How-to Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332261/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=SE033ZnRQN7dL0l1aNixlsyODbU%3D","cloud-automation-using-terraform-iac-how-to-guide",{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":206,"category_name":29,"create_tm":207},203878,"Andrej Trusevic - Cloud Engineer Kubernetes and Azure","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229882952800/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=r2DWT1DANtLB2roIxe6c30T6cVM%3D","andrej-trusevic-cloud-engineer-kubernetes-and-azure",23,1788564604,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":55,"category_name":29,"create_tm":213},682030,"Terraform for OCI Provisioning - Best Practices","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332264/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=SlJxJtjavGrHp0kgS0LTUmMBdmM%3D","terraform-for-oci-provisioning-best-practices",1793958626,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":219,"category_name":29,"create_tm":220},203912,"Kubernetes Service - Amazon Web Services (AWS)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229882955251/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=fbhbBdNz%2F%2F3BfgBXgyXK0HvBwy0%3D","kubernetes-service-amazon-web-services-aws",18,1788565003,{"doc_id":222,"doc_title":223,"file_type":137,"home_preview_img_url":224,"slug":225,"view_count":33,"category_name":29,"create_tm":213},682031,"The Terraform Book - Chapter 3 - Building an application stack with Terraform","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999332283/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110199&Signature=AAOXdEZNDdRBI7twQjNQ1cVJTVc%3D","the-terraform-book-chapter-3-building-an-application-stack-with-terraform"]