Skip to content

Commit 5bf8a23

Browse files
docs: document --include-regex and --exclude-regex for snapshot s3 (#216)
Updates the `kosli snapshot s3` CLI reference to document the new `--include-regex` and `--exclude-regex` path filters introduced in [kosli-dev/cli#882](kosli-dev/cli#882). - Mention regex variants alongside literal-prefix `--include`/`--exclude` in the long description - Add `--include-regex` and `--exclude-regex` rows to the Flags table - Update existing `--include`/`--exclude` descriptions to note mutual exclusivity with the new regex flags - Add an example using `--exclude-regex '.*\.png$'` Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
1 parent cf24d7a commit 5bf8a23

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

client_reference/kosli_snapshot_s3.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To authenticate to AWS, you can either:
2121
Option 1 takes highest precedence, while option 3 is the lowest.
2222
More details can be found here: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials
2323

24-
You can report the entire bucket content, or filter some of the content using `--include` and `--exclude`.
24+
You can report the entire bucket content, or filter some of the content using `--include`/`--exclude` (literal prefix match) or `--include-regex`/`--exclude-regex` (Go regular expressions matched against the full object key).
2525
In all cases, the content is reported as one artifact. If you wish to report separate files/dirs within the same bucket as separate artifacts, you need to run the command twice.
2626

2727
To specify paths in a directory artifact that should always be excluded from the SHA256 calculation, you can add a `.kosli_ignore` file to the root of the artifact.
@@ -36,9 +36,11 @@ The `.kosli_ignore` will be treated as part of the artifact like any other file,
3636
| --aws-secret-key string | The AWS secret access key. |
3737
| --bucket string | The name of the S3 bucket. |
3838
| -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. |
39-
| -x, --exclude strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to exclude when fingerprinting. Cannot be used together with --include. |
39+
| -x, --exclude strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to exclude when fingerprinting. Paths match by literal prefix. Cannot be used together with --include or --include-regex. |
40+
| --exclude-regex strings | [optional] The comma separated list of Go regular expressions matched against object keys in the S3 bucket to exclude when fingerprinting. Cannot be used together with --include or --include-regex. |
4041
| -h, --help | help for s3 |
41-
| -i, --include strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to include when fingerprinting. Cannot be used together with --exclude. |
42+
| -i, --include strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to include when fingerprinting. Paths match by literal prefix. Cannot be used together with --exclude or --exclude-regex. |
43+
| --include-regex strings | [optional] The comma separated list of Go regular expressions matched against object keys in the S3 bucket to include when fingerprinting. Cannot be used together with --exclude or --exclude-regex. |
4244

4345

4446
## Flags inherited from parent commands
@@ -102,5 +104,12 @@ kosli snapshot s3 yourEnvironmentName
102104
--exclude file.txt,path/within/bucket
103105
```
104106
</Accordion>
107+
<Accordion title="exclude all PNG files in an AWS S3 bucket via a regex">
108+
```shell
109+
kosli snapshot s3 yourEnvironmentName
110+
--bucket yourBucketName
111+
--exclude-regex '.*\.png$'
112+
```
113+
</Accordion>
105114
</AccordionGroup>
106115

0 commit comments

Comments
 (0)