-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fabric resource connection_route_filter (#795)
* Add equinix_fabric_connection_route_filter resource to attach route filter policies to fabric cloud router connections * Add data source for retrieving connection_route_filters by connection and route filter uuids * Add data source to get all route filters for a given connection uuid * Add docs with make docs * Add acceptance tests for resource and data sources Local tests passing: <img width="1278" alt="image" src="https://github.com/user-attachments/assets/bbf2f520-5219-440a-944c-59aaf7b24278">
- Loading branch information
Showing
14 changed files
with
990 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
subcategory: "Fabric" | ||
--- | ||
|
||
# equinix_fabric_connection_route_filter (Data Source) | ||
|
||
Fabric V4 API compatible data resource that allow user to fetch route filter policy attachment to a fabric connection | ||
|
||
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-filter-rules | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "equinix_fabric_connection_route_filter" "attached_policy" { | ||
connection_id = "<connection_uuid>" | ||
route_filter_id = "<route_filter_uuid>" | ||
} | ||
output "connection_route_filter_id" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.id | ||
} | ||
output "connection_route_filter_connection_id" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.connection_id | ||
} | ||
output "connection_route_filter_direction" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.direction | ||
} | ||
output "connection_route_filter_type" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.type | ||
} | ||
output "connection_route_filter_attachment_status" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.attachment_status | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `connection_id` (String) Equinix Assigned UUID of the Equinix Connection to attach the Route Filter Policy to | ||
- `route_filter_id` (String) Equinix Assigned UUID of the Route Filter Policy to attach to the Equinix Connection | ||
|
||
### Read-Only | ||
|
||
- `attachment_status` (String) Status of the Route Filter Policy attachment lifecycle | ||
- `direction` (String) Direction of the filtering of the attached Route Filter Policy | ||
- `href` (String) URI to the attached Route Filter Policy on the Connection | ||
- `id` (String) The ID of this resource. | ||
- `type` (String) Route Filter Type. One of [ "BGP_IPv4_PREFIX_FILTER", "BGP_IPv6_PREFIX_FILTER" ] | ||
- `uuid` (String) Equinix Assigned ID for Route Filter Policy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
subcategory: "Fabric" | ||
--- | ||
|
||
# equinix_fabric_connection_route_filters (Data Source) | ||
|
||
Fabric V4 API compatible data resource that allow user to fetch all route filter policies attached to a fabric connection | ||
|
||
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-filter-rules | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "equinix_connection_route_filters" "attached_policies" { | ||
connection_id = "<connection_uuid>" | ||
} | ||
output "connection_first_route_filter_uuid" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.uuid | ||
} | ||
output "connection_first_route_filter_connection_id" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.connection_id | ||
} | ||
output "connection_first_route_filter_direction" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.direction | ||
} | ||
output "connection_first_route_filter_type" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.type | ||
} | ||
output "connection_first_route_filter_attachment_status" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.attachment_status | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `connection_id` (String) Equinix Assigned UUID of the Equinix Connection to attach the Route Filter Policy to | ||
|
||
### Read-Only | ||
|
||
- `data` (List of Object) The list of Rules attached to the given Route Filter Policy UUID (see [below for nested schema](#nestedatt--data)) | ||
- `id` (String) The ID of this resource. | ||
- `pagination` (Set of Object) Pagination details for the Data Source Search Request (see [below for nested schema](#nestedatt--pagination)) | ||
|
||
<a id="nestedatt--data"></a> | ||
### Nested Schema for `data` | ||
|
||
Read-Only: | ||
|
||
- `attachment_status` (String) | ||
- `direction` (String) | ||
- `href` (String) | ||
- `type` (String) | ||
- `uuid` (String) | ||
|
||
|
||
<a id="nestedatt--pagination"></a> | ||
### Nested Schema for `pagination` | ||
|
||
Read-Only: | ||
|
||
- `limit` (Number) | ||
- `next` (String) | ||
- `offset` (Number) | ||
- `previous` (String) | ||
- `total` (Number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
subcategory: "Fabric" | ||
--- | ||
|
||
# equinix_fabric_connection_route_filter (Resource) | ||
|
||
Fabric V4 API compatible resource allows attachment of Route Filter Polices to Fabric Connections | ||
|
||
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 | ||
resource "equinix_fabric_connection_route_filter" "policy_attachment" { | ||
connection_id = "<connection_uuid>" | ||
route_filter_id = "<route_filter_policy_uuid>" | ||
direction = "INBOUND" | ||
} | ||
output "connection_route_filter_id" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.id | ||
} | ||
output "connection_route_filter_connection_id" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.connection_id | ||
} | ||
output "connection_route_filter_direction" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.direction | ||
} | ||
output "connection_route_filter_type" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.type | ||
} | ||
output "connection_route_filter_attachment_status" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.attachment_status | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `connection_id` (String) Equinix Assigned UUID of the Equinix Connection to attach the Route Filter Policy to | ||
- `direction` (String) Direction of the filtering of the attached Route Filter Policy | ||
- `route_filter_id` (String) Equinix Assigned UUID of the Route Filter Policy to attach to the Equinix Connection | ||
|
||
### Optional | ||
|
||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) | ||
|
||
### Read-Only | ||
|
||
- `attachment_status` (String) Status of the Route Filter Policy attachment lifecycle | ||
- `href` (String) URI to the attached Route Filter Policy on the Connection | ||
- `id` (String) The ID of this resource. | ||
- `type` (String) Route Filter Type. One of [ "BGP_IPv4_PREFIX_FILTER", "BGP_IPv6_PREFIX_FILTER" ] | ||
- `uuid` (String) Equinix Assigned ID for Route Filter Policy | ||
|
||
<a id="nestedblock--timeouts"></a> | ||
### Nested Schema for `timeouts` | ||
|
||
Optional: | ||
|
||
- `create` (String) | ||
- `delete` (String) | ||
- `read` (String) | ||
- `update` (String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
examples/data-sources/equinix_fabric_connection_route_filter/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
data "equinix_fabric_connection_route_filter" "attached_policy" { | ||
connection_id = "<connection_uuid>" | ||
route_filter_id = "<route_filter_uuid>" | ||
} | ||
|
||
output "connection_route_filter_id" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.id | ||
} | ||
|
||
output "connection_route_filter_connection_id" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.connection_id | ||
} | ||
|
||
output "connection_route_filter_direction" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.direction | ||
} | ||
|
||
output "connection_route_filter_type" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.type | ||
} | ||
|
||
output "connection_route_filter_attachment_status" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policy.attachment_status | ||
} |
23 changes: 23 additions & 0 deletions
23
examples/data-sources/equinix_fabric_connection_route_filters/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
data "equinix_connection_route_filters" "attached_policies" { | ||
connection_id = "<connection_uuid>" | ||
} | ||
|
||
output "connection_first_route_filter_uuid" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.uuid | ||
} | ||
|
||
output "connection_first_route_filter_connection_id" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.connection_id | ||
} | ||
|
||
output "connection_first_route_filter_direction" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.direction | ||
} | ||
|
||
output "connection_first_route_filter_type" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.type | ||
} | ||
|
||
output "connection_first_route_filter_attachment_status" { | ||
value = data.equinix_fabric_connection_route_filter.attached_policies.0.attachment_status | ||
} |
25 changes: 25 additions & 0 deletions
25
examples/resources/equinix_fabric_connection_route_filter/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
resource "equinix_fabric_connection_route_filter" "policy_attachment" { | ||
connection_id = "<connection_uuid>" | ||
route_filter_id = "<route_filter_policy_uuid>" | ||
direction = "INBOUND" | ||
} | ||
|
||
output "connection_route_filter_id" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.id | ||
} | ||
|
||
output "connection_route_filter_connection_id" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.connection_id | ||
} | ||
|
||
output "connection_route_filter_direction" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.direction | ||
} | ||
|
||
output "connection_route_filter_type" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.type | ||
} | ||
|
||
output "connection_route_filter_attachment_status" { | ||
value = equinix_fabric_connection_route_filter.policy_attachment.attachment_status | ||
} |
Oops, something went wrong.