Skip to content
Open
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
32 changes: 32 additions & 0 deletions docs/resources/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ description: |-

Kernel uploaded extension durable configuration.

## Example Usage

```terraform
terraform {
required_version = ">= 1.11.0"
}

variable "extension_zip_path" {
type = string
description = "Path to a Chrome extension ZIP with a Manifest V3 manifest."
}

resource "kernel_extension" "example" {
name = "productivity-tools"
source_path = var.extension_zip_path
source_sha256 = filesha256(var.extension_zip_path)
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -27,3 +44,18 @@ Kernel uploaded extension durable configuration.
### Read-Only

- `id` (String) Unique extension identifier.

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# The bare form resolves the project like create: the provider default,
# else the API key's binding.
terraform import kernel_extension.example <extension-id>

# The project-qualified form imports an extension from a specific project.
terraform import kernel_extension.example <project-id>/<extension-id>
```
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

These examples show durable Terraform configuration only.

They do not acquire browsers, release browsers, invoke apps, fetch logs, take screenshots, open live view, upload extensions, or force-delete active runtime state.
They do not acquire browsers, release browsers, invoke apps, fetch logs, take screenshots, open live view, download extensions, or force-delete active runtime state.

Set the API credential before running Terraform:

Expand All @@ -22,6 +22,7 @@ Use local development overrides while the provider is unreleased. See the root [

- [basic-browser-pool](basic-browser-pool) creates a minimal durable browser pool.
- [design-preview-browser-pool](design-preview-browser-pool) shows a browser pool shaped for repeated design-preview checks without modeling the browser sessions themselves.
- [extension](extension) uploads an immutable extension archive and tracks exact content changes with `filesha256`.
- [lookups](lookups) shows read-only project, profile, proxy, and extension data sources.
- [project](project) creates a durable Kernel project with an explicit unique name.
- [project-scoped-browser-pool](project-scoped-browser-pool) places a browser pool in an explicit project, overriding the provider-level `project_id` default.
22 changes: 22 additions & 0 deletions examples/extension/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
terraform {
required_version = ">= 1.11.0"

required_providers {
kernel = {
source = "kernel/kernel"
}
}
}

provider "kernel" {}

variable "extension_zip_path" {
type = string
description = "Path to a Chrome extension ZIP with a Manifest V3 manifest."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Chrome brand in example text

Low Severity

The new extension_zip_path variable description names Chrome and Manifest V3. Public examples in this repo are expected to use generic wording instead of product or brand names, matching other examples that avoid company-specific references.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: Examples must use generic names and URLs — no company-specific references

Reviewed by Cursor Bugbot for commit bf17fc0. Configure here.

}

resource "kernel_extension" "example" {
name = "productivity-tools"
source_path = var.extension_zip_path
source_sha256 = filesha256(var.extension_zip_path)
}
6 changes: 6 additions & 0 deletions examples/resources/kernel_extension/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The bare form resolves the project like create: the provider default,
# else the API key's binding.
terraform import kernel_extension.example <extension-id>

# The project-qualified form imports an extension from a specific project.
terraform import kernel_extension.example <project-id>/<extension-id>
14 changes: 14 additions & 0 deletions examples/resources/kernel_extension/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terraform {
required_version = ">= 1.11.0"
}

variable "extension_zip_path" {
type = string
description = "Path to a Chrome extension ZIP with a Manifest V3 manifest."
}

resource "kernel_extension" "example" {
name = "productivity-tools"
source_path = var.extension_zip_path
source_sha256 = filesha256(var.extension_zip_path)
}