Terraform使用
Terraform
默认下载插件目录
当前目录下.terraform
:
terraform配置文件
bash
#vim /root/terraformrc
terraformrc
文件是 Terraform 的配置文件,通常命名为 .terraformrc
或 terraform.rc
,它位于用户的主目录下。在 Windows 系统上,该文件被命名为 terraform.rc
并且位于用户的“应用数据”文件夹中。这个文件用于配置一些 Terraform 的全局设置,如插件的安装位置和访问 Terraform Registry 的凭证。
以下是 .terraformrc
中可以设置的一些常用参数:
plugin_cache_dir- 指定插件缓存的目录位置,用于加速插件下载和安装。
yamlplugin_cache_dir ="$HOME/.terraform.d/plugin-cache"
provider_installation- 用于配置自定义的提供程序安装选项,例如直接从文件系统中安装,或者指定镜像地址。
yamlprovider_installation {filesystem_mirror {path ="/mnt/terraform-plugins"include =["registry.terraform.io*"]}direct {exclude =["registry.terraform.io/hashicorp