Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add expiration_policy parameter to prebuild resource#404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

ssncferreira
Copy link
Contributor

@ssncferreirassncferreira commentedMay 22, 2025
edited
Loading

Summary

This PR adds Terraform support for configuring aexpiration_policy field in a template preset. This allows users to specify a TTL (ttl) for prebuild workspaces, after which they are considered expired and eligible for deletion and replacement.

Changes

  • Updated the Terraform template preset resource to include the newexpiration_policy block.
  • Added validation and tests to ensure correct TTL handling.

Example Usage

prebuilds = {  instances = 2  expiration_policy {  ttl = 86400  }  }

Related:

@SasSwart
Copy link
Contributor

Looks good. I'd just like to revisit the schema:

prebuilds {  instances = 2  cache_invalidation {  invalidate_after_secs = 86400  }  }

Do we need the nestedcache_invalidation block? Is it because we expect other cache invalidation related fields to eventually be added? Could we get away with the following?

prebuilds {  instances = 2  invalidate_after_secs = 86400  }

@ssncferreira
Copy link
ContributorAuthor

Looks good. I'd just like to revisit the schema:

prebuilds {  instances = 2  cache_invalidation {  invalidate_after_secs = 86400  }  }

Do we need the nestedcache_invalidation block? Is it because we expect other cache invalidation related fields to eventually be added? Could we get away with the following?

prebuilds {  instances = 2  invalidate_after_secs = 86400  }

I also thought about that, the nestedcache_invalidation block was mainly to keep things flexible in case we want to add more expiration or invalidation-related settings down the road. For readability, I actually prefer this option, especially since if I understand correctly there’s another config coming forautoscaling. It makes sense to keep these configurations grouped per block and separated by concern. But I’m definitely open to suggestions! 🙂

One other concern I had was about the naming ofcache_invalidation. Since we’re not really dealing with traditional caching but more with managing prebuild lifecycle or resource expiration, the name might be a bit misleading. Maybe something likeexpiration_policy would make more sense? What do you think?

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Other than the naming/use of block, this seems good to me 👍🏻

@ssncferreira
Copy link
ContributorAuthor

Looks good. I'd just like to revisit the schema:

prebuilds {  instances = 2  cache_invalidation {  invalidate_after_secs = 86400  }  }

Do we need the nestedcache_invalidation block? Is it because we expect other cache invalidation related fields to eventually be added? Could we get away with the following?

prebuilds {  instances = 2  invalidate_after_secs = 86400  }

I also thought about that, the nestedcache_invalidation block was mainly to keep things flexible in case we want to add more expiration or invalidation-related settings down the road. For readability, I actually prefer this option, especially since if I understand correctly there’s another config coming forautoscaling. It makes sense to keep these configurations grouped per block and separated by concern. But I’m definitely open to suggestions! 🙂

One other concern I had was about the naming ofcache_invalidation. Since we’re not really dealing with traditional caching but more with managing prebuild lifecycle or resource expiration, the name might be a bit misleading. Maybe something likeexpiration_policy would make more sense? What do you think?

As discussedinternally, and after getting the confirmation that we'll likely introduce more expiration-related parameters in the future, the terraform schema was updated to:

prebuilds = {  instances = 2  expiration_policy {    ttl = 86400  }}

@ssncferreirassncferreira changed the titlefeat: add cache_invalidation parameter to prebuild resourcefeat: add expiration_policy parameter to prebuild resourceMay 23, 2025
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good and docs and test coverage seems on point, nice work! 👍🏻

ssncferreira reacted with heart emoji
@ssncferreirassncferreira merged commit28dae7f intomainMay 23, 2025
6 checks passed
@ssncferreirassncferreira deleted the ssncferreira/feat-prebuild-cache-invalidation branchMay 23, 2025 18:45
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 23, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mtojekmtojekmtojek approved these changes

@mafredrimafredrimafredri approved these changes

@SasSwartSasSwartAwaiting requested review from SasSwart

@evgeniy-scherbinaevgeniy-scherbinaAwaiting requested review from evgeniy-scherbina

@dannykoppingdannykoppingAwaiting requested review from dannykopping

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@ssncferreira@SasSwart@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp