|
| 1 | +--- |
| 2 | +layout: "wallarm" |
| 3 | +page_title: "Wallarm: wallarm_allowlist" |
| 4 | +subcategory: "Common" |
| 5 | +description: |- |
| 6 | + Provides the resource to manage allowlist in the account. |
| 7 | +--- |
| 8 | + |
| 9 | +# wallarm_allowlist |
| 10 | + |
| 11 | +Provides the resource to manage [allowlist][1] in the account providing functionality to block all requests originated from allowlisted IP addresses for a desired time either via `RFC3339` or `Minutes` formats. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```hcl |
| 16 | +# Creates two new allowlist entries for the specific application |
| 17 | +# with the determined block time (60 minutes) and until the 2nd of January 2026 |
| 18 | +
|
| 19 | +resource "wallarm_allowlist" "allowlist_minutes" { |
| 20 | + ip_range = ["1.1.1.1/32"] |
| 21 | + application = [1] |
| 22 | + reason = "TEST ALLOWLIST MINUTES" |
| 23 | + time_format = "Minutes" |
| 24 | + time = 60 |
| 25 | +} |
| 26 | +
|
| 27 | +resource "wallarm_allowlist" "allowlist_date" { |
| 28 | + ip_range = ["2.2.2.2/32"] |
| 29 | + application = [1] |
| 30 | + reason = "TEST ALLOWLIST DATE" |
| 31 | + time_format = "RFC3339" |
| 32 | + time = "2026-01-02T15:04:05+07:00" |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Argument Reference |
| 37 | + |
| 38 | +* `ip_range` - (**required**) IP range to be blocked. Can be defined as an array of ranges. Accept: |
| 39 | + - distinct IP addresses (e.g. `1.1.1.1`, `2.2.2.2`) |
| 40 | + - subnets (e.g. `1.1.1.1/24`, `2.2.2.2/30`) |
| 41 | +* `time_format` - (**required**) block time format. |
| 42 | + Can be: |
| 43 | + - `Minutes` - Time in minutes (e.g. `60` is to block for 60 minutes) |
| 44 | + - `RFC3339` - RFC3339 time (e.g. `2021-06-01T15:04:05+07:00`) |
| 45 | +* `time` - (**required**) time for (or until) which the IP address should be blocked. |
| 46 | +* `application` - (optional) list of application IDs. |
| 47 | + Default: all applications. |
| 48 | +* `reason` - (optional) arbitrary reason for blocking these IP addresses. |
| 49 | +* `client_id` - (optional) ID of the client (tenant). The value is required for [multi-tenant scenarios][2]. |
| 50 | + |
| 51 | +## Attributes Reference |
| 52 | + |
| 53 | +`address_id` - ID of the address, composed of the following parts: |
| 54 | + |
| 55 | +- `ip_addr` - discrete IP address. |
| 56 | +- `ip_id` - ID of the entry with the certain IP address. |
| 57 | + |
| 58 | +[1]: https://docs.wallarm.com/user-guides/ip-lists/allowlist/ |
| 59 | +[2]: https://docs.wallarm.com/installation/multi-tenant/overview/ |
0 commit comments