How coder uses terraform? #10314
-
When my workspace runs in k8s, I need to define networkpolicy and service in the template. When the space is closed, the networkpolicy,service will not be deleted, but when the workspace is restarted,the networkpolicy,service will be re-created. already existed at this time. I haven’t seen any relevant documentation explaining the interaction logic of this part. Can you give me some guidance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Every time you do a restart/stop/update for a workspace, Coder runs The only difference is the 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.
|
Beta Was this translation helpful? Give feedback.
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 is1
when a workspace is in the start state and0
in the stop state.So, if you are using
For any of your resources that will be destroyed and recreated on a workspace restart.