huawei-cloud-terraform-installer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Huawei 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:
    • releases.hashicorp.com
      (Terraform binary)
    • mirrors.huaweicloud.com
      (HuaweiCloud Provider)
  • Python 3.6+(安装脚本所需)
  • 可访问以下网络地址:
    • releases.hashicorp.com
      (Terraform二进制文件源)
    • mirrors.huaweicloud.com
      (华为云Provider源)

Platform Support

平台支持

PlatformMethodNotes
LinuxBinaryDirect binary download
WindowsBinaryDirect 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
    filesystem_mirror
    (local file mirror)
  • Download zip from Huawei Cloud mirror, extract to local
  • Configure
    terraform.rc
    to point to local directory
Unsupported methods:
  • direct
    (Registry → GitHub): GitHub timeout
  • network_mirror
    : Huawei Cloud mirror directory structure incompatible
Provider安装方式:
  • 使用
    filesystem_mirror
    (本地文件镜像)
  • 从华为云镜像下载压缩包,解压到本地
  • 配置
    terraform.rc
    指向本地目录
不支持的方式:
  • direct
    (注册表→GitHub):GitHub超时
  • network_mirror
    :华为云镜像目录结构不兼容

Quick Start

快速开始

Basic Installation

基础安装

bash
undefined
bash
undefined

Auto-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
undefined
python scripts/install_terraform.py --test
undefined

Specify Version

指定版本

bash
undefined
bash
undefined

Install specific version

安装特定版本

python scripts/install_terraform.py --version 1.15.4
undefined
python scripts/install_terraform.py --version 1.15.4
undefined

Other Operations

其他操作

bash
undefined
bash
undefined

Check status only

仅检查状态

python scripts/install_terraform.py --check
python scripts/install_terraform.py --check

Uninstall

卸载

python scripts/install_terraform.py --uninstall
undefined
python scripts/install_terraform.py --uninstall
undefined

Mirror Strategy

镜像策略

ResourceSourceNotes
Terraform binaryHashiCorp ReleasesOfficial source
ProviderHuawei 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 privileges
Solution:
  • 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
解决方案: 默认使用华为云镜像,通常不会遇到此问题