-
Notifications
You must be signed in to change notification settings - Fork 49
feat: Adding Route Aggregation Policy Resource and Data Source #850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
srushti-patl
merged 11 commits into
main
from
CXF-106515-Route-Aggregation-Policy-Resource-DataSource
Feb 25, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d47d1a5
feat: Adding Route Aggregation Policy Resource and Data Source
srushti-patl b1edf8d
fix: adding route aggregation model file
srushti-patl d7cc83c
fix: Fixing lint errors
srushti-patl c248a7e
fix: Updating datasource test file
srushti-patl fde74f1
fix: Updating datasource test file
srushti-patl 83c7a56
Merge branch 'main' into CXF-106515-Route-Aggregation-Policy-Resource…
srushti-patl 292bce6
fix: Adding patch for Route Aggregation and Route Aggregation Patch R…
srushti-patl 4fd4942
fix: Updating PR comments and Resolving merge conflicts
srushti-patl 73faeda
fix: resolving merge conflicts
srushti-patl a38363c
fix: Fixing lint erros
srushti-patl 4de8b90
fix: Updating PR comments
srushti-patl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,95 @@ | ||
| --- | ||
| subcategory: "Fabric" | ||
| --- | ||
|
|
||
| # equinix_fabric_route_aggregation (Data Source) | ||
|
|
||
| Fabric V4 API compatible data resource that allow user to fetch Equinix Fabric Route Aggregation by UUID | ||
| Additional Documentation: | ||
| * API: https://developer.equinix.com/catalog/fabricv4#tag/Route-Aggregations | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| data "equinix_fabric_route_aggregation" "ra_policy" { | ||
| uuid = "<uuid_of_route_aggregation>" | ||
| } | ||
|
|
||
| output "id" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.id | ||
| } | ||
|
|
||
| output "type" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.type | ||
| } | ||
|
|
||
| output "state" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.state | ||
| } | ||
|
|
||
| output "connections_count" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.connections_count | ||
| } | ||
|
|
||
| output "rules_count" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.rules_count | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `route_aggregation_id` (String) The uuid of the route aggregation this data source should retrieve | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `change` (Attributes) Current state of latest Route Aggregation change (see [below for nested schema](#nestedatt--change)) | ||
| - `change_log` (Attributes) Details of the last change on the route aggregation resource (see [below for nested schema](#nestedatt--change_log)) | ||
| - `connections_count` (Number) Number of Connections attached to route aggregation | ||
| - `description` (String) Customer-provided route aggregation description | ||
| - `href` (String) Equinix auto generated URI to the route aggregation resource | ||
| - `id` (String) The unique identifier of the resource | ||
| - `name` (String) Customer provided name of the route aggregation | ||
| - `project` (Attributes) Equinix Project attribute object (see [below for nested schema](#nestedatt--project)) | ||
| - `rules_count` (Number) Number of Rules attached to route aggregation | ||
| - `state` (String) Value representing provisioning status for the route aggregation resource | ||
| - `type` (String) Equinix defined Route Aggregation Type; BGP_IPv4_PREFIX_AGGREGATION, BGP_IPv6_PREFIX_AGGREGATION | ||
| - `uuid` (String) Equinix-assigned unique id for the route aggregation resource | ||
|
|
||
| <a id="nestedatt--change"></a> | ||
| ### Nested Schema for `change` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `href` (String) Equinix auto generated URI to the route aggregation change | ||
| - `type` (String) Equinix defined Route Aggregation Change Type | ||
| - `uuid` (String) Equinix-assigned unique id for a change | ||
|
|
||
|
|
||
| <a id="nestedatt--change_log"></a> | ||
| ### Nested Schema for `change_log` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `created_by` (String) User name of creator of the route aggregation resource | ||
| - `created_by_email` (String) Email of creator of the route aggregation resource | ||
| - `created_by_full_name` (String) Legal name of creator of the route aggregation resource | ||
| - `created_date_time` (String) Creation time of the route aggregation resource | ||
| - `deleted_by` (String) User name of deleter of the route aggregation resource | ||
| - `deleted_by_email` (String) Email of deleter of the route aggregation resource | ||
| - `deleted_by_full_name` (String) Legal name of deleter of the route aggregation resource | ||
| - `deleted_date_time` (String) Deletion time of the route aggregation resource | ||
| - `updated_by` (String) User name of last updater of the route aggregation resource | ||
| - `updated_by_email` (String) Email of last updater of the route aggregation resource | ||
| - `updated_by_full_name` (String) Legal name of last updater of the route aggregation resource | ||
| - `updated_date_time` (String) Last update time of the route aggregation resource | ||
|
|
||
|
|
||
| <a id="nestedatt--project"></a> | ||
| ### Nested Schema for `project` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `project_id` (String) Equinix Subscriber-assigned project ID |
This file contains hidden or 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,146 @@ | ||
| --- | ||
| subcategory: "Fabric" | ||
| --- | ||
|
|
||
| # equinix_fabric_route_aggregations (Data Source) | ||
|
|
||
| Fabric V4 API compatible data resource that allow user to fetch Equinix Fabric Route Aggregations with pagination details | ||
| Additional Documentation: | ||
| * Getting Started: https://docs.equinix.com/en-us/Content/KnowledgeCenter/Fabric/GettingStarted/Integrating-with-Fabric-V4-APIs/IntegrateWithSink.htm | ||
| * API: https://developer.equinix.com/catalog/fabricv4#tag/Streams | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| data "equinix_fabric_route_aggregations" "ra_policy" { | ||
| filter = { | ||
| property = "/project/projectId" | ||
| operator = "=" | ||
| values = ["<route_aggregation_project_id>"] | ||
| } | ||
| pagination = { | ||
| limit = 2 | ||
| offset = 1 | ||
| } | ||
| } | ||
|
|
||
| output "first_route_aggregation_name" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.name | ||
| } | ||
|
|
||
| output "first_route_aggregation_description" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.description | ||
| } | ||
|
|
||
| output "first_route_aggregation_connections_count" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.connections_count | ||
| } | ||
|
|
||
| output "first_route_aggregation_rules_count" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.rules_count | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `filter` (Attributes) Filters for the Data Source Search Request (see [below for nested schema](#nestedatt--filter)) | ||
|
|
||
| ### Optional | ||
|
|
||
| - `pagination` (Attributes) Pagination details for the returned route aggregations list (see [below for nested schema](#nestedatt--pagination)) | ||
| - `sort` (Attributes) Filters for the Data Source Search Request (see [below for nested schema](#nestedatt--sort)) | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `data` (Attributes List) Returned list of route aggregation objects (see [below for nested schema](#nestedatt--data)) | ||
| - `id` (String) The unique identifier of the resource | ||
|
|
||
| <a id="nestedatt--filter"></a> | ||
| ### Nested Schema for `filter` | ||
|
|
||
| Required: | ||
|
|
||
| - `operator` (String) Operators to use on your filtered field with the values given. One of [ =, !=, >, >=, <, <=, BETWEEN, NOT BETWEEN, LIKE, NOT LIKE, IN, NOT IN, IS NOT NULL, IS NULL] | ||
| - `property` (String) possible field names to use on filters. One of [/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="nestedatt--pagination"></a> | ||
| ### Nested Schema for `pagination` | ||
|
|
||
| Optional: | ||
|
|
||
| - `limit` (Number) Maximum number of search results returned per page. Number must be between 1 and 100, and the default is 20 | ||
| - `offset` (Number) Index of the first item returned in the response. The default is 0 | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `next` (String) The URL relative to the next item in the response | ||
| - `previous` (String) The URL relative to the previous item in the response | ||
| - `total` (Number) The total number of route aggregations available to the user making the request | ||
|
|
||
|
|
||
| <a id="nestedatt--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. One of [/type /name /project/projectId /uuid /state] Defaults to /name | ||
|
|
||
|
|
||
| <a id="nestedatt--data"></a> | ||
| ### Nested Schema for `data` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `change` (Attributes) Current state of latest Route Aggregation change (see [below for nested schema](#nestedatt--data--change)) | ||
| - `change_log` (Attributes) Details of the last change on the route aggregation resource (see [below for nested schema](#nestedatt--data--change_log)) | ||
| - `connections_count` (Number) Number of Connections attached to route aggregation | ||
| - `description` (String) Customer-provided route aggregation description | ||
| - `href` (String) Equinix auto generated URI to the route aggregation resource | ||
| - `name` (String) Customer provided name of the route aggregation | ||
| - `project` (Attributes) Equinix Project attribute object (see [below for nested schema](#nestedatt--data--project)) | ||
| - `rules_count` (Number) Number of Rules attached to route aggregation | ||
| - `state` (String) Value representing provisioning status for the route aggregation resource | ||
| - `type` (String) Equinix defined Route Aggregation Type; BGP_IPv4_PREFIX_AGGREGATION, BGP_IPv6_PREFIX_AGGREGATION | ||
| - `uuid` (String) Equinix-assigned unique id for the route aggregation resource | ||
|
|
||
| <a id="nestedatt--data--change"></a> | ||
| ### Nested Schema for `data.change` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `href` (String) Equinix auto generated URI to the route aggregation change | ||
| - `type` (String) Equinix defined Route Aggregation Change Type | ||
| - `uuid` (String) Equinix-assigned unique id for a change | ||
|
|
||
|
|
||
| <a id="nestedatt--data--change_log"></a> | ||
| ### Nested Schema for `data.change_log` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `created_by` (String) User name of creator of the route aggregation resource | ||
| - `created_by_email` (String) Email of creator of the route aggregation resource | ||
| - `created_by_full_name` (String) Legal name of creator of the route aggregation resource | ||
| - `created_date_time` (String) Creation time of the route aggregation resource | ||
| - `deleted_by` (String) User name of deleter of the route aggregation resource | ||
| - `deleted_by_email` (String) Email of deleter of the route aggregation resource | ||
| - `deleted_by_full_name` (String) Legal name of deleter of the route aggregation resource | ||
| - `deleted_date_time` (String) Deletion time of the route aggregation resource | ||
| - `updated_by` (String) User name of last updater of the route aggregation resource | ||
| - `updated_by_email` (String) Email of last updater of the route aggregation resource | ||
| - `updated_by_full_name` (String) Legal name of last updater of the route aggregation resource | ||
| - `updated_date_time` (String) Last update time of the route aggregation resource | ||
|
|
||
|
|
||
| <a id="nestedatt--data--project"></a> | ||
| ### Nested Schema for `data.project` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `project_id` (String) Equinix Subscriber-assigned project ID |
This file contains hidden or 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,95 @@ | ||
| --- | ||
| subcategory: "Fabric" | ||
| --- | ||
|
|
||
| # equinix_fabric_route_aggregation (Resource) | ||
|
|
||
| Fabric V4 API compatible resource allows creation and management of Equinix Fabric Route Aggregation | ||
|
|
||
| Additional Documentation: | ||
| * API: https://developer.equinix.com/catalog/fabricv4#tag/Route-Aggregations | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| resource "equinix_fabric_route_aggregation" "new-ra" { | ||
| type = "BGP_IPv4_PREFIX_AGGREGATION" | ||
| name = "new-ra" | ||
| description = "Test aggregation" | ||
| project = { | ||
| project_id = "776847000642406" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `name` (String) Customer provided name of the route aggregation | ||
| - `project` (Attributes) Equinix Project attribute object (see [below for nested schema](#nestedatt--project)) | ||
| - `type` (String) Equinix defined Route Aggregation Type; BGP_IPv4_PREFIX_AGGREGATION, BGP_IPv6_PREFIX_AGGREGATION | ||
|
|
||
| ### Optional | ||
|
|
||
| - `description` (String) Customer-provided route aggregation description | ||
| - `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts)) | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `change` (Attributes) Current state of latest Route Aggregation change (see [below for nested schema](#nestedatt--change)) | ||
| - `change_log` (Attributes) Details of the last change on the route aggregation resource (see [below for nested schema](#nestedatt--change_log)) | ||
| - `connections_count` (Number) Number of Connections attached to route aggregation | ||
| - `href` (String) Equinix auto generated URI to the route aggregation resource | ||
| - `id` (String) The unique identifier of the resource | ||
| - `rules_count` (Number) Number of Rules attached to route aggregation | ||
| - `state` (String) Value representing provisioning status for the route aggregation resource | ||
| - `uuid` (String) Equinix-assigned unique id for the route aggregation resource | ||
|
|
||
| <a id="nestedatt--project"></a> | ||
| ### Nested Schema for `project` | ||
|
|
||
| Required: | ||
|
|
||
| - `project_id` (String) Equinix Subscriber-assigned project ID | ||
|
|
||
|
|
||
| <a id="nestedatt--timeouts"></a> | ||
| ### Nested Schema for `timeouts` | ||
|
|
||
| Optional: | ||
|
|
||
| - `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). | ||
| - `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. | ||
| - `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. | ||
| - `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). | ||
|
|
||
|
|
||
| <a id="nestedatt--change"></a> | ||
| ### Nested Schema for `change` | ||
|
|
||
| Required: | ||
|
|
||
| - `href` (String) Equinix auto generated URI to the route aggregation change | ||
| - `type` (String) Equinix defined Route Aggregation Change Type | ||
| - `uuid` (String) Equinix-assigned unique id for a change | ||
|
|
||
|
|
||
| <a id="nestedatt--change_log"></a> | ||
| ### Nested Schema for `change_log` | ||
|
|
||
| Read-Only: | ||
|
|
||
| - `created_by` (String) User name of creator of the route aggregation resource | ||
| - `created_by_email` (String) Email of creator of the route aggregation resource | ||
| - `created_by_full_name` (String) Legal name of creator of the route aggregation resource | ||
| - `created_date_time` (String) Creation time of the route aggregation resource | ||
| - `deleted_by` (String) User name of deleter of the route aggregation resource | ||
| - `deleted_by_email` (String) Email of deleter of the route aggregation resource | ||
| - `deleted_by_full_name` (String) Legal name of deleter of the route aggregation resource | ||
| - `deleted_date_time` (String) Deletion time of the route aggregation resource | ||
| - `updated_by` (String) User name of last updater of the route aggregation resource | ||
| - `updated_by_email` (String) Email of last updater of the route aggregation resource | ||
| - `updated_by_full_name` (String) Legal name of last updater of the route aggregation resource | ||
| - `updated_date_time` (String) Last update time of the route aggregation resource | ||
23 changes: 23 additions & 0 deletions
23
examples/data-sources/equinix_fabric_route_aggregation/data-source.tf
This file contains hidden or 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_fabric_route_aggregation" "ra_policy" { | ||
| uuid = "<uuid_of_route_aggregation>" | ||
| } | ||
|
|
||
| output "id" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.id | ||
| } | ||
|
|
||
| output "type" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.type | ||
| } | ||
|
|
||
| output "state" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.state | ||
| } | ||
|
|
||
| output "connections_count" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.connections_count | ||
| } | ||
|
|
||
| output "rules_count" { | ||
| value = data.equinix_fabric_route_aggregation.ra_policy.rules_count | ||
| } |
27 changes: 27 additions & 0 deletions
27
examples/data-sources/equinix_fabric_route_aggregations/data-source.tf
This file contains hidden or 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,27 @@ | ||
| data "equinix_fabric_route_aggregations" "ra_policy" { | ||
| filter = { | ||
| property = "/project/projectId" | ||
| operator = "=" | ||
| values = ["<route_aggregation_project_id>"] | ||
| } | ||
| pagination = { | ||
| limit = 2 | ||
| offset = 1 | ||
| } | ||
| } | ||
|
|
||
| output "first_route_aggregation_name" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.name | ||
| } | ||
|
|
||
| output "first_route_aggregation_description" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.description | ||
| } | ||
|
|
||
| output "first_route_aggregation_connections_count" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.connections_count | ||
| } | ||
|
|
||
| output "first_route_aggregation_rules_count" { | ||
| value = data.equinix_fabric_route_aggregations.ra_policy.data.0.rules_count | ||
| } |
8 changes: 8 additions & 0 deletions
8
examples/resources/equinix_fabric_route_aggregation/resource.tf
This file contains hidden or 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,8 @@ | ||
| resource "equinix_fabric_route_aggregation" "new-ra" { | ||
| type = "BGP_IPv4_PREFIX_AGGREGATION" | ||
| name = "new-ra" | ||
| description = "Test aggregation" | ||
| project = { | ||
| project_id = "776847000642406" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the description in the resource schema that would appear as the header in this doc.