Skip to content

Commit

Permalink
fix: broken links (#187)
Browse files Browse the repository at this point in the history
* fix: broken links

* more fixes

* document cloud connections
  • Loading branch information
adityathebe authored Mar 14, 2024
1 parent e0e8e48 commit 1485595
Show file tree
Hide file tree
Showing 26 changed files with 591 additions and 561 deletions.
16 changes: 8 additions & 8 deletions canary-checker/docs/concepts/display-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
- name: USD
url: https://api.frankfurter.app/latest?from=USD&to=GBP,EUR,ILS,ZAR
display:
template: "$1 = €{{.json.rates.EUR}}, £{{.json.rates.GBP}}, ₪{{.json.rates.ILS}}"
template: '$1 = €{{.json.rates.EUR}}, £{{.json.rates.GBP}}, ₪{{.json.rates.ILS}}'
```
Which would display:
Expand All @@ -29,7 +29,8 @@ Which would display:
$1 = €0.94913, £0.82394, ₪3.8455
```

See [Go Template](/scripting/gotemplate)
See <CommonLink to="gotemplate">Go Template</CommonLink>

## CEL Expressions

The equivalent using CEL expressions would be:
Expand All @@ -44,10 +45,10 @@ spec:
- name: USD
url: https://api.frankfurter.app/latest?from=USD&to=GBP,EUR,ILS,ZAR
display:
expr: "'$1 = €' + string(json.rates.EUR) + ', £' + string(json.rates.GBP) + ', ₪' + string(json.rates.ILS)"
````
expr: "'$1 = €' + string(json.rates.EUR) + ', £' + string(json.rates.GBP) + ', ₪' + string(json.rates.ILS)"
```
See [CEL](/scripting/cel) for a function reference
See <CommonLink to="cel">Cel Expressions</CommonLink> for a function reference
## Javascript
Expand All @@ -72,15 +73,14 @@ spec:
display += currency + " = " + currencyCodes[currency] + json.rates[currency] + ", "
}
"$1 = " + display
````
```
:::info
Do not return anything from the function, e.g. instead of `return "hello" + "world"` use just `"hello" + "world"`
:::

See [Javascript](/scripting/javascript) for more details and a function reference.
See <CommonLink to="javascript">JavaScript</CommonLink> for more details and a function reference.

## Variables

Each check exposes different variables to use in the `display` expression, See the **Result Variables** section for each check.

2 changes: 1 addition & 1 deletion canary-checker/docs/concepts/health-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
`test` expressions must return a bool or boolean type string (`'true'` or `'false`')
:::

See [CEL](/scripting/cel) for a function reference
See <CommonLink to="cel">Cel Expressions</CommonLink> for a function reference

:::note Javascript and Go Templating
While `test` fields do support Javascript and Go Text Templates, they are not recommended for health evaluations due to their verbosity and performance.
Expand Down
2 changes: 1 addition & 1 deletion canary-checker/docs/concepts/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The following local settings will affect the permissions available for use by th

### Local Canary execution

Install the CLI as per the [Installation instructions](../../cli/)
Install the CLI as per the [Installation instructions](../cli)
Generate a local resource file with the trace annotation enabled:

```bash
Expand Down
120 changes: 60 additions & 60 deletions canary-checker/docs/reference/aws-config-rule.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@ metadata:
spec:
interval: 30
awsConfigRule:
- description: "AWS Config Rule Checker"
- description: 'AWS Config Rule Checker'
name: AWS Config Rule Checker
rules:
- "s3-bucket-public-read-prohibited"
- 's3-bucket-public-read-prohibited'
ignoreRules:
- "s3-bucket-public-write-prohibited"
- 's3-bucket-public-write-prohibited'
```
| Field | Description | Scheme | Required |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------- | -------- |
| `rules` | Specify one or more Config rule names to filter the results by rule. | `[]string` | |
| `ignoreRules` | List of rules which would be omitted from the fetch result. | `[]string` | |
| `complianceTypes` | Filters the results by compliance. The allowed values are `INSUFFICIENT_DATA`, `NON_COMPLIANT`, `NOT_APPLICABLE`, `COMPLIANT` | `[]string` | |
| **`name`** | Name of the check, must be unique within the canary | `string` | Yes |
| `description` | Description for the check | `string` | |
| `icon` | Icon for overwriting default icon on the dashboard | `string` | |
| `labels` | Labels for check | `map[string]string` | |
| `test` | Evaluate whether a check is healthy | [`Expression`](../concepts/health-evaluation) | |
| `display` | Expression to change the formatting of the display | [`Expression`](../concepts/display-formatting) | |
| `transform` | Transform data from a check into multiple individual checks | [`Expression`](../concepts/transforms) | |
| `metrics` | Metrics to export from | [`[]Metrics`](../concepts/metrics-exporter) | |
| **Connection** | | | |
| <SkipOSS>`connection`</SkipOSS> | | <SkipOSS>[Connection](../concepts/connections) </SkipOSS> | |
| `accessKey` | <SkipOSS>Mutually exclusive with `connection`</SkipOSS> | <CommonLink to="authentication">*EnvVar*</CommonLink> | Yes |
| `secretKey` | <SkipOSS>Mutually exclusive with `connection`</SkipOSS> | <CommonLink to="authentication">*EnvVar*</CommonLink> | Yes |
| `endpoint` | Custom AWS Config endpoint | *string* | |
| `region` | AWS region | *string* | |
| `skipTLSVerify` | Skip TLS verify when connecting to AWS | *bool* | |
| Field | Description | Scheme | Required |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------- |
| `rules` | Specify one or more Config rule names to filter the results by rule. | `[]string` | |
| `ignoreRules` | List of rules which would be omitted from the fetch result. | `[]string` | |
| `complianceTypes` | Filters the results by compliance. The allowed values are `INSUFFICIENT_DATA`, `NON_COMPLIANT`, `NOT_APPLICABLE`, `COMPLIANT` | `[]string` | |
| **`name`** | Name of the check, must be unique within the canary | `string` | Yes |
| `description` | Description for the check | `string` | |
| `icon` | Icon for overwriting default icon on the dashboard | `string` | |
| `labels` | Labels for check | `map[string]string` | |
| `test` | Evaluate whether a check is healthy | [`Expression`](../concepts/health-evaluation) | |
| `display` | Expression to change the formatting of the display | [`Expression`](../concepts/display-formatting) | |
| `transform` | Transform data from a check into multiple individual checks | [`Expression`](../concepts/transforms) | |
| `metrics` | Metrics to export from | [`[]Metrics`](../concepts/metrics-exporter) | |
| **Connection** | | | |
| <SkipOSS>`connection`</SkipOSS> | | <SkipOSS><CommonLink to="connection">_Connections_</CommonLink> </SkipOSS> | |
| `accessKey` | <SkipOSS>Mutually exclusive with `connection`</SkipOSS> | <CommonLink to="authentication">_EnvVar_</CommonLink> | Yes |
| `secretKey` | <SkipOSS>Mutually exclusive with `connection`</SkipOSS> | <CommonLink to="authentication">_EnvVar_</CommonLink> | Yes |
| `endpoint` | Custom AWS Config endpoint | _string_ | |
| `region` | AWS region | _string_ | |
| `skipTLSVerify` | Skip TLS verify when connecting to AWS | _bool_ | |

### Connecting to AWS

Expand All @@ -51,42 +51,42 @@ There are 3 options when connecting to AWS:

2. `connection`, this is the recommended method, connections are reusable and secure

```yaml title="aws-connection.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: aws-config-rule
spec:
interval: 30
awsConfigRule:
- name: AWS Config Rule Checker
connection: connection://aws/internal
rules:
- "s3-bucket-public-read-prohibited"
```
```yaml title="aws-connection.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: aws-config-rule
spec:
interval: 30
awsConfigRule:
- name: AWS Config Rule Checker
connection: connection://aws/internal
rules:
- 's3-bucket-public-read-prohibited'
```

3. `accessKey` and `secretKey` <CommonLink to="authentication">*EnvVar*</CommonLink> with the credentials stored in a secret.
3. `accessKey` and `secretKey` <CommonLink to="authentication">_EnvVar_</CommonLink> with the credentials stored in a secret.

```yaml title="aws.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: aws-config-rule
spec:
interval: 30
awsConfigRule:
- name: AWS Config Rule Checker
accessKey:
valueFrom:
secretKeyRef:
name: aws-credentials
key: AWS_ACCESS_KEY_ID
secretKey:
valueFrom:
secretKeyRef:
name: aws-credentials
key: AWS_SECRET_ACCESS_KEY
region: us-east-1
rules:
- "s3-bucket-public-read-prohibited"
```
```yaml title="aws.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: aws-config-rule
spec:
interval: 30
awsConfigRule:
- name: AWS Config Rule Checker
accessKey:
valueFrom:
secretKeyRef:
name: aws-credentials
key: AWS_ACCESS_KEY_ID
secretKey:
valueFrom:
secretKeyRef:
name: aws-credentials
key: AWS_SECRET_ACCESS_KEY
region: us-east-1
rules:
- 's3-bucket-public-read-prohibited'
```
Loading

0 comments on commit 1485595

Please sign in to comment.