Problem
When publishing a new module version in Terraform Enterprise (version 202106-1 or later), the registration fails if the module uses configuration_aliases with quoted aliases.
Cause
This issue is caused by a change in the module verification code that is invoked during the registration process, starting with Terraform Enterprise version 202106-1.
When inspecting the logs from docker logs tfe-registry-worker or docker logs ptfe_registry_worker for older versions, you may see errors similar to the following output.
[ERROR] Non-retryable job error: job_id=5d8beedd9f54537ea5473f56 job_name=push_ingress_version
error=
| {*errors.errorString error loading the module: Invalid expression: A single static variable reference is required: only attribute access and indexing with constant keys. No calculations, function calls, template expressions, etc are allowed here. (and 2 other messages) (in versions.tf on line 5) github.com/hashicorp/go-hclog.StacktraceSolution
You need to search the module code for configuration_aliases and remove any quotation marks from the expression.
For example, update the configuration from this format.
configuration_aliases = [ "mycloud.alternate" ]
It should be changed to this format.
configuration_aliases = [ mycloud.alternate ]
Additional Information
- For more details on provider configurations, please see the Provider Configuration documentation.