|
| 1 | +--- |
| 2 | +subcategory: "Edge Services" |
| 3 | +page_title: "Scaleway: scaleway_edge_services_route_stage" |
| 4 | +--- |
| 5 | + |
| 6 | +# Resource: scaleway_edge_services_route_stage |
| 7 | + |
| 8 | +Creates and manages Scaleway Edge Services Route Stages. |
| 9 | + |
| 10 | +## Example Usage |
| 11 | + |
| 12 | +### Basic |
| 13 | + |
| 14 | +```terraform |
| 15 | +resource "scaleway_edge_services_route_stage" "main" { |
| 16 | + pipeline_id = scaleway_edge_services_pipeline.main.id |
| 17 | + waf_stage_id = scaleway_edge_services_waf_stage.waf.id |
| 18 | + after_position = 0 |
| 19 | +
|
| 20 | + rules { |
| 21 | + backend_stage_id = scaleway_edge_services_backend_stage.backend.id |
| 22 | +
|
| 23 | + rule_http_match { |
| 24 | + method_filters = ["get", "post"] |
| 25 | +
|
| 26 | + path_filter { |
| 27 | + path_filter_type = "regex" |
| 28 | + value = ".*" |
| 29 | + } |
| 30 | + } |
| 31 | + } |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +## Argument Reference |
| 36 | + |
| 37 | +- `pipeline_id` - (Required) The ID of the pipeline. |
| 38 | +- `after_position` - (Optional) Add rules after the given position. Only one of `after_position` and `before_position` should be specified. |
| 39 | +- `before_position` - (Optional) Add rules before the given position. Only one of `after_position` and `before_position` should be specified. |
| 40 | +- `waf_stage_id` - (Optional) The ID of the WAF stage HTTP requests should be forwarded to when no rules are matched. |
| 41 | +- `rules` - (Optional) The list of rules to be checked against every HTTP request. The first matching rule will forward the request to its specified backend stage. If no rules are matched, the request is forwarded to the WAF stage defined by `waf_stage_id`. |
| 42 | + - `backend_stage_id` (Required) The ID of the backend stage that requests matching the rule should be forwarded to. |
| 43 | + - `rule_http_match` (Optional) The rule condition to be matched. Requests matching the condition defined here will be directly forwarded to the backend specified by the `backend_stage_id` field. Requests that do not match will be checked by the next rule's condition. |
| 44 | + - `method_filters` (Optional) HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided. |
| 45 | + - `path_filter` (Optional) HTTP URL path to filter for. A request whose path matches the given filter will be considered to match the rule. All paths will match if none is provided. |
| 46 | + - `path_filter_type` (Required) The type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type. |
| 47 | + - `value` (Required) The value to be matched for the HTTP URL path. |
| 48 | +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the route stage is associated with. |
| 49 | + |
| 50 | +## Attributes Reference |
| 51 | + |
| 52 | +In addition to all arguments above, the following attributes are exported: |
| 53 | + |
| 54 | +- `id` - The ID of the route stage (UUID format). |
| 55 | +- `created_at` - The date and time of the creation of the route stage. |
| 56 | +- `updated_at` - The date and time of the last update of the route stage. |
| 57 | + |
| 58 | +## Import |
| 59 | + |
| 60 | +Route stages can be imported using the `{id}`, e.g. |
| 61 | + |
| 62 | +```bash |
| 63 | +$ terraform import scaleway_edge_services_route_stage.basic 11111111-1111-1111-1111-111111111111 |
| 64 | +``` |
0 commit comments