PacoVK / tapir

A Private Terraform Registry
https://pascal.euhus.dev/tapir/
Apache License 2.0
203 stars 15 forks source link

I would like to have more detailed examples of file structures during the upload process! #364

Closed WeiMengXS closed 10 months ago

WeiMengXS commented 10 months ago

When uploading the provider, we already know that we need to prepare the .zip file containing all the files described in the 'how to prepare release' documentation. However, when uploading the module, it seems that the documentation does not explicitly specify how the directory structure should be maintained for the upload. I tried uploading the downloaded module and encountered the following error. 1、 error:

image

My directory structure is:

image

command use: curl -XPOST -H 'x-api-key:eNsZxQ1vQsY0QqEGgWMHXsKE' --fail-with-body -F archive=@terraform-aws-iam-0.0.2.zip "https://example.com/terraform/modules/v1/fc/vpc/aws/0.0.2"

2、 error:

image

My directory structure is:

image

command use: curl -XPOST -H 'x-api-key:eNsZxQ1vQsY0QqEGgWMHXsKE' --fail-with-body -F archive=@Archiv.zip "https://example.com/terraform/modules/v1/fc/vpc/aws/0.0.2"

PacoVK commented 10 months ago

Hey, indeed Tapir was not able to handle nested modules properly. I addressed this in #365 and also added now more details for the expected module structure (althought, the recommended layout is a should) However, the .tf files should be at the root level within the .zip file :) see Before i create another release you can already check using the Docker image pacovk/tapir:main or pacovk/tapir:latest

WeiMengXS commented 10 months ago

hi,I have updated to the latest version. When I upload the module, the problem still occurs, but there is no problem uploading the provider.

What's the problem here? es seems to work. What aspects should I investigate?

image

command use: curl -XPOST -H 'x-api-key:xxxxx' --fail-with-body -F archive=@Archiv.zip "https://xxx.com/terraform/modules/v1/fc/vpc/aws/0.0.2"

Encounter problems:

image
PacoVK commented 10 months ago

While the logs indicate everything worked well, there is an issue with the report index mapping in ES. So you can either

WeiMengXS commented 10 months ago
image

I checked the index and it is normal.

image

Files I uploaded: Archiv.zip

PacoVK commented 10 months ago

Thanks, again! Fix is on the way. I'll create a release today later

WeiMengXS commented 10 months ago

When using module here, it seems to point to s3, and I chose local storage.

image image
PacoVK commented 10 months ago

I think there was a leftover from a bigger refactoring, i fixed it and it will be available in latest soon. A release will also follow soonish! Thanks again, i use Tapir with s3 hence i did not recognize this faux pas

WeiMengXS commented 10 months ago

Thank you very much, the module management problem has been solved.