When running terraform init, the lock file or .terraform directory is not consistently created or updated.
terraform init -upgrade will download the providers generate the .terraform directory but is not generating the lock file.
terraform init says it is downloading the providers but is actually doing nothing (including not generating the lock file)
Randomly the lock file is created, but I have not discovered when that happens.
pjdhunt@pjhmbp20 gcp-iap-k8s % terraform init
Initializing the backend...
Initializing provider plugins...
- Finding latest version of hexaorg/hexa...
- Finding hashicorp/kubernetes versions matching ">= 2.12.1"...
- Finding latest version of hashicorp/google...
- Finding latest version of hashicorp/google-beta...
- Installing hashicorp/kubernetes v2.12.1...
- Installed hashicorp/kubernetes v2.12.1 (signed by HashiCorp)
- Installing hashicorp/google v4.28.0...
- Installed hashicorp/google v4.28.0 (signed by HashiCorp)
- Installing hashicorp/google-beta v4.28.0...
- Installed hashicorp/google-beta v4.28.0 (signed by HashiCorp)
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hexaorg/hexa: provider registry registry.terraform.io does not have a provider named registry.terraform.io/hexaorg/hexa
│
│ All modules should specify their required_providers so that external consumers will get the correct providers when using a module. To see which modules are currently depending on hexaorg/hexa, run the following command:
│ terraform providers
╵
pjdhunt@pjhmbp20 gcp-iap-k8s % ls
gke.tf main.tf terraform-example.tfvars terraform.tfvars vpc.tf
pjdhunt@pjhmbp20 gcp-iap-k8s % ls -a
. .. .terraform gke.tf main.tf terraform-example.tfvars terraform.tfvars vpc.tf
pjdhunt@pjhmbp20 gcp-iap-k8s % terraform -version
Terraform v1.2.5
on darwin_amd64