Synopsis
Skip all filtering flags to report everything running in all clusters in a given AWS account. Use
--clusters and/or --clusters-regex OR --exclude and/or --exclude-regex to filter the clusters to snapshot.
You can also filter the services within a cluster using --services and/or --services-regex. Or use --exclude-services and/or --exclude-services-regex to exclude some services.
Note that service filtering is applied to all clusters being snapshot.
All filtering options are case-sensitive.
The reported data includes cluster and service names, container image digests and creation timestamps.
To authenticate to AWS, you can either:
- provide the AWS static credentials via flags or by exporting the equivalent KOSLI env vars (e.g. KOSLI_AWS_KEY_ID)
- export the AWS env vars (e.g. AWS_ACCESS_KEY_ID).
- Use a shared config/credentials file under the $HOME/.aws
More details can be found here: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials
Flags
| Flag | Description |
|---|---|
| —aws-key-id string | The AWS access key ID. |
| —aws-region string | The AWS region. |
| —aws-secret-key string | The AWS secret access key. |
| —clusters strings | [optional] The comma-separated list of ECS cluster names to snapshot. Can’t be used together with —exclude or —exclude-regex. |
| —clusters-regex strings | [optional] The comma-separated list of ECS cluster name regex patterns to snapshot. Can’t be used together with —exclude or —exclude-regex. |
| -D, —dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| —exclude strings | [optional] The comma-separated list of ECS cluster names to exclude. Can’t be used together with —clusters or —clusters-regex. |
| —exclude-regex strings | [optional] The comma-separated list of ECS cluster name regex patterns to exclude. Can’t be used together with —clusters or —clusters-regex. |
| —exclude-services strings | [optional] The comma-separated list of ECS service names to exclude. Can’t be used together with —services or —services-regex. |
| —exclude-services-regex strings | [optional] The comma-separated list of ECS service name regex patterns to exclude. Can’t be used together with —services or —services-regex. |
| -h, —help | help for ecs |
| —services strings | [optional] The comma-separated list of ECS service names to snapshot. Can’t be used together with —exclude-services or —exclude-services-regex. |
| —services-regex strings | [optional] The comma-separated list of ECS service name regex patterns to snapshot. Can’t be used together with —exclude-services or —exclude-services-regex. |
Flags inherited from parent commands
| Flag | Description |
|---|---|
| -a, —api-token string | The Kosli API token. |
| -c, —config-file string | [optional] The Kosli config file path. (default “kosli”) |
| —debug | [optional] Print debug logs to stdout. A boolean flag docs (default false) |
| -H, —host string | [defaulted] The Kosli endpoint. (default “https://app.kosli.com”) |
| —http-proxy string | [optional] The HTTP proxy URL including protocol and port number. e.g. ‘http://proxy-server-ip:proxy-port’ |
| -r, —max-api-retries int | [defaulted] How many times should API calls be retried when the API host is not reachable. (default 3) |
| —org string | The Kosli organization. |
Examples Use Cases
These examples all assume that the flags--api-token, --org, --host, (and --flow, --trail when required), are set/provided.
authentication to AWS using flags
authentication to AWS using flags
authentication to AWS using env variables
authentication to AWS using env variables
reporting everything running in all clusters in a given AWS account
reporting everything running in all clusters in a given AWS account
include clusters matching a name in the AWS account
include clusters matching a name in the AWS account
include clusters matching a pattern in the AWS account
include clusters matching a pattern in the AWS account
include clusters matching a list of names in the AWS account
include clusters matching a list of names in the AWS account
exclude clusters matching a name in the AWS account
exclude clusters matching a name in the AWS account
exclude clusters matching a pattern in the AWS account
exclude clusters matching a pattern in the AWS account
exclude clusters matching a list of names in the AWS account
exclude clusters matching a list of names in the AWS account
include Services matching a name in one cluster
include Services matching a name in one cluster
include Services matching a pattern in one cluster
include Services matching a pattern in one cluster
include production Services only (by naming convention) in all clusters in the AWS account
include production Services only (by naming convention) in all clusters in the AWS account
include Services matching a name in all clusters in the AWS account
include Services matching a name in all clusters in the AWS account
include Services matching a list of names in all clusters in the AWS account
include Services matching a list of names in all clusters in the AWS account
exclude Services matching a pattern in one cluster
exclude Services matching a pattern in one cluster
exclude Production services only (by naming convention) in all clusters in the AWS account
exclude Production services only (by naming convention) in all clusters in the AWS account
exclude Services matching a name in one cluster
exclude Services matching a name in one cluster
exclude Services matching a name in all clusters in the AWS account
exclude Services matching a name in all clusters in the AWS account
exclude Services matching a list of names in all clusters in the AWS account
exclude Services matching a list of names in all clusters in the AWS account