Skip to content

Commit

Permalink
Replace transit_peer_network resource with transit_network (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamroz authored Sep 13, 2024
1 parent 23b609c commit 9c9a2c1
Show file tree
Hide file tree
Showing 25 changed files with 458 additions and 463 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Add `catalystcenter_wireless_ssid` resource and data source
- Add `catalystcenter_site` data source
- Add `catalystcenter_fabric_port_assignment` resource and data source
- BREAKING CHANGE: Replace `catalystcenter_peer_transit_network` with `catalystcenter_transit_network` resource and data source to use `/dna/intent/api/v1/sda/transitNetworks` API endpoint, this resource now only works with Catalyst Center version 2.3.7.6+

## 0.1.10

Expand Down
35 changes: 35 additions & 0 deletions docs/data-sources/transit_network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_transit_network Data Source - terraform-provider-catalystcenter"
subcategory: "SDA"
description: |-
This data source can read the Transit Network.
---

# catalystcenter_transit_network (Data Source)

This data source can read the Transit Network.

## Example Usage

```terraform
data "catalystcenter_transit_network" "example" {
name = "TRANSIT_1"
}
```

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

### Required

- `name` (String) Transit Network Name

### Read-Only

- `autonomous_system_number` (String) Autonomous System Number
- `control_plane_network_device_ids` (Set of String) List of network device IDs that will be used as control plane nodes
- `id` (String) The id of the object
- `is_multicast_over_transit_enabled` (Boolean) Set this to true to enable multicast over SD-Access transit
- `routing_protocol_name` (String) Routing Protocol Name
- `type` (String) Transit Network Type
42 changes: 0 additions & 42 deletions docs/data-sources/transit_peer_network.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description: |-
- Add `catalystcenter_wireless_ssid` resource and data source
- Add `catalystcenter_site` data source
- Add `catalystcenter_fabric_port_assignment` resource and data source
- BREAKING CHANGE: Replace `catalystcenter_peer_transit_network` with `catalystcenter_transit_network` resource and data source to use `/dna/intent/api/v1/sda/transitNetworks` API endpoint, this resource now only works with Catalyst Center version 2.3.7.6+

## 0.1.10

Expand Down
51 changes: 51 additions & 0 deletions docs/resources/transit_network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_transit_network Resource - terraform-provider-catalystcenter"
subcategory: "SDA"
description: |-
This resource can manage a Transit Network.
---

# catalystcenter_transit_network (Resource)

This resource can manage a Transit Network.

## Example Usage

```terraform
resource "catalystcenter_transit_network" "example" {
name = "TRANSIT_1"
type = "IP_BASED_TRANSIT"
routing_protocol_name = "BGP"
autonomous_system_number = "65010"
}
```

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

### Required

- `name` (String) Transit Network Name
- `type` (String) Transit Network Type
- Choices: `IP_BASED_TRANSIT`, `SDA_LISP_PUB_SUB_TRANSIT`, `SDA_LISP_BGP_TRANSIT`

### Optional

- `autonomous_system_number` (String) Autonomous System Number
- `control_plane_network_device_ids` (Set of String) List of network device IDs that will be used as control plane nodes
- `is_multicast_over_transit_enabled` (Boolean) Set this to true to enable multicast over SD-Access transit
- `routing_protocol_name` (String) Routing Protocol Name
- Choices: `BGP`

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import catalystcenter_transit_network.example "<name>"
```
58 changes: 0 additions & 58 deletions docs/resources/transit_peer_network.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "catalystcenter_transit_network" "example" {
name = "TRANSIT_1"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import catalystcenter_transit_network.example "<name>"
6 changes: 6 additions & 0 deletions examples/resources/catalystcenter_transit_network/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "catalystcenter_transit_network" "example" {
name = "TRANSIT_1"
type = "IP_BASED_TRANSIT"
routing_protocol_name = "BGP"
autonomous_system_number = "65010"
}

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions gen/definitions/fabric_l3_handoff_ip_transit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ attributes:
mandatory: true
description: ID of the transit network of the layer 3 handoff ip transit
example: d71c847b-e9c2-4f13-928c-223372b72b06
test_value: catalystcenter_transit_peer_network.test.id
test_value: catalystcenter_transit_network.test.id
- model_name: interfaceName
data_path: '0'
requires_replace: true
Expand Down Expand Up @@ -117,9 +117,9 @@ test_prerequisites: |
authentication_profile_name = "No Authentication"
depends_on = [catalystcenter_area.test]
}
resource "catalystcenter_transit_peer_network" "test" {
transit_peer_network_name = "TRANSIT_1"
transit_peer_network_type = "ip_transit"
resource "catalystcenter_transit_network" "test" {
name = "TRANSIT_1"
type = "IP_BASED_TRANSIT"
routing_protocol_name = "BGP"
autonomous_system_number = "65010"
}
58 changes: 58 additions & 0 deletions gen/definitions/transit_network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Transit Network
rest_endpoint: /dna/intent/api/v1/sda/transitNetworks
id_from_query_path: response.0
id_from_query_path_attribute: id
import_no_id: true
data_source_no_id: true
put_no_id: true
put_id_include_path: 0.id
skip_minimum_test: true
doc_category: SDA
attributes:
- model_name: name
type: String
data_path: "0"
response_data_path: response.0.name
query_param: true
mandatory: true
requires_replace: true
description: Transit Network Name
example: TRANSIT_1
- model_name: type
data_path: "0"
response_data_path: response.0.type
type: String
mandatory: true
description: Transit Network Type
enum_values: [IP_BASED_TRANSIT, SDA_LISP_PUB_SUB_TRANSIT, SDA_LISP_BGP_TRANSIT]
requires_replace: true
example: IP_BASED_TRANSIT
- model_name: routingProtocolName
data_path: "0.ipTransitSettings"
response_data_path: response.0.ipTransitSettings.routingProtocolName
type: String
requires_replace: true
description: Routing Protocol Name
enum_values: [BGP]
example: BGP
- model_name: autonomousSystemNumber
data_path: "0.ipTransitSettings"
response_data_path: response.0.ipTransitSettings.autonomousSystemNumber
type: String
requires_replace: true
description: Autonomous System Number
example: "65010"
- model_name: controlPlaneNetworkDeviceIds
data_path: "0.sdaTransitSettings"
response_data_path: response.0.sdaTransitSettings.controlPlaneNetworkDeviceIds
exclude_test: true
type: Set
element_type: String
description: List of network device IDs that will be used as control plane nodes
- model_name: isMulticastOverTransitEnabled
data_path: "0.sdaTransitSettings"
response_data_path: response.0.sdaTransitSettings.isMulticastOverTransitEnabled
exclude_test: true
type: Bool
description: Set this to true to enable multicast over SD-Access transit
56 changes: 0 additions & 56 deletions gen/definitions/transit_peer_network.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ resource "catalystcenter_fabric_site" "test" {
authentication_profile_name = "No Authentication"
depends_on = [catalystcenter_area.test]
}
resource "catalystcenter_transit_peer_network" "test" {
transit_peer_network_name = "TRANSIT_1"
transit_peer_network_type = "ip_transit"
resource "catalystcenter_transit_network" "test" {
name = "TRANSIT_1"
type = "IP_BASED_TRANSIT"
routing_protocol_name = "BGP"
autonomous_system_number = "65010"
}
Expand All @@ -81,7 +81,7 @@ func testAccDataSourceCcFabricL3HandoffIPTransitConfig() string {
config := `resource "catalystcenter_fabric_l3_handoff_ip_transit" "test" {` + "\n"
config += ` network_device_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"` + "\n"
config += ` fabric_id = catalystcenter_fabric_site.test.id` + "\n"
config += ` transit_network_id = catalystcenter_transit_peer_network.test.id` + "\n"
config += ` transit_network_id = catalystcenter_transit_network.test.id` + "\n"
config += ` interface_name = "TenGigabitEthernet1/0/2"` + "\n"
config += ` virtual_network_name = "SDA_VN1"` + "\n"
config += ` vlan_id = 205` + "\n"
Expand Down
Loading

0 comments on commit 9c9a2c1

Please sign in to comment.