huawei-cloud-terraform-installer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei Cloud Terraform Installer
华为云Terraform安装工具
Cross-platform Terraform CLI installation with Huawei Cloud mirror by default
(avoids GitHub network issues).
默认使用华为云镜像进行跨平台Terraform CLI安装(可规避GitHub网络问题)。
Prerequisites
前置条件
- Python 3.6+ (required for installation script)
- Network access to:
- (Terraform binary)
releases.hashicorp.com - (HuaweiCloud Provider)
mirrors.huaweicloud.com
- Python 3.6+(安装脚本所需)
- 可访问以下网络地址:
- (Terraform二进制文件源)
releases.hashicorp.com - (华为云Provider源)
mirrors.huaweicloud.com
Platform Support
平台支持
| Platform | Method | Notes |
|---|---|---|
| Linux | Binary | Direct binary download |
| Windows | Binary | Direct download |
Why use binary download only?
- Simpler and more reliable across all platforms
- No dependency on package manager availability
- Consistent behavior for troubleshooting
Note: macOS is not currently supported.
| 平台 | 安装方式 | 说明 |
|---|---|---|
| Linux | 二进制文件 | 直接下载二进制文件 |
| Windows | 二进制文件 | 直接下载 |
为何仅使用二进制文件下载?
- 在所有平台上更简单、更可靠
- 不依赖包管理器的可用性
- 故障排查时行为一致
注意: 当前暂不支持macOS。
Windows Special Notes
Windows平台特殊说明
Provider installation method:
- Use (local file mirror)
filesystem_mirror - Download zip from Huawei Cloud mirror, extract to local
- Configure to point to local directory
terraform.rc
Unsupported methods:
- ❌ (Registry → GitHub): GitHub timeout
direct - ❌ : Huawei Cloud mirror directory structure incompatible
network_mirror
Provider安装方式:
- 使用(本地文件镜像)
filesystem_mirror - 从华为云镜像下载压缩包,解压到本地
- 配置指向本地目录
terraform.rc
不支持的方式:
- ❌ (注册表→GitHub):GitHub超时
direct - ❌ :华为云镜像目录结构不兼容
network_mirror
Quick Start
快速开始
Basic Installation
基础安装
bash
undefinedbash
undefinedAuto-install (default to Huawei Cloud mirror)
自动安装(默认使用华为云镜像)
python scripts/install_terraform.py
python scripts/install_terraform.py
Install + Initialize
安装并初始化
python scripts/install_terraform.py --init
python scripts/install_terraform.py --init
Install + Test
安装并测试
python scripts/install_terraform.py --test
undefinedpython scripts/install_terraform.py --test
undefinedSpecify Version
指定版本
bash
undefinedbash
undefinedInstall specific version
安装特定版本
python scripts/install_terraform.py --version 1.15.4
undefinedpython scripts/install_terraform.py --version 1.15.4
undefinedOther Operations
其他操作
bash
undefinedbash
undefinedCheck status only
仅检查状态
python scripts/install_terraform.py --check
python scripts/install_terraform.py --check
Uninstall
卸载
python scripts/install_terraform.py --uninstall
undefinedpython scripts/install_terraform.py --uninstall
undefinedMirror Strategy
镜像策略
| Resource | Source | Notes |
|---|---|---|
| Terraform binary | HashiCorp Releases | Official source |
| Provider | Huawei Cloud Mirror (default) | Avoid GitHub network issues |
Huawei Cloud Mirror:
https://mirrors.huaweicloud.com/terraform/| 资源 | 来源 | 说明 |
|---|---|---|
| Terraform二进制文件 | HashiCorp Releases | 官方源 |
| Provider | 华为云镜像(默认) | 规避GitHub网络问题 |
华为云镜像地址:
https://mirrors.huaweicloud.com/terraform/Troubleshooting
故障排查
Issue 1: Windows PATH Not Effective
问题1:Windows系统PATH未生效
Solution: Reopen terminal (PowerShell/CMD)
解决方案: 重新打开终端(PowerShell/CMD)
Issue 2: Permission Denied
问题2:权限不足
text
[ERROR] Permission denied, please run with administrator privilegesSolution:
- Windows: Right-click → Run as administrator
- Linux:
sudo python3 install_terraform.py
text
[ERROR] Permission denied, please run with administrator privileges解决方案:
- Windows:右键以管理员身份运行
- Linux:执行
sudo python3 install_terraform.py
Issue 3: Network Timeout
问题3:网络超时
Solution: Default uses Huawei Cloud mirror, should not encounter this issue
解决方案: 默认使用华为云镜像,通常不会遇到此问题