You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add expiration_policy parameter to prebuild resource (#404)
* feat: add cache_invalidation parameter to prebuild resource
* fix: formatting
* fix: remove TODO comment
* fix: cache_invalidation block in integration tests
* fix: main.tf integration test
* fix: test Prebuilds_is_set_with_a_cache_invalidation_field_without_its_required_fields
* fix: remove printf
* chore: add comment about partial match in preset test
* chore: add comment about cache_invalidation struct as slice
* chore: add max validation of 604800 seconds (7 days) for invalidate_after_secs to prevent stale prebuilds
* chores: update terraform schema to expiration_policy.ttl & update max validation ttl value to 1 year
* fix: comment
Copy file name to clipboardExpand all lines: docs/data-sources/workspace_preset.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,3 +51,14 @@ data "coder_workspace_preset" "example" {
51
51
Required:
52
52
53
53
-`instances` (Number) The number of workspaces to keep in reserve for this preset.
54
+
55
+
Optional:
56
+
57
+
-`expiration_policy` (Block Set, Max: 1) Configuration block that defines TTL (time-to-live) behavior for prebuilds. Use this to automatically invalidate and delete prebuilds after a certain period, ensuring they stay up-to-date. (see [below for nested schema](#nestedblock--prebuilds--expiration_policy))
Description: "Configuration block that defines TTL (time-to-live) behavior for prebuilds. Use this to automatically invalidate and delete prebuilds after a certain period, ensuring they stay up-to-date.",
97
+
Optional: true,
98
+
MaxItems: 1,
99
+
Elem: &schema.Resource{
100
+
Schema: map[string]*schema.Schema{
101
+
"ttl": {
102
+
Type: schema.TypeInt,
103
+
Description: "Time in seconds after which an unclaimed prebuild is considered expired and eligible for cleanup.",
104
+
Required: true,
105
+
ForceNew: true,
106
+
// Ensure TTL is between 0 and 31536000 seconds (1 year) to prevent stale prebuilds
0 commit comments