Skip to content

Commit

Permalink
feat: Fabric route filter resource and data sources (#774)
Browse files Browse the repository at this point in the history
* Addition of:
   * data equinix_fabric_route_filter
   * data equinix_fabric_route_filters
   * equinix_fabric_route_filter
 * Includes testing and documentation
  • Loading branch information
thogarty authored Sep 26, 2024
1 parent e158a61 commit 0ceca3c
Show file tree
Hide file tree
Showing 16 changed files with 1,636 additions and 1 deletion.
102 changes: 102 additions & 0 deletions docs/data-sources/fabric_route_filter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
subcategory: "Fabric"
---

# equinix_fabric_route_filter (Data Source)

Fabric V4 API compatible data resource that allow user to fetch route filter for a given UUID

Additional Documentation:
* Getting Started: https://docs.equinix.com/en-us/Content/Interconnection/FCR/FCR-route-filters.htm
* API: https://developer.equinix.com/dev-docs/fabric/api-reference/fabric-v4-apis#route-filters

## Example Usage

```terraform
data "equinix_fabric_route_filter" "rf_policy" {
uuid = "<uuid_of_route_filter"
}
output "id" {
value = data.equinix_fabric_route_filter.rf_policy.id
}
output "type" {
value = data.equinix_fabric_route_filter.rf_policy.type
}
output "state" {
value = data.equinix_fabric_route_filter.rf_policy.state
}
output "not_matched_rules_action" {
value = data.equinix_fabric_route_filter.rf_policy.not_matched_rules_action
}
output "connections_count" {
value = data.equinix_fabric_route_filter.rf_policy.connections_count
}
output "rules_count" {
value = data.equinix_fabric_route_filter.rf_policy.rules_count
}
```

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

### Required

- `uuid` (String) Equinix Assigned ID for Route Filter

### Read-Only

- `change` (Set of Object) An object with the details of the previous change applied on the Route Filter (see [below for nested schema](#nestedatt--change))
- `change_log` (Set of Object) (see [below for nested schema](#nestedatt--change_log))
- `connections_count` (Number) The number of Fabric Connections that this Route Filter is attached to
- `description` (String) Optional description to add to the Route Filter you will be creating
- `href` (String) Route filter URI
- `id` (String) The ID of this resource.
- `name` (String) Name of the Route Filter
- `not_matched_rule_action` (String) The action that will be taken on ip ranges that don't match the rules present within the Route Filter
- `project` (Set of Object) The Project object that contains project_id and href that is related to the Fabric Project containing connections the Route Filter can be attached to (see [below for nested schema](#nestedatt--project))
- `rules_count` (Number) The number of Route Filter Rules attached to this Route Filter
- `state` (String) State of the Route Filter in its lifecycle
- `type` (String) Route Filter Type. One of [ "BGP_IPv4_PREFIX_FILTER", "BGP_IPv6_PREFIX_FILTER" ]

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

Read-Only:

- `href` (String)
- `type` (String)
- `uuid` (String)


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

Read-Only:

- `created_by` (String)
- `created_by_email` (String)
- `created_by_full_name` (String)
- `created_date_time` (String)
- `deleted_by` (String)
- `deleted_by_email` (String)
- `deleted_by_full_name` (String)
- `deleted_date_time` (String)
- `updated_by` (String)
- `updated_by_email` (String)
- `updated_by_full_name` (String)
- `updated_date_time` (String)


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

Read-Only:

- `href` (String)
- `project_id` (String)
172 changes: 172 additions & 0 deletions docs/data-sources/fabric_route_filters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
---
subcategory: "Fabric"
---

# equinix_fabric_route_filters (Data Source)

Fabric V4 API compatible data resource that allow user to fetch route filter for a given search data set

Additional Documentation:
* Getting Started: https://docs.equinix.com/en-us/Content/Interconnection/FCR/FCR-route-filters.htm
* API: https://developer.equinix.com/dev-docs/fabric/api-reference/fabric-v4-apis#route-filters

## Example Usage

```terraform
data "equinix_fabric_route_filters" "rf_policies" {
filter {
property = "/type"
operator = "="
values = ["BGP_IPv4_PREFIX_FILTER"]
}
filter {
property = "/state"
operator = "="
values = ["PROVISIONED"]
}
filter {
property = "/project/projectId"
operator = "="
values = ["<project_id>"]
}
pagination {
offset = 0
limit = 5
total = 25
}
sort {
direction = "ASC"
property = "/name"
}
}
output "first_rf_uuid" {
value = data.equinix_fabric_route_filters.rf_policies.data.0.uuid
}
output "type" {
value = data.equinix_fabric_route_filters.rf_policies.data.0.type
}
output "state" {
value = data.equinix_fabric_route_filters.rf_policies.data.0.state
}
output "not_matched_rule_action" {
value = data.equinix_fabric_route_filters.rf_policies.data.0.not_matched_rule_action
}
output "connections_count" {
value = data.equinix_fabric_route_filters.rf_policies.data.0.connections_count
}
output "rules_count" {
value = data.equinix_fabric_route_filters.rf_policies.data.0.rules_count
}
```

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

### Required

- `filter` (Block List, Min: 1, Max: 10) Filters for the Data Source Search Request. Maximum of 8 total filters. (see [below for nested schema](#nestedblock--filter))

### Optional

- `pagination` (Block Set, Max: 1) Pagination details for the Data Source Search Request (see [below for nested schema](#nestedblock--pagination))
- `sort` (Block List) Filters for the Data Source Search Request (see [below for nested schema](#nestedblock--sort))

### Read-Only

- `data` (List of Object) List of Route Filters (see [below for nested schema](#nestedatt--data))
- `id` (String) The ID of this resource.

<a id="nestedblock--filter"></a>
### Nested Schema for `filter`

Required:

- `operator` (String) Possible operators to use on the filter property. Can be one of the following: [ "=", "!=", "[NOT] LIKE", "[NOT] IN", "ILIKE" ]
- `property` (String) The API response property which you want to filter your request on. Can be one of the following: "/type", "/name", "/project/projectId", "/uuid", "/state"
- `values` (List of String) The values that you want to apply the property+operator combination to in order to filter your data search


<a id="nestedblock--pagination"></a>
### Nested Schema for `pagination`

Optional:

- `limit` (Number) Number of elements to be requested per page. Number must be between 1 and 100. Default is 20
- `offset` (Number) The page offset for the pagination request. Index of the first element. Default is 0.
- `total` (Number) Total number of elements returned.

Read-Only:

- `next` (String) URL relative to the last item in the response.
- `previous` (String) URL relative to the first item in the response.


<a id="nestedblock--sort"></a>
### Nested Schema for `sort`

Optional:

- `direction` (String) The sorting direction. Can be one of: [DESC, ASC], Defaults to DESC
- `property` (String) The property name to use in sorting. Can be one of the following: [/type, /uuid, /name, /project/projectId, /state, /notMatchedRuleAction, /connectionsCount, /changeLog/createdDateTime, /changeLog/updatedDateTime], Defaults to /changeLog/updatedDateTime


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

Read-Only:

- `change` (Set of Object) (see [below for nested schema](#nestedobjatt--data--change))
- `change_log` (Set of Object) (see [below for nested schema](#nestedobjatt--data--change_log))
- `connections_count` (Number)
- `description` (String)
- `href` (String)
- `name` (String)
- `not_matched_rule_action` (String)
- `project` (Set of Object) (see [below for nested schema](#nestedobjatt--data--project))
- `rules_count` (Number)
- `state` (String)
- `type` (String)
- `uuid` (String)

<a id="nestedobjatt--data--change"></a>
### Nested Schema for `data.change`

Read-Only:

- `href` (String)
- `type` (String)
- `uuid` (String)


<a id="nestedobjatt--data--change_log"></a>
### Nested Schema for `data.change_log`

Read-Only:

- `created_by` (String)
- `created_by_email` (String)
- `created_by_full_name` (String)
- `created_date_time` (String)
- `deleted_by` (String)
- `deleted_by_email` (String)
- `deleted_by_full_name` (String)
- `deleted_date_time` (String)
- `updated_by` (String)
- `updated_by_email` (String)
- `updated_by_full_name` (String)
- `updated_date_time` (String)


<a id="nestedobjatt--data--project"></a>
### Nested Schema for `data.project`

Read-Only:

- `href` (String)
- `project_id` (String)
Loading

0 comments on commit 0ceca3c

Please sign in to comment.