设为首页 加入收藏

TOP

《Terraform 101 从入门到实践》 第二章 Providers插件管理(二)
2023-07-26 08:16:49 】 浏览:67
Tags:Terraform 101 从入门 Providers 管理
1.0 to meet constraints 2.1.0 - Downloading package for darwin_amd64... - Package authenticated: signed by HashiCorp - Mirroring hashicorp/random... - Selected v3.1.0 to meet constraints 3.1.0 - Downloading package for darwin_amd64... - Package authenticated: signed by HashiCorp

查看一下目录结构,Terraform会打包好插件为zip文件:

$ tree -a /Users/larry/Software/terraform/plugins
/Users/larry/Software/terraform/plugins-localdisk
└── registry.terraform.io
    └── hashicorp
        ├── local
        │   ├── 2.1.0.json
        │   ├── index.json
        │   └── terraform-provider-local_2.1.0_darwin_amd64.zip
        └── random
            ├── 3.1.0.json
            ├── index.json
            └── terraform-provider-random_3.1.0_darwin_amd64.zip

下次我们可以指定插件目录实现复用:

$ terraform init -plugin-dir=/Users/larry/Software/terraform/plugins

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/random from the dependency lock file
- Reusing previous version of hashicorp/local from the dependency lock file
- Using previously-installed hashicorp/random v3.1.0
- Using previously-installed hashicorp/local v2.1.0

看日志可以看到,Terraform不再下载,而是重用插件。

执行完命令init后,再查看terraform version,则会显示插件的版本:

$ terraform version
Terraform v1.0.11
on darwin_amd64
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Terraform对于这种插件目录重用的支持,不只是zip包,二进制也是支持的,但对应的目录结果有点不一样。这里不展开介绍了。

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Redis的十六种应用场景 下一篇读Java实战(第二版)笔记06_新的..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目