Skip to content

Commit 6de7d91

Browse files
committed
Does not require template id
1 parent 63b952e commit 6de7d91

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

provider/workspace.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ func workspaceDataSource() *schema.Resource {
6262
id := helpers.OptionalEnvOrDefault("CODER_WORKSPACE_ID", uuid.NewString())
6363
rd.SetId(id)
6464

65-
templateID, err := helpers.RequireEnv("CODER_WORKSPACE_TEMPLATE_ID")
66-
if err != nil {
67-
return diag.Errorf("undefined env: %v", err)
68-
}
65+
templateID := helpers.OptionalEnv("CODER_WORKSPACE_TEMPLATE_ID")
6966
_ = rd.Set("template_id", templateID)
7067

7168
templateName, err := helpers.RequireEnv("CODER_WORKSPACE_TEMPLATE_NAME")

0 commit comments

Comments
 (0)