Skip to content

DO NOT MERGE: Kosli Capture drop-in AWS snapshotting tutorial#337

Draft
mintlify[bot] wants to merge 1 commit into
mainfrom
mintlify/7699b463
Draft

DO NOT MERGE: Kosli Capture drop-in AWS snapshotting tutorial#337
mintlify[bot] wants to merge 1 commit into
mainfrom
mintlify/7699b463

Conversation

@mintlify

@mintlify mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Adds a new tutorial page walking through how to use kosli-dev/kosli-capture as a drop-in to start snapshotting AWS runtime environments (ECS, EKS, Lambda, tagged S3) into Kosli quickly.

Structured after tutorials/working_with_controls.mdx:

  • Beta callout up top
  • What / why intro
  • "This tutorial covers" bullet list
  • Prerequisites
  • How it works (discovery → tag filter → env name → snapshot)
  • Deploy (bootstrap + make deploy)
  • Config: naming, scope, per-type toggles, grouping, EKS namespaces
  • Runtime config sources (baked / SSM / S3)
  • EKS caveats (self-onboarding + private endpoints)
  • Verification, known limitations, "What you've accomplished"

Sourced from:

  • The kosli-capture README, config.yaml, terraform/variables.tf, and docs/architecture.md
  • The Marko/Steve conversation transcript

Added to nav under Reporting environments alongside the existing per-resource reporter tutorial.

Draft / do-not-merge as requested — this is for review with the team and a couple of customers first.


Generated by Mintlify Agent.

Requested by: marko@kosli.com via Slack
Mintlify session: slack_1778705097.340389_D0ALT8RK1CJ

@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Claude finished @mintlify[bot]'s task in 2m 55s —— View job


PR Review: Kosli Capture AWS Snapshotting Tutorial

  • Read CLAUDE.md and doc-review skill
  • Read changed files (tutorial + navigation)
  • Check navigation entry
  • Check links, frontmatter, and conventions
  • Post review findings

Summary

Solid first draft of the Kosli Capture tutorial. The page is well-written, technically detailed, and covers the full lifecycle (deploy → configure → verify → caveats). Navigation entry is correct, all internal links resolve, no relative links, and writing style is consistent with the repo conventions.

4 inline comments posted on the tutorial file — see the Files changed tab for details.


Findings

Critical

None.

Improvement

Location Issue Recommendation
snapshotting_with_kosli_capture.mdx:92-173 Diátaxis: tutorial/reference mixing. The 80-line config section (naming, scope, per-type toggles, grouping, EKS namespaces) is detailed reference material rather than tutorial steps. Trim to a minimal working config example for the tutorial path, and extract the full config docs into a separate reference page. See inline comment.

Suggestion

Location Issue Recommendation
snapshotting_with_kosli_capture.mdx:4 Long description (~200 chars) Shorten to one sentence. See inline suggestion.
snapshotting_with_kosli_capture.mdx:12 "onboarding story" is vague Use more concrete phrasing. See inline suggestion.
snapshotting_with_kosli_capture.mdx:89 "you should see" is passive Use imperative mood per style guide. See inline suggestion.

Checklist passed

  • New page added to config/navigation.json under "Reporting environments"
  • All internal links are root-relative (no ../ links)
  • All 7 internal links resolve to existing files
  • Frontmatter has title and description
  • No British spellings detected
  • "Kosli" used correctly (not "the Kosli platform" or "KOSLI")
  • Components (<Info>, <Tip>) used appropriately
  • No external link issues

Overall assessment

The tutorial is well-structured and provides good coverage of Kosli Capture. The main structural suggestion — splitting the config reference from the tutorial flow — would strengthen both the tutorial (tighter focus) and the config docs (independently discoverable). All other findings are minor style suggestions. No blockers.

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
kosli 🟢 Ready View Preview Jul 21, 2026, 5:59 PM

---
title: "Snapshotting AWS runtimes with Kosli Capture"
description: "Drop a single stack into an AWS account and have Kosli Capture discover ECS, EKS, Lambda, and tagged S3 buckets, auto-create Kosli environments, and snapshot them on a schedule."
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: The description is ~200 characters — longer than most pages in this repo. Consider trimming to one focused sentence, e.g.:

Suggested change
---
description: "Deploy Kosli Capture into an AWS account to auto-discover and snapshot ECS, EKS, Lambda, and S3 resources into Kosli."

Comment on lines +92 to +173

`config.yaml` at the repo root defines the policy Kosli Capture applies. It has three parts: **naming**, **scope**, and **types**.

### Naming

```yaml
naming:
prefix: aws-prod # global default; omitted -> aws-{account_id}
template: "{prefix}-{type}-{name}" # placeholders: {prefix} {account_id} {region} {type} {name}
prefix_tag: "kosli:prefix" # per-resource {prefix} override
name_tag: "kosli:env-name" # per-resource full env-name override (escape hatch)
```

The env name for each resource is resolved through a single precedence chain, used for whole resources and namespace slices alike:

| Precedence | Where | Behavior |
|------------|----------------------------------------------------|-----------------------------------------------------------------------------|
| 1 | Explicit env name (config, EKS `namespaces` map) | Wins outright |
| 2 | `kosli:env-name` tag on the resource | Whole resource → that name; sliced cluster → `<value>-<ns>` |
| 3 | Template | `{prefix}-{type}-{name}`; slices append `-<ns>` to `{name}` |

Within the template, `{prefix}` itself resolves: `kosli:prefix` tag on the resource → `types.<type>.prefix` → `naming.prefix` → `aws-{account_id}`. Keep `{type}` in the template — env names are unique per Kosli org and a bucket can share a name with a cluster.

### Scope and tag filters

Every type block accepts the same tag-filter fields, combined with the global `scope`:

- **include** = global ∪ per-type pairs; a resource must match **all** of them (empty = opt-out mode: everything unless excluded).
- **exclude** = global ∪ per-type pairs; matching **any** pair excludes the resource.

```yaml
scope:
regions: [] # empty = the Lambda's own region only
include_tags: {} # empty = opt-out mode
exclude_tags:
kosli:ignore: "true" # anything tagged kosli:ignore=true is skipped
```

Multi-region deployments list every region in `scope.regions`. When you scan multiple regions, add `{region}` to `naming.template` so each region gets its own env — a Kosli env holds one full-state snapshot, so overwriting the same name from different regions would clobber it each run.

### Per-type toggles

```yaml
types:
ecs:
enabled: true

eks:
enabled: true
include_scaling: true # capture replica-count changes as new snapshots

lambda:
enabled: true
granularity: account # account = one env per resolved prefix; function = env per function

s3:
enabled: true
include_tags:
kosli:track: "true" # S3 is opt-in — see below
```

**S3 is intentionally opt-in.** A Kosli `s3` environment fingerprints bucket **content** (for deployment tracking), not a bucket inventory. Most accounts have many buckets that are not deployment artifacts — Terraform state buckets, CloudFormation staging buckets, log buckets. Snapshotting all of them would be noise. `types.s3.include_tags` must therefore be non-empty; otherwise Kosli Capture records a gap and skips S3 entirely.

### Grouping Lambdas or ECS clusters by tag

Sometimes several Lambda functions or ECS clusters should be reported into the **same** Kosli environment — for example, all the Lambdas that make up one application. Use `grouping` to map an exact env name to a set of tag pairs:

```yaml
types:
lambda:
grouping:
aws-prod-payments: { team: payments }
aws-prod-checkout: { team: checkout, tier: prod } # multiple pairs = AND

ecs:
grouping:
aws-prod-platform: { team: platform }
```

Resources matching **all** pairs of an entry are reported together in one snapshot call (`snapshot lambda --function-names a,b,c` / `snapshot ecs --clusters a,b,c`). Unmatched resources fall through to the default behavior — Lambda's `granularity`, ECS's per-cluster env — unchanged. The first matching entry wins, and an entry with no tags never matches, so a typo cannot sweep in everything.

Grouping is only offered where the snapshot command reports a set in one call. S3 (`--bucket` is a single bucket) and per-cluster EKS have no such flag, so grouping does not apply to them — pointing several of those at one env name would just overwrite it each run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Improvement (Diátaxis): This 80-line config block (naming, scope, per-type toggles, grouping, EKS namespaces) reads as reference material rather than tutorial steps. In the Diátaxis model, a tutorial walks the reader through one concrete scenario; detailed option docs belong in a reference page.

Consider either:

  1. Trim for the tutorial path: show a minimal config.yaml with one customization (e.g. setting a prefix + enabling ECS only), then link out to a separate config reference page for the full option set.
  2. Split the page: keep the deploy + verify flow here as a tutorial; extract the config documentation into understand_kosli/kosli_capture_config or similar, and cross-link.

This would keep the tutorial focused and make the config details independently findable. Not blocking — the current form is usable — but it would improve both pages.


[Kosli Capture](https://github.com/kosli-dev/kosli-capture) is a single deployable that sits **inside your AWS account**, discovers the resources you already run, and reports them to Kosli as environment snapshots — with no per-cluster reporter to install, no environments to pre-create, and no inventory list to maintain in config.

It exists to shorten the runtime-side onboarding story. Getting build and release evidence into Kosli is usually straightforward — you own the pipeline. The runtime side is where most of the friction lives: reporters to deploy into every cluster, environments to create by hand, networking approvals for each workload. Kosli Capture flips that: one stack per account, tags decide what is in scope, and Kosli environments are created on first sight.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: "onboarding story" is a bit vague. Consider something more concrete:

Suggested change
It exists to shorten the runtime-side onboarding story. Getting build and release evidence into Kosli is usually straightforward — you own the pipeline. The runtime side is where most of the friction lives: reporters to deploy into every cluster, environments to create by hand, networking approvals for each workload. Kosli Capture flips that: one stack per account, tags decide what is in scope, and Kosli environments are created on first sight.
It exists to shorten runtime-side onboarding. Getting build and release evidence into Kosli is usually straightforward — you own the pipeline. The runtime side is where most of the friction lives: reporters to deploy into every cluster, environments to create by hand, networking approvals for each workload. Kosli Capture flips that: one stack per account, tags decide what is in scope, and Kosli environments are created on first sight.

The region is pinned end-to-end: the Terraform provider, state bucket, CloudFormation stack, and ECR registry all use the same `REGION` value. Override everything at once with `make deploy REGION=<other-region>`. An ambient `AWS_REGION` cannot silently steer the deploy into a different region.
</Tip>

Once the first run completes (every two minutes by default), you should see Kosli environments appear in the [Kosli app](https://app.kosli.com) under **Environments**, named according to the template in `config.yaml`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: "you should see" is slightly passive for a tutorial. Consider imperative mood per the style guide:

Suggested change
Once the first run completes (every two minutes by default), you should see Kosli environments appear in the [Kosli app](https://app.kosli.com) under **Environments**, named according to the template in `config.yaml`.
Once the first run completes (every two minutes by default), check the [Kosli app](https://app.kosli.com) under **Environments** — you will see Kosli environments named according to the template in `config.yaml`.

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
kosli 🟡 Building Jul 21, 2026, 5:58 PM

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.

1 participant