semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Question: How do you manage the tfstate?

Open bykof opened this issue 1 year ago • 2 comments

Question

I have a git repository, where I manage all my servers and I want to have a state shared across semaphore and team members, who could possibly make a tofu apply manually. How do you share the tfstate? Do you commit it to the git repository?

Related to

No response

bykof avatar Oct 04 '24 05:10 bykof

So I just saw this, is this the preferred way to do it: https://developer.hashicorp.com/terraform/language/state/remote

bykof avatar Oct 04 '24 05:10 bykof

Hi @bykof I already started implementing backend for Terraform. It will be available soon.

fiftin avatar Oct 05 '24 10:10 fiftin

I was considering Semaphore UI, just to check-out what is can do. But I notice Christian Lempa also mentioned this issue with state files (for Terraform) not being persistent.

I don't want to depend again on external services hosted by hashicorp. So what about just creating a persistent volume or volume mount for people who run Semaphore UI using Docker? That shouldn't be hard, right? You just let the user store this file outside the docker container basically.

melroy89 avatar Nov 03 '24 17:11 melroy89

@melroy89 you could use state encryption to commit the encrypted file to Git and then env variables reseal the encrypted state. https://opentofu.org/docs/language/state/encryption/

bykof avatar Nov 04 '24 06:11 bykof

@melroy89 you could use state encryption to commit the encrypted file to Git and then env variables reseal the encrypted state. https://opentofu.org/docs/language/state/encryption/

Nice, I see. That could also be a good alternative. I just wanted to highlight one notice from that webpage, just so people don't miss it:

Once your data is encrypted, do not rename key providers and methods in your configuration! The encrypted data stored in the backend contains metadata related to their specific names.

melroy89 avatar Nov 04 '24 18:11 melroy89

Hi @bykof I already started implementing backend for Terraform. It will be available soon.

Any progress on this in upcoming releases?

TravAJohn avatar Dec 09 '24 17:12 TravAJohn

@TravAJohn Terraform HTTP backend will be in week in PRO version.

fiftin avatar Dec 09 '24 21:12 fiftin

@TravAJohn Terraform HTTP backend will be in week in PRO version.

@fiftin Thank you for the update! Will it also be available in the community version or exclusive to PRO?

TravAJohn avatar Dec 10 '24 14:12 TravAJohn

Sad to see that some fairly important features are being paywalled.

patrix87 avatar Dec 31 '24 15:12 patrix87

Available in PRO

fiftin avatar Jul 14 '25 06:07 fiftin