From 928785112c49dacc2e71c3e37333abd672641398 Mon Sep 17 00:00:00 2001 From: Sami Alajrami Date: Wed, 23 Oct 2024 09:51:36 +0200 Subject: [PATCH] add environment snapshotting scopes table --- .../content/getting_started/environments.md | 20 ++++++++++++++++--- .../content/tutorials/report_aws_envs.md | 14 ++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docs.kosli.com/content/getting_started/environments.md b/docs.kosli.com/content/getting_started/environments.md index d7e9d8e48..d2c83bca6 100644 --- a/docs.kosli.com/content/getting_started/environments.md +++ b/docs.kosli.com/content/getting_started/environments.md @@ -37,11 +37,11 @@ You can also create an environment directly from [app.kosli.com](https://app.kos - Fill in the environment name and description and select a type, then click `Save Environment`. -After the new environment is created you'll be redirected to its page - with "No events have been found for [...]" message. Once you start reporting your actual runtime environment to Kosli you'll see all the events (such as which artifacts started or stopped running) listed on that page. +After the new environment is created you'll be redirected to its page, which will initially have no snapshots. Once you start reporting your actual runtime environment to Kosli you'll be able to find snapshots and events (such as which artifacts started or stopped running) listed on that page. ## Snapshoting an environment -To record the current status of your environment you need to make Kosli CLI scrape the running artifacts in it and report it to Kosli. +To record the current status of your environment you need to make Kosli CLI snapshot the running artifacts in it and report it to Kosli. When Kosli receives an environment report, if the received list of running artifacts is different than what is in the latest environment snapshot, a new environment snapshot is created. Snapshots are immutable and can't be tampered with. Currently, the following environment types are supported: @@ -52,12 +52,26 @@ Currently, the following environment types are supported: - AWS Lambda - AWS Elastic Container Service (ECS) -While you can report environment snapshots manually using the `kosli snapshot [...]` commands for testing, for production use, you would configure the reporting to happen automatically on regular intervals, e.g. via a cron job or scheduled CI job, or on certain events. +You can report environment snapshots manually using the `kosli snapshot [...]` commands for testing. For production use, however, you would configure the reporting to happen automatically on regular intervals, e.g. via a cron job or scheduled CI job, or on certain events. You can follow one of the tutorials below to setup automatic snapshot reporting for your environment: - [Kubernetes environment reporting](/tutorials/report_k8s_envs) - [AWS ECS/S3/Lambda environment reporting](/tutorials/report_aws_envs) +### Snapshotting scopes + +Depending on the type of your environment, you can scope what to snapshot from the environment. The following table shows the different scoping options currently available for different environment types: + +| what to snapshot -> | all resources | resources by names | resources by Regex | exclude by names | exclude by Regex | +|----------------------------|---------------|--------------------|--------------------|------------------|------------------| +| ECS (clusters) | √ | √ | √ | √ | √ | +| Lambda (functions) | √ | √ | √ | √ | √ | +| S3 (buckets) | | | | | | +| docker (containers) | √ | | | | | +| k8s (namespaces) | √ | √ | √ | √ | √ | +| azure (functions and apps) | √ | | | | | + + ## Logical Environments Logical environments are a way to group your Kosli environments so you can view all changes happening in your group in the same place. For example, if what you consider to be “Production” is a combination of a Kubernetes cluster, an S3 bucket, and a configuration file, you can combine the reports sent to these Kosli environments into a “Production” logical environment. diff --git a/docs.kosli.com/content/tutorials/report_aws_envs.md b/docs.kosli.com/content/tutorials/report_aws_envs.md index 4eac0a785..8160ca74f 100644 --- a/docs.kosli.com/content/tutorials/report_aws_envs.md +++ b/docs.kosli.com/content/tutorials/report_aws_envs.md @@ -130,14 +130,14 @@ resource "random_pet" "this" { module "lambda_reporter" { source = "kosli-dev/kosli-reporter/aws" - version = "0.5.3" + version = "0.5.7" name = local.reporter_name kosli_environment_type = "ecs" - kosli_cli_version = "v2.7.8" + kosli_cli_version = "v2.11.0" kosli_environment_name = "aws-env-tutorial" kosli_org = "" - reported_aws_resource_name = "" + reported_aws_resource_name = "" } ``` {{< /tab >}} @@ -190,11 +190,11 @@ variable "my_lambda_functions" { module "lambda_reporter" { source = "kosli-dev/kosli-reporter/aws" - version = "0.5.3" + version = "0.5.7" name = local.reporter_name kosli_environment_type = "lambda" - kosli_cli_version = "v2.7.8" + kosli_cli_version = "v2.11.0" kosli_environment_name = "aws-env-tutorial" kosli_org = "" reported_aws_resource_name = var.my_lambda_functions @@ -268,11 +268,11 @@ variable "my_lambda_functions" { module "lambda_reporter" { source = "kosli-dev/kosli-reporter/aws" - version = "0.5.3" + version = "0.5.7" name = local.reporter_name kosli_environment_type = "s3" - kosli_cli_version = "v2.7.8" + kosli_cli_version = "v2.11.0" kosli_environment_name = "aws-env-tutorial" kosli_org = "" reported_aws_resource_name = ""