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

chore: rewrite Terraform backend shell script to external Bicep template #607

Merged
merged 15 commits into from
Dec 5, 2024

Conversation

hknutsen
Copy link
Member

@hknutsen hknutsen commented Dec 4, 2024

Rewrite Terraform backend shell script to a Bicep template, and store that template in a separate repository with its own versioning.

Pros:

  • A Bicep template should be easier to maintain than a shell script, due to its declarative nature.
  • A Bicep template can be deployed without cloning the repo locally.
  • Should be able to pass "complex" configuration, such as IP rules and principals IDs, using parameter files that can be checked into Git.

Cons:

  • Bicep template does not support taking in a raw Terraform backend configuration file as an input.

@hknutsen hknutsen self-assigned this Dec 4, 2024
@hknutsen hknutsen marked this pull request as ready for review December 4, 2024 10:19
@hknutsen hknutsen requested a review from a team as a code owner December 4, 2024 10:19
@kov117
Copy link
Contributor

kov117 commented Dec 4, 2024

Yeah based on what i saw, this looks nice 👍🏼 i liked the new read me file, and its a bit more understandable for my part. Plus if this is easier to maintain compared to shell script then i am all for it.

@sefornes
Copy link
Contributor

sefornes commented Dec 4, 2024

As a long-time Windows user from when Microsoft an the *NIX crowd were mortal enemies, I think Bash scripts on Windows is an abomination (much like Powershell on Linux), so I think this is nice.

@hknutsen
Copy link
Member Author

hknutsen commented Dec 4, 2024

Added a con in the PR description.

@sefornes
Copy link
Contributor

sefornes commented Dec 4, 2024

That's pretty trivial, IMO. I think the pros far outweighs it.

sefornes
sefornes previously approved these changes Dec 5, 2024
@hknutsen
Copy link
Member Author

hknutsen commented Dec 5, 2024

Experimenting with maintaining this template in a standalone repository: https://github.com/equinor/terraform-backend

Waiting with merge until ewe've decided on something there.

@hknutsen hknutsen changed the title chore: rewrite Terraform backend shell script to Bicep template chore: rewrite Terraform backend shell script to external Bicep template Dec 5, 2024
@hknutsen hknutsen requested review from sefornes and a team December 5, 2024 10:22
@hknutsen
Copy link
Member Author

hknutsen commented Dec 5, 2024

Should be ready for re-review 😊

@hknutsen hknutsen merged commit a8ca840 into main Dec 5, 2024
9 of 13 checks passed
@hknutsen hknutsen deleted the chore/create-terraform-backend-using-bicep branch December 5, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants