Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions terraform-reference/data-sources/action.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Fetches details of an existing Kosli action.

Use this data source to reference existing actions and access metadata such as the environments being monitored, the trigger types configured, and the notification targets.

The data source looks up the action by name among environment actions only. A flow action with the same name is never returned.

## Example usage

```terraform
Expand Down
2 changes: 1 addition & 1 deletion terraform-reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ These headers contain only type names and operation names. The provider never se
- `api_token` (String, Sensitive) Kosli API token for authentication. Can also be set via KOSLI_API_TOKEN environment variable.
- `api_url` (String) Kosli API endpoint URL. Defaults to https://app.kosli.com (EU region). Use https://app.us.kosli.com for US region. Must use https; plain http is only accepted for localhost. Can also be set via KOSLI_API_URL environment variable.
- `org` (String) Kosli organization name. Can also be set via KOSLI_ORG environment variable.
- `timeout` (Number) HTTP client timeout in seconds. Defaults to 30 seconds.
- `timeout` (Number) HTTP client timeout in seconds. Must be at least 1. Defaults to 30 seconds.
2 changes: 1 addition & 1 deletion terraform-reference/resources/action.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ icon: "cube"
Manages a Kosli action. Actions send notifications to webhooks, Slack and email when artifact or environment events occur in the monitored environments. At least one of `webhook_url`, `webhooks`, `slack_webhooks` or `emails` is required.

<Note>
Actions are identified internally by a server-assigned `number`. The `name` is used during import to look up the number.
Actions are identified internally by a server-assigned `number`. The `name` is used during import to look up the number. The lookup matches environment actions only, so a flow action with the same name is never read or imported as this resource.
</Note>

Use this resource to configure automated notifications when environments change compliance state. An action can notify generic webhooks, Slack incoming webhooks and email addresses. See [Targets](#targets).
Expand Down
4 changes: 4 additions & 0 deletions terraform-reference/resources/custom_attestation_type.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ icon: "cube"

Manages a custom attestation type in Kosli. Custom attestation types define how Kosli validates and evaluates evidence from proprietary tools, custom metrics, or specialized compliance requirements.

<Note>
Destroying this resource archives the type in Kosli rather than deleting it. An archived type keeps its name and accepts no further changes. Kosli can't unarchive a type, so creating a type with the same name again fails. If a type is archived outside Terraform, the provider removes it from the Terraform state on the next refresh. Give the resource a new `name` to create a replacement.
</Note>

Custom attestation types define the structure and validation rules for attestations in Kosli. They can include:

- A JSON Schema (optional) that defines the expected structure of attestation data
Expand Down
2 changes: 2 additions & 0 deletions terraform-reference/resources/environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ You can't change `type` in Kosli. A plan that changes `type` still replaces the

Kosli never hard-deletes environments. When you run `terraform destroy` or remove a `kosli_environment` from your configuration, the provider archives the environment. The environment disappears from the environment list in Kosli, but Kosli keeps its snapshot history.

If the environment is archived outside Terraform, the provider removes it from the Terraform state on the next refresh instead of failing the plan.

<Note>
Archiving an environment requires a Kosli API token with the **Admin** role. A token with the Member role can create and update environments but cannot archive them. In that case, `terraform destroy` fails with `403 Forbidden` and the resource stays in state. If you cannot use an Admin token and only want Terraform to stop managing the environment, run `terraform state rm kosli_environment.<name>` instead. The environment then remains active in Kosli. See [required permissions](/terraform-reference#required-permissions) for how to set up a service account with the right permissions.
</Note>
Expand Down
2 changes: 2 additions & 0 deletions terraform-reference/resources/logical_environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ Terraform has no ordering between two resources that are both renamed in one pla

Kosli never hard-deletes environments. When you run `terraform destroy` or remove a `kosli_logical_environment` from your configuration, the provider archives the logical environment. The physical environments it included are not affected.

If the logical environment is archived outside Terraform, the provider removes it from the Terraform state on the next refresh instead of failing the plan.

<Note>
Archiving an environment requires a Kosli API token with the **Admin** role. A token with the Member role can create and update logical environments but cannot archive them. In that case, `terraform destroy` fails with `403 Forbidden` and the resource stays in state. If you cannot use an Admin token and only want Terraform to stop managing the logical environment, run `terraform state rm kosli_logical_environment.<name>` instead. The logical environment then remains active in Kosli. See [required permissions](/terraform-reference#required-permissions) for how to set up a service account with the right permissions.
</Note>
Expand Down
Loading