chore: update Terraform reference: sync service_account_api_key for v0.9.4 - #408
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Claude finished @mintlify[bot]'s task in 2m 34s —— View job Doc review — PR #408
Three findings, all on
Upstream — does not block this merge
Checks I could not run
Verdict: 0 Critical, 3 Improvements, 0 Suggestions. Advisory only — no approval or change request. |
| </Warning> | ||
|
|
||
| To derive dates dynamically, use Terraform's built-in functions, e.g. `timeadd("2026-01-01T00:00:00Z", "8760h")`. | ||
| To derive dates from a fixed anchor, use Terraform's built-in functions, e.g. `timeadd("2027-01-01T00:00:00Z", "720h")`. Avoid deriving `expires_at` from `timestamp()`. It changes on every plan, and because `expires_at` forces replacement that would revoke and recreate the key on each apply. |
There was a problem hiding this comment.
Improvement — the timestamp() warning is missing its main clause, so the reason it matters is hard to parse: "It changes on every plan, and because expires_at forces replacement that would revoke and recreate the key on each apply." The consequence sentence never resolves.
| To derive dates from a fixed anchor, use Terraform's built-in functions, e.g. `timeadd("2027-01-01T00:00:00Z", "720h")`. Avoid deriving `expires_at` from `timestamp()`. It changes on every plan, and because `expires_at` forces replacement that would revoke and recreate the key on each apply. | |
| To derive dates from a fixed anchor, use Terraform's built-in functions, e.g. `timeadd("2027-01-01T00:00:00Z", "720h")`. Don't derive `expires_at` from `timestamp()`: it changes on every plan, and because a change to `expires_at` forces replacement, every apply would revoke the key and mint a new one. |
Since this page is agent-synced from kosli-dev/terraform-provider-kosli, the same wording should land upstream or the next sync will reintroduce it.
|
|
||
| <Note> | ||
| All timestamps (`expires_at`, `created_at`, `last_used_at`) are RFC3339 UTC strings. `last_used_at` is null for a key that has never been used. | ||
| All timestamps (`expires_at`, `created_at`, `last_used_at`) are RFC3339 UTC strings. `last_used_at` is null for a key that has never been used. `expires_at` is null only for keys minted before the 365-day cap was introduced. |
There was a problem hiding this comment.
Improvement — this reintroduces a null expires_at state that the previous commit on this page deliberately removed. eb4485e (#407) deleted the "null for a key that never expires" callout with the stated reason that the state "can no longer exist", verified against kosli-dev/server (src/model/api_key.py::clamp_expires_at, MAX_API_KEY_LIFETIME_DAYS = 365).
Two problems as written:
- Nothing else in the docs supports the claim that pre-cap keys with a null expiry still exist in Kosli — the
expires_atschema entry (line 96) doesn't mention null, andclient_reference/kosli_create_api-key.md:16states flatly that every API key expires. - If such keys do exist, the page gives a reader who imports one no guidance: does Terraform show permanent drift, and does setting
expires_aton it force replacement (i.e. revoke a working key)?
Either confirm the legacy state against the provider's read path and say what a reader should do with one, or drop the sentence.
| <Warning> | ||
| Kosli caps the lifetime of every API key at **365 days**. An `expires_at` further out than that is silently shortened by the server, and Terraform then reports the mismatch as `Provider produced inconsistent result after apply`. Keys that never expire can no longer be created: omitting `expires_at` yields the maximum 365-day expiry rather than no expiry at all. | ||
| </Warning> |
There was a problem hiding this comment.
Improvement — the rewrite names the error but drops what happens after it. The replaced bullet told the reader the resource is marked tainted and the next apply revokes and recreates the key; without that, someone who hits Provider produced inconsistent result after apply doesn't know their key is about to be rotated out from under them. Also, "365 days" loses the anchor that the sibling pages carry ("365 days from creation" — administration/authentication/api_key_rotation.md:14, tutorials/rotating_api_keys.mdx:23).
| <Warning> | |
| Kosli caps the lifetime of every API key at **365 days**. An `expires_at` further out than that is silently shortened by the server, and Terraform then reports the mismatch as `Provider produced inconsistent result after apply`. Keys that never expire can no longer be created: omitting `expires_at` yields the maximum 365-day expiry rather than no expiry at all. | |
| </Warning> | |
| <Warning> | |
| Kosli caps the lifetime of every API key at **365 days from creation**. An `expires_at` further out than that is silently shortened by the server, and Terraform then reports the mismatch as `Provider produced inconsistent result after apply` and marks the resource tainted — the next apply revokes the key and creates a new one. Keys that never expire can no longer be created: omitting `expires_at` yields the maximum 365-day expiry rather than no expiry at all. | |
| </Warning> |
Summary
Align the
kosli_service_account_api_keyreference page with the upstream v0.9.4 release ofterraform-provider-kosli.Changes
resource.tffor v0.9.4 (adds explanatory comments; example expiry moved to2027-01-01T00:00:00Z).Provider produced inconsistent result after apply), and warn against derivingexpires_atfromtimestamp().expires_atis null only for keys minted before the 365-day cap was introduced.expires_atschema example timestamp to match.Context
Reflects
v0.9.4(September 11, 2026), which aligns the provider with the server's 365-day cap on API key expiry. No new resources or data sources; existing resource page updated in place. The changelog entry itself is left to the "Update changelog" workflow.