官术网_书友最值得收藏!

  • Learning DevOps
  • Mikael Krief
  • 116字
  • 2021-06-24 12:32:06

Better visibility with the separation of files

When executing Terraform code, all files in the execution directory that have the .tf extension are automatically executed; in our example, we have provider.tf and main.tf. It is good to separate the code into several files in order to improve the readability of the code and its evolution.

Using our example script, we can do better and separate it with the following:

  • Rg.tf, which contains the code for the resource group
  • Network.tf, which contains the code for the VNet and subnet
  • Compute.tf, which contains the code for the network interface, public IP, storage, and virtual machine
主站蜘蛛池模板: 迭部县| 江达县| 青州市| 建德市| 如皋市| 长葛市| 呼伦贝尔市| 江陵县| 莲花县| 晋城| 中超| 古蔺县| 翼城县| 大同县| 塔城市| 重庆市| 阳东县| 洞头县| 宜宾县| 元谋县| 河曲县| 桑日县| 隆尧县| 石首市| 公安县| 连州市| 阳春市| 怀集县| 河池市| 南雄市| 弥勒县| 林西县| 新绛县| 宿州市| 襄樊市| 当阳市| 西宁市| 江孜县| 万源市| 上蔡县| 武乡县|