News for hackers. Stuff that matters.
Re:A Month of Terraform by pqb on Sunday November 22, 2020 @04:52PM (#25181442)
> terraform-lsp is supposed to provide autocomplete, but it mostly doesn’t, in my experience.

I find Terraform for Jetbrains IDEs to work hundred times better than the VSCode one. I really can recommend it, does magic to autocompletion, peek definition, snippets insertion and linting TF/HCL files.

Author of this blogpost have not mentioned Terragrunt [0], while I think it is worth mentioning. It is nice tool, especially if you work on bigger projects having multiple modules and per-environment variables.

Also, a tip from a person, who works in team using terraform - use brew/apt repositories to keep the binaries up-to-date or at least on the same version as your team mates. I remember at least few situations, when patch update of a terraform binary was crucial to make some issues disappear.

[0]: https://terragrunt.gruntwork.io/

Psst... I am also using Terraform to bootstrap Pop_OS! with my dotfiles and it is surprisingly nice enough to mimic declarative and atomic NixOS configuration :)

Re:A Month of Terraform by dastx on Monday November 23, 2020 @05:04AM (#25185179)
> Also, a tip from a person, who works in team using terraform - use brew/apt repositories to keep the binaries up-to-date or at least on the same version as your team mates.

Use tfenv instead. That way you can have a .terraform_version file in your repo and tfenv will refuse to run without having the right version.

Re:A Month of Terraform by joobus on Sunday November 22, 2020 @05:43PM (#25181815)
But he did mention Terragrunt:

> Terraform: Up & Running is excellent, and Terragrunt makes it even easier. Huge thanks to their team for providing the duct tape we need.

Re:A Month of Terraform by pqb on Sunday November 22, 2020 @05:45PM (#25181837)
Ouch, what a shame on my side. Sorry, I must have missed it. Thanks for pointing it out.
Re:A Month of Terraform by leetrout on Sunday November 22, 2020 @10:35PM (#25183348)
asdf has a terraform plugin and solves the problem of folks being on the wrong versions quite nicely.

https://asdf-vm.com/#/

Re:A Month of Terraform by ciceryadam on Sunday November 22, 2020 @05:32PM (#25181746)
For distributed work on environments you ideally you want to have something like a gitlab pipeline that does the tf plan for you automatically, with a manual approve button of sorts. That way you a consistent tf version defined in .gitlab-ci.yml, plus due to centralized logging it's easier to find when and what changed in the envs.
Re:A Month of Terraform by pqb on Sunday November 22, 2020 @05:46PM (#25181847)
I assume you are talking about a similar tool to the Atlantis [0] / Terraform SaaS offering [1].

[0]: https://www.runatlantis.io/

[1}: https://www.hashicorp.com/blog/terraform-collaboration-for-e...

Re:A Month of Terraform by ciceryadam on Sunday November 22, 2020 @06:25PM (#25182058)
Yeah, exactly the same functionality, but just implemented with a different toolset: https://docs.gitlab.com/ee/user/infrastructure/
Re:A Month of Terraform by dastx on Monday November 23, 2020 @05:07AM (#25185194)
This is super interesting. I never realised gitlab has builtin terraform support. Is there a demo or screenshot of what it all looks like?
Re:A Month of Terraform by voffk on Monday November 23, 2020 @05:36AM (#25185371)
Re:A Month of Terraform by dastx on Monday November 23, 2020 @09:13AM (#25186914)
Thank you! They did a great job!
Re:A Month of Terraform by vbsteven on Monday November 23, 2020 @05:04AM (#25185181)
I implemented this on top of bitbucket pipelines with a 'manual' pipeline step. The pipeline runs the plan step automatically and outputs it on the console. Then pipelines shows a button next to it called 'deploy' which is only clicked after manually verifying the plan results.
Re:A Month of Terraform by cies on Monday November 23, 2020 @04:59AM (#25185162)
> or at least on the same version as your team mates. I remember at least few situations, when patch update of a terraform binary was crucial to make some issues disappear.

I find it a little evil that Terraform is used so widely in production yet still hangs on to the "0.x.y" semantic version meaning: we break API when ever we want. It should be more stable for a tool so widely used. C'mon Hashicorp, be fair to us and release a 1.0!