sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

Standardize on a single version of terraform #23591

Open sqs opened 3 years ago

sqs commented 3 years ago

The https://github.com/sourcegraph/infrastructure repo uses 2 different terraform versions for cloud (0.14.11) vs dns (0.13.7). I also see we're thinking of upgrading managed to 1.x (https://github.com/sourcegraph/sourcegraph/issues/22905). It would be nice to have a single version so we don't need to download multiple. (It wasn't super hard, but would be nice. :)

github-actions[bot] commented 3 years ago

Heads up @davejrt @ggilmore @daxmc99 @dan-mckean - the "team/distribution" label was applied to this issue.

github-actions[bot] commented 3 years ago

Heads up @davejrt @ggilmore @dan-mckean @caugustus-sourcegraph @stephanx - the "team/delivery" label was applied to this issue.

github-actions[bot] commented 3 years ago

Heads up @daxmc99 @bcreager - the "team/devops" label was applied to this issue.

danieldides commented 2 years ago

Current terraform versions:

infrastructure % find . -name .tool-versions | xargs rg terraform

./dogfood/.tool-versions
1:terraform 0.13.5

./internal-tools/.tool-versions
1:terraform 1.0.8

./gcr/.tool-versions
1:terraform 0.13.7

./dns/.tool-versions
1:terraform 1.0.8

./buildkite/kubernetes/.tool-versions
1:terraform 1.0.8

./buildkite/.tool-versions
1:terraform 1.0.7

./modules/.tool-versions
1:terraform 0.13.7

./modules/project/.tool-versions
1:terraform 1.0.8

./executors/cloud/.tool-versions
1:terraform 1.1.5

./cloud/.tool-versions
1:terraform 1.0.8

./gcp/projects/.tool-versions
1:terraform 1.0.8

./executors/dogfood/.tool-versions
1:terraform 1.1.5

./security/.tool-versions
1:terraform 0.14.11

./telligent/.tool-versions
1:terraform 1.0.8

./.tool-versions
3:terraform 0.12.26

./resource-report/.tool-versions
1:terraform 1.0.11

./site24x7/.tool-versions
1:terraform 0.12.26

./github-enterprise/.tool-versions
1:terraform 1.0.11

./pentest/.tool-versions
1:terraform 0.13.5

./terraform-state/.tool-versions
1:terraform 0.13.7
daxmc99 commented 2 years ago

Steps to close: Upgrade all terraform to atleast ~> 1.0.x Add a CI check to hold new projects to this.

danieldides commented 2 years ago

It looks like managed instances have standardized on 1.1.4 so we should probably try and sync infrastructure/ to match that and create a sourcegraph-wide standardized terraform verison.

https://sourcegraph.com/search?q=context:%40sourcegraph/all+file:.tool-versions+terraform&patternType=literal

Would be nice too if we did the same enforcements to keep all parts of the repos using the same provider versions.

daxmc99 commented 2 years ago

We might also want to standardize on a terraform version management tool if we decide to not set a default version. Maybe tfenv

Part of this could also be to ensure that the VS Code extension correctly works with the solution we choose as well. I believe asdf interferes with this today.