Skip to content

How coder uses terraform? #10314

Answered by matifali
glenn2wang asked this question in Q&A
Discussion options

You must be logged in to vote

Every time you do a restart/stop/update for a workspace, Coder runs terraform apply.

The only difference is the data.coder_workspace.me.start_count. This is 1 when a workspace is in the start state and 0 in the stop state.

So, if you are using

data "coder_workspace" "me" {}
resource "some_resource" "some_resource" {
	count = data.coder_workspace.me.start_count
}

For any of your resources that will be destroyed and recreated on a workspace restart.

Note: A workspace restart is simply a Stop followed by a Start.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by matifali
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
docs Area: docs
2 participants
Converted from issue

This discussion was converted from issue #10307 on October 17, 2023 13:48.