|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "inext_rate_limit_practice Resource - terraform-provider-infinity-next" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Rate limit Practice |
| 7 | +--- |
| 8 | + |
| 9 | +# inext_rate_limit_practice (Resource) |
| 10 | + |
| 11 | +Rate limit Practice |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +terraform { |
| 17 | + required_providers { |
| 18 | + inext = { |
| 19 | + source = "CheckPointSW/infinity-next" |
| 20 | + version = "~>1.2.0" |
| 21 | + } |
| 22 | + } |
| 23 | +} |
| 24 | +
|
| 25 | +provider "inext" { |
| 26 | + region = "eu" |
| 27 | + # client_id = "" // can be set with env var INEXT_CLIENT_ID |
| 28 | + # access_key = "" // can be set with env var INEXT_ACCESS_KEY |
| 29 | +} |
| 30 | +
|
| 31 | +resource "inext_rate_limit_practice" "my_rate_limit_practice" { |
| 32 | + name = "my rate limit practice" |
| 33 | + visibility = "Shared" # Optional: "Shared" (default) or "Local" |
| 34 | +
|
| 35 | + # Multiple rate limit rules |
| 36 | + rule { |
| 37 | + uri = "/api/v1/users" |
| 38 | + scope = "Minute" # Required: "Minute" or "Second" |
| 39 | + limit = 100 # Required: number of requests allowed |
| 40 | + action = "Detect" # Optional: "Detect", "Prevent", or "AccordingToPractice" (default) |
| 41 | + comment = "User API rate limit" # Optional: description of the rule |
| 42 | + } |
| 43 | +
|
| 44 | + rule { |
| 45 | + uri = "/api/v1/login" |
| 46 | + scope = "Second" |
| 47 | + limit = 5 |
| 48 | + action = "Prevent" |
| 49 | + comment = "Login endpoint strict rate limit" |
| 50 | + } |
| 51 | +
|
| 52 | + rule { |
| 53 | + uri = "/api/v1/search" |
| 54 | + scope = "Minute" |
| 55 | + limit = 200 |
| 56 | + action = "AccordingToPractice" |
| 57 | + comment = "Search API with higher limit" |
| 58 | + } |
| 59 | +} |
| 60 | +
|
| 61 | +# Example with minimal configuration (only required fields) |
| 62 | +resource "inext_rate_limit_practice" "minimal_example" { |
| 63 | + name = "minimal rate limit practice" |
| 64 | +
|
| 65 | + rule { |
| 66 | + uri = "/api/minimal" |
| 67 | + scope = "Minute" |
| 68 | + limit = 50 |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +<!-- schema generated by tfplugindocs --> |
| 74 | +## Schema |
| 75 | + |
| 76 | +### Required |
| 77 | + |
| 78 | +- `name` (String) The name of the resource, also acts as its unique ID |
| 79 | + |
| 80 | +### Optional |
| 81 | + |
| 82 | +- `rule` (Block Set) Rate limit rules (see [below for nested schema](#nestedblock--rule)) |
| 83 | +- `visibility` (String) The visibility of the resource, Shared or Local |
| 84 | + |
| 85 | +### Read-Only |
| 86 | + |
| 87 | +- `category` (String) |
| 88 | +- `default` (Boolean) |
| 89 | +- `id` (String) The ID of this resource. |
| 90 | +- `practice_type` (String) |
| 91 | + |
| 92 | +<a id="nestedblock--rule"></a> |
| 93 | +### Nested Schema for `rule` |
| 94 | + |
| 95 | +Required: |
| 96 | + |
| 97 | +- `limit` (Number) The actual number of requests to enable |
| 98 | +- `scope` (String) The time unit during which the rate limit is enfrorced. Must be one of: Minute, Second |
| 99 | +- `uri` (String) |
| 100 | + |
| 101 | +Optional: |
| 102 | + |
| 103 | +- `action` (String) The action to perform upon a request which crosses the rate limit. Must be one of: Detect, Prevent, AccordingToPractice (case sensitive!!). Defaults to AccordingToPractice |
| 104 | +- `comment` (String) A general comment which describes the rate limit rule |
| 105 | + |
| 106 | +Read-Only: |
| 107 | + |
| 108 | +- `id` (String) The ID of this resource. |
| 109 | + |
| 110 | + |
0 commit comments