Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancies in the AWS Provider Version in README Documentation when utilizing terraform-docs between ARM and AMD Architectures #704

Open
katrinajaneczko opened this issue Sep 11, 2023 · 3 comments
Labels

Comments

@katrinajaneczko
Copy link

Describe the bug

When running terraform-docs . on a system with an Apple M1 or M2 (ARM) chip, in the generated documentation, the provider version differs from systems with older chips (amd64). Specifically, the version for the AWS provider is not consistent.

This is causing an issue when collaborators with different architecture are working on the same Terraform project. Say user 1 has ARM architecture and user 2 has AMD architecture. Then if user 1 pushes a change after running terraform-docs . and user 2 pulls the change and runs terraform-docs . --output-check, an error is thrown: Error: README.md is out of date. Vice versa if user 2 pushes and user 1 pulls and checks.

How can we reproduce it?

  1. On a system with an Apple M1 or M2 (ARM) chip, run terraform-docs .
Screenshot 2023-09-11 at 1 59 17 PM
  1. On a system with an older chip (amd64), run terraform-docs .
Screenshot 2023-09-11 at 1 56 18 PM
  1. Compare the generated documentation for the AWS provider version.

Environment information

  • On MacOS ARM Architecture:
    • Chip: Apple M2 Pro
    • terraform-docs version v0.16.0 darwin/arm64
    • go version go1.21.0 darwin/arm64
  • On MacOS AMD Architecture:
    • Chip: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    • terraform-docs version v0.16.0 darwin/amd64
    • go version go1.21.0 darwin/amd64

Additional Information

This is causing an issue when collaborators from our team with different architecture are working on the same Terraform project. There is a task in our CI/CD pipeline that runs terraform-docs . --output-check from a Docker container with the amd64 architecture. When changes were pushed from a Mac with an M1 or M2 chip, the inconsistency in the generated documentation versions causes the pipeline to fail with Error: README.md is out of date. However, on my local machine (M2 chip), it reports that the documentation is up to date.

This is the workaround I am using:
Screenshot 2023-09-11 at 10 14 53 AM

These AWS provider version on line 61 pictured above must match that on line 55. So for this module, if I have the M1 or M2 chip, I must make a manual correction before I make a commit. In the README I need to replace 5.13.1 on line 61 with >= 5.0.0. Since we have a pre-commit hook which also runs terraform-docs . --output-check, I also need to use the --no-verify flag when commiting in order to ignore pre-commit hooks, which otherwise would raise an error and not let me commit, since according to my version of terraform-docs the README is not up to date.

@grimm26
Copy link

grimm26 commented Sep 25, 2023

are you sure it is not a case of terraform init having run at a different time from the different users?

@bgshacklett
Copy link

I thought I was in the same boat, but it was an issue with .terraform.lock.hcl existing on my machine, but not being checked into Git.

@pawelpesz
Copy link

I believe explicitly setting the lockfile option to false should make this unwanted discrepancy go away 😄

https://terraform-docs.io/user-guide/configuration/settings/#lockfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants