File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,23 @@ data "gitlab_user" "spackbot" {
2222 username = " spackbot"
2323}
2424
25+ locals {
26+ webhook_handler_token_expires_at = " 2024-12-03"
27+ }
28+
2529resource "gitlab_personal_access_token" "webhook_handler" {
2630 user_id = data. gitlab_user . spackbot . id
2731 name = " Webhook handler token"
28- # TODO: How to deal with this expiring
29- expires_at = " 2024-12-03"
32+ expires_at = local. webhook_handler_token_expires_at
3033
3134 scopes = [" read_api" , " read_repository" ]
35+
36+ lifecycle {
37+ precondition {
38+ condition = timecmp (timestamp (), " ${ local . webhook_handler_token_expires_at } T00:00:00Z" ) == - 1
39+ error_message = " The token has expired. Please update the expires_at date."
40+ }
41+ }
3242}
3343
3444resource "random_password" "webhook_handler" {
You can’t perform that action at this time.
0 commit comments