Hi, I am new to terraform.
we are using tencent private cloud, and our working environment have no internet access.
my setup:
environment variables:
TF_CLI_CONFIG_FILE=/home/gitlab-runner/tools/terraform/.terraformrc
TF_PLUGIN_CACHE_DIR=/home/gitlab-runner/tools/terraform/providers
/home/gitlab-runner/tools/terraform/.terraformrc:
provider_installation {
filesystem_mirror {
path = "/home/gitlab-runner/tools/terraform/providers"
include = ["registry.terraform.io/*/*"]
}
}
and the provider cache folder:
[gitlab-runner@VM_160_238_centos test]$ ls -l /home/gitlab-runner/tools/terraform/providers
total 276812
-rw-r--r-- 1 gitlab-runner gitlab-runner 415638 Aug 30 22:20 CHANGELOG.md
-rw-r--r-- 1 gitlab-runner gitlab-runner 16725 Aug 30 22:20 LICENSE
-rw-r--r-- 1 gitlab-runner gitlab-runner 5269 Aug 30 22:20 README.md
-rw-rw-r-- 1 gitlab-runner gitlab-runner 46304993 Sep 4 16:34 terraform-provider-tencentcloud_1.81.119_linux_amd64.zip
-rwxr-xr-x 1 gitlab-runner gitlab-runner 236703744 Aug 30 21:58 terraform-provider-tencentcloud_v1.81.119
testing files:
provider.tf
terraform {
required_providers {
tencentcloud = {
source = "tencentcloudstack/tencentcloud"
version = "1.81.119"
}
}
}
provider "tencentcloud" {
region = "ap-guangzhou"
secret_id = "***"
secret_key = "***"
}
main.tf:
resource "tencentcloud_cos_bucket" "test-bucket" {
bucket = "test-bucket"
acl = "private"
}
when terraform init
:
Initializing provider plugins...
- Finding tencentcloudstack/tencentcloud versions matching "1.81.119"...
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider tencentcloudstack/tencentcloud: provider registry.terraform.io/tencentcloudstack/tencentcloud was not found in any of the search locations
│
│ - /home/gitlab-runner/tools/terraform/providers
what’s wrong with my code ?