Skip to content

Commit

Permalink
doc(suppression_rules): Add documentation and examples
Browse files Browse the repository at this point in the history
Add suppression rule docs and examples

Changelog: Added
  • Loading branch information
t1edtke committed Sep 16, 2024
1 parent 8a25b12 commit be3b92a
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 0 deletions.
67 changes: 67 additions & 0 deletions docs/data-sources/suppression_rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "aquasec_suppression_rules Data Source - terraform-provider-aquasec"
subcategory: ""
description: |-
Fetches the list of suppression rules.
---

# aquasec_suppression_rules (Data Source)

Fetches the list of suppression rules.

## Example Usage

```terraform
# List all suppression rules.
data "aquasec_suppression_rules" "suppression_rules" {}
output "suppression_rules" {
value = { for rule in data.aquasec_suppression_rules.suppression_rules.suppression_rules : rule.id => rule.name }
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Read-Only

- `suppression_rules` (Attributes List) (see [below for nested schema](#nestedatt--suppression_rules))

<a id="nestedatt--suppression_rules"></a>
### Nested Schema for `suppression_rules`

Read-Only:

- `application_scopes` (List of String) List of application scopes for the suppression rule.
- `author` (String) Author of the suppression rule.
- `comment` (String) Comment for the suppression rule.
- `created` (String) Creation date of the suppression rule.
- `expiry` (Number) Expiry in days of the suppression rule.
- `fix_available` (String) Fix available for the suppression rule.
- `id` (Number) Identifier used by AquaSec to identify the suppression rule.
- `name` (String) Name of the suppression rule.
- `scope` (Attributes) Scope of the suppression rule. (see [below for nested schema](#nestedatt--suppression_rules--scope))
- `score` (List of Number) List of scores for the suppression rule.
- `severity` (String) Severity of the suppression rule.
- `status` (Boolean) Status of the suppression rule.
- `vulnerabilities` (String) Vulnerabilities as comma separated list for the suppression rule.

<a id="nestedatt--suppression_rules--scope"></a>
### Nested Schema for `suppression_rules.scope`

Read-Only:

- `expression` (String) Expression of the suppression rule.
- `variables` (Attributes List) Variables of the suppression rule. (see [below for nested schema](#nestedatt--suppression_rules--scope--variables))

<a id="nestedatt--suppression_rules--scope--variables"></a>
### Nested Schema for `suppression_rules.scope.variables`

Read-Only:

- `attribute` (String) Attribute of the variable.
- `name` (String) Name of the variable.
- `value` (String) Value of the variable.


78 changes: 78 additions & 0 deletions docs/resources/suppression_rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "aquasec_suppression_rule Resource - terraform-provider-aquasec"
subcategory: ""
description: |-
Manages a suppression rule.
---

# aquasec_suppression_rule (Resource)

Manages a suppression rule.

## Example Usage

```terraform
# Manage example suppression rule
resource "aquasec_suppression_rule" "example" {
name = "Example Suppression Rule"
application_scopes = ["Global"]
score = []
fix_available = false
comment = "This is an example suppression rule"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `application_scopes` (List of String) List of application scopes for the suppression rule.
- `comment` (String) Comment for the suppression rule.
- `name` (String) Name of the suppression rule.

### Optional

- `expiry` (Number) Expiry in days of the suppression rule.
- `fix_available` (String) Fix available for the suppression rule.
- `scope` (Attributes) Scope of the suppression rule. (see [below for nested schema](#nestedatt--scope))
- `score` (List of Number) List of scores for the suppression rule.
- `severity` (String) Severity of the suppression rule.
- `status` (Boolean) Activation status of the suppression rule.
- `vulnerabilities` (String) Vulnerabilities for the suppression rule.

### Read-Only

- `author` (String) Author of the suppression rule.
- `created` (String) Creation date of the suppression rule.
- `id` (String) Numeric identifier of the suppression rule.

<a id="nestedatt--scope"></a>
### Nested Schema for `scope`

Optional:

- `expression` (String) Expression of the suppression rule.
- `variables` (Attributes List) (see [below for nested schema](#nestedatt--scope--variables))

<a id="nestedatt--scope--variables"></a>
### Nested Schema for `scope.variables`

Required:

- `attribute` (String) Attribute of the variable.
- `value` (String) Value of the variable.

Optional:

- `name` (String) Name of the variable.

## Import

Import is supported using the following syntax:

```shell
# Suppression rule can be imported by specifying the numeric identifier.
terraform import aquasec_suppression_rule.example 123
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# List all suppression rules.
data "aquasec_suppression_rules" "suppression_rules" {}

output "suppression_rules" {
value = { for rule in data.aquasec_suppression_rules.suppression_rules.suppression_rules : rule.id => rule.name }
}
2 changes: 2 additions & 0 deletions examples/resources/aquasec_suppression_rule/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Suppression rule can be imported by specifying the numeric identifier.
terraform import aquasec_suppression_rule.example 123
8 changes: 8 additions & 0 deletions examples/resources/aquasec_suppression_rule/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Manage example suppression rule
resource "aquasec_suppression_rule" "example" {
name = "Example Suppression Rule"
application_scopes = ["Global"]
score = []
fix_available = false
comment = "This is an example suppression rule"
}

0 comments on commit be3b92a

Please sign in to comment.