clusterinthecloud / terraform

Terraform config for Cluster in the Cloud
https://cluster-in-the-cloud.readthedocs.io
MIT License
20 stars 23 forks source link

`terraform init` step fails on macOS with arm64 binary #78

Open jcwomack opened 6 months ago

jcwomack commented 6 months ago

I am using the openstack development branch, but I suspect that this issue is general across other cloud providers.

% terraform -chdir=openstack init                                                                                                                                                                                

Initializing the backend...                                                                                           

Initializing provider plugins...                                                                                                                                                                                                             
- Finding terraform-provider-openstack/openstack versions matching "~> 1.48"...                                                                                                                                                              
- Finding latest version of hashicorp/random...                                                                                                                                                                                              
- Finding latest version of hashicorp/template...                                                                                                                                                                                            
- Installing terraform-provider-openstack/openstack v1.54.1...                                                        
- Installed terraform-provider-openstack/openstack v1.54.1 (self-signed, key ID 4F80527A391BEFD2)                     
- Installing hashicorp/random v3.6.0...                    
- Installed hashicorp/random v3.6.0 (signed by HashiCorp)  

Partner and community providers are signed by their developers.                                                       
If you'd like to know more about provider signing, you can read about it here:                                        
https://www.terraform.io/docs/cli/plugins/signing.html     
╷                                                          
│ Error: Incompatible provider version                     
│                                                          
│ Provider registry.terraform.io/hashicorp/template v2.2.0 does not have a package available for your current         
│ platform, darwin_arm64.                                  
│                                                          
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms.   
│ Other versions of this provider may have different platforms supported.                                             
╵                                                          

A quick web search suggests that this might be due to the use of the template_file data source, which is part of the deprecated template provider.

It seems the template provider was archived prior to arm64 macOS releases of terraform and has not been updated to add support. See for example: https://discuss.hashicorp.com/t/template-v2-2-0-does-not-have-a-package-available-mac-m1/35099

I will try the workaround of using the darwin_amd64 binary, but thought it worth flagging since it seems that this provider should be replaced with alternative non-deprecated functionality, as described here: https://registry.terraform.io/providers/hashicorp/template/latest/docs#deprecation

Terraform version information:

% terraform version
Terraform v1.7.5
on darwin_arm64