sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.96k stars 579 forks source link

Nexus terraform proxy #481

Open realRunlo opened 1 month ago

realRunlo commented 1 month ago

Hi,

I have configured a raw repository in Nexus as a Terraform provider mirror, and it works well. However, this solution requires me to implement an automation to manage the process of uploading providers to the repository, which I would like to avoid.

To address this, I set up a raw proxy in Nexus to serve as a proxy for https://registry.terraform.io/. The problem arises when I run the following command:

HTTPS_PROXY=https://nexus-instance/repositories/tf-proxy terraform init

I receive the error: malformed HTTP response. This is expected since the proxy is not configured for this specific use case.

For example, when terraform init is executed, it starts by requesting https://registry.terraform.io/.well-known/terraform.json. If I run:

curl https://nexus-instance/.well-known/terraform.json

It works correctly, and the response gets cached.

The ideal solution would be to have a dedicated "Terraform proxy" in Nexus and/or an implementation of a dynamic terraform provider mirror. Finally, the ability to perform further configurations on the raw proxy is appreciated.

Nexus Version: OSS 3.72.0 on ECS.

Best regards, Great job, by the way!

gracecllee commented 1 month ago

Hi @realRunlo , thanks for submitting this, and really appreciate the pat on the back! We love that our community is actively using our product to its full potential. As for Terraform format support, we'd love to learn more about your usage and what would be helpful. Would you be interested in talking to our product team to provide feedback? Thanks!

realRunlo commented 1 month ago

I'm open to talk to your product team, thanks.

dmpe commented 1 month ago

Well, isn't that the same as in #415 #120 ? JFrog has it https://jfrog.com/help/r/jfrog-artifactory-documentation/configure-terraform-provider-registry-with-artifactory-using-terraform-client

realRunlo commented 1 month ago

Yes jfrog has it but i was looking for the same feature in nexus, any plans to implement this in the future?

dmpe commented 1 month ago

No idea, my reply was to @gracecllee :) ... Nexus should finally make it work. There is demand and there is competitor disadvantage of not having.

BenjaminSchweizer commented 1 month ago

terraform provider support would be awesome