Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add precondition for expired gitlab token #836

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mvandenburgh
Copy link
Member

Something useful I learned about Terraform recently. This will cause any plans or applys to fail if the token is expired.

@mvandenburgh mvandenburgh force-pushed the add-gl-token-expiration-check branch from 55c9560 to e4c2fd1 Compare May 8, 2024 15:08
Comment on lines +36 to +41
lifecycle {
precondition {
condition = timecmp(timestamp(), "${local.webhook_handler_token_expires_at}T00:00:00Z") == -1
error_message = "The token has expired. Please update the expires_at date."
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is great, although I'm concerned at what happens when encounter this expiration date. The terraform plan/apply will fail loudy about it, but besides that how would we know? Let's say if we haven't run terraform plan/apply for a while during the expiration date, would we just be relying on sentry at that point?

This is sort of secondary to this PR, which I think looks good itself, but just thought I'd raise this question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants