Skip to content

Anycast_Gateway #99

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
merged 6 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.1.10 (unreleased)

- Add `anycast_gateway` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+ `/sda/anycastGateways`
- BREAKING CHANGE: Modified `fabric_site` resource to use `/dna/intent/api/v1/sda/fabricSites` API endpoint, this resource now only works with Catalyst Center version 2.3.7.5+
- Fix issue with mandatory attributes in `transit_peer_network` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/92)
- BREAKING CHANGE: Fix `ip_pool` update if more than 25 pools are registered
Expand Down
48 changes: 48 additions & 0 deletions docs/data-sources/anycast_gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_anycast_gateway Data Source - terraform-provider-catalystcenter"
subcategory: "SDA"
description: |-
This data source can read the Anycast Gateway.
---

# catalystcenter_anycast_gateway (Data Source)

This data source can read the Anycast Gateway.

## Example Usage

```terraform
data "catalystcenter_anycast_gateway" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
virtual_network_name = "SDA_VN1"
ip_pool_name = "MyRes1"
}
```

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

### Required

- `fabric_id` (String) ID of the fabric to contain this anycast gateway
- `ip_pool_name` (String) Name of the IP pool associated with the anycast gateway
- `virtual_network_name` (String) Name of the layer 3 virtual network associated with the anycast gateway. the virtual network must have already been added to the site before creating an anycast gateway with it

### Read-Only

- `auto_generate_vlan_name` (Boolean) This field cannot be true when vlanName is provided. the vlanName will be generated as ipPoolGroupV4Cidr-virtualNetworkName for non-critical VLANs. for critical VLANs with DATA trafficType, vlanName will be CRITICAL_VLAN. for critical VLANs with VOICE trafficType, vlanName will be VOICE_VLAN
- `critical_pool` (Boolean) Enable/disable critical VLAN. if true, autoGenerateVlanName must also be true. (isCriticalPool is not applicable to INFRA_VN)
- `id` (String) The id of the object
- `intra_subnet_routing_enabled` (Boolean) Enable/disable Intra-Subnet Routing (not applicable to INFRA_VN)
- `ip_directed_broadcast` (Boolean) Enable/disable IP-directed broadcast (not applicable to INFRA_VN)
- `l2_flooding_enabled` (Boolean) Enable/disable layer 2 flooding (not applicable to INFRA_VN)
- `multiple_ip_to_mac_addresses` (Boolean) Enable/disable multiple IP-to-MAC Addresses (Wireless Bridged-Network Virtual Machine; not applicable to INFRA_VN)
- `pool_type` (String) The pool type of the anycast gateway (required for & applicable only to INFRA_VN)
- `security_group_name` (String) Name of the associated Security Group (not applicable to INFRA_VN)
- `supplicant_based_extended_node_onboarding` (Boolean) Enable/disable Supplicant-Based Extended Node Onboarding (applicable only to INFRA_VN)
- `tcp_mss_adjustment` (Number) TCP maximum segment size adjustment
- `traffic_type` (String) The type of traffic the anycast gateway serves
- `vlan_id` (Number) ID of the VLAN of the anycast gateway. allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, 2046, and 4094. if deploying an anycast gateway on a fabric zone, this vlanId must match the vlanId of the corresponding anycast gateway on the fabric site
- `vlan_name` (String) Name of the VLAN of the anycast gateway
- `wireless_pool` (Boolean) Enable/disable fabric-enabled wireless (not applicable to INFRA_VN)
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description: |-

## 0.1.10 (unreleased)

- Add `anycast_gateway` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+ `/sda/anycastGateways`
- BREAKING CHANGE: Modified `fabric_site` resource to use `/dna/intent/api/v1/sda/fabricSites` API endpoint, this resource now only works with Catalyst Center version 2.3.7.5+
- Fix issue with mandatory attributes in `transit_peer_network` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/92)
- BREAKING CHANGE: Fix `ip_pool` update if more than 25 pools are registered
Expand Down
72 changes: 72 additions & 0 deletions docs/resources/anycast_gateway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_anycast_gateway Resource - terraform-provider-catalystcenter"
subcategory: "SDA"
description: |-
Manages Anycast Gateways
---

# catalystcenter_anycast_gateway (Resource)

Manages Anycast Gateways

## Example Usage

```terraform
resource "catalystcenter_anycast_gateway" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
virtual_network_name = "SDA_VN1"
ip_pool_name = "MyRes1"
tcp_mss_adjustment = 1400
vlan_name = "VLAN401"
vlan_id = 401
traffic_type = "DATA"
critical_pool = false
l2_flooding_enabled = false
wireless_pool = false
ip_directed_broadcast = false
intra_subnet_routing_enabled = false
multiple_ip_to_mac_addresses = false
}
```

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

### Required

- `critical_pool` (Boolean) Enable/disable critical VLAN. if true, autoGenerateVlanName must also be true. (isCriticalPool is not applicable to INFRA_VN)
- `fabric_id` (String) ID of the fabric to contain this anycast gateway
- `intra_subnet_routing_enabled` (Boolean) Enable/disable Intra-Subnet Routing (not applicable to INFRA_VN)
- `ip_directed_broadcast` (Boolean) Enable/disable IP-directed broadcast (not applicable to INFRA_VN)
- `ip_pool_name` (String) Name of the IP pool associated with the anycast gateway
- `l2_flooding_enabled` (Boolean) Enable/disable layer 2 flooding (not applicable to INFRA_VN)
- `multiple_ip_to_mac_addresses` (Boolean) Enable/disable multiple IP-to-MAC Addresses (Wireless Bridged-Network Virtual Machine; not applicable to INFRA_VN)
- `traffic_type` (String) The type of traffic the anycast gateway serves
- Choices: `DATA`, `VOICE`
- `virtual_network_name` (String) Name of the layer 3 virtual network associated with the anycast gateway. the virtual network must have already been added to the site before creating an anycast gateway with it
- `vlan_name` (String) Name of the VLAN of the anycast gateway
- `wireless_pool` (Boolean) Enable/disable fabric-enabled wireless (not applicable to INFRA_VN)

### Optional

- `auto_generate_vlan_name` (Boolean) This field cannot be true when vlanName is provided. the vlanName will be generated as ipPoolGroupV4Cidr-virtualNetworkName for non-critical VLANs. for critical VLANs with DATA trafficType, vlanName will be CRITICAL_VLAN. for critical VLANs with VOICE trafficType, vlanName will be VOICE_VLAN
- `pool_type` (String) The pool type of the anycast gateway (required for & applicable only to INFRA_VN)
- Choices: `EXTENDED_NODE`, `FABRIC_AP`
- `security_group_name` (String) Name of the associated Security Group (not applicable to INFRA_VN)
- `supplicant_based_extended_node_onboarding` (Boolean) Enable/disable Supplicant-Based Extended Node Onboarding (applicable only to INFRA_VN)
- `tcp_mss_adjustment` (Number) TCP maximum segment size adjustment
- Range: `500`-`1440`
- `vlan_id` (Number) ID of the VLAN of the anycast gateway. allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, 2046, and 4094. if deploying an anycast gateway on a fabric zone, this vlanId must match the vlanId of the corresponding anycast gateway on the fabric site

### Read-Only

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

## Import

Import is supported using the following syntax:

```shell
terraform import catalystcenter_anycast_gateway.example "<fabric_id>,<virtual_network_name>,<ip_pool_name>"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data "catalystcenter_anycast_gateway" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
virtual_network_name = "SDA_VN1"
ip_pool_name = "MyRes1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import catalystcenter_anycast_gateway.example "<fabric_id>,<virtual_network_name>,<ip_pool_name>"
15 changes: 15 additions & 0 deletions examples/resources/catalystcenter_anycast_gateway/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "catalystcenter_anycast_gateway" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
virtual_network_name = "SDA_VN1"
ip_pool_name = "MyRes1"
tcp_mss_adjustment = 1400
vlan_name = "VLAN401"
vlan_id = 401
traffic_type = "DATA"
critical_pool = false
l2_flooding_enabled = false
wireless_pool = false
ip_directed_broadcast = false
intra_subnet_routing_enabled = false
multiple_ip_to_mac_addresses = false
}
186 changes: 186 additions & 0 deletions gen/definitions/anycast_gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
---
name: Anycast Gateway
rest_endpoint: /dna/intent/api/v1/sda/anycastGateways
res_description: Manages Anycast Gateways
id_from_query_path: response.0
id_from_query_path_attribute: id
import_no_id: true
data_source_no_id: true
put_id_include_path: "0.id"
put_no_id: true
max_async_wait_time: 120
doc_category: SDA
attributes:
- model_name: fabricId
requires_replace: true
data_path: '0'
query_param: true
response_data_path: response.0.fabricId
mandatory: true
description: ID of the fabric to contain this anycast gateway
type: String
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
test_value: catalystcenter_fabric_site.test.id
- model_name: virtualNetworkName
requires_replace: true
data_path: '0'
query_param: true
response_data_path: response.0.virtualNetworkName
type: String
mandatory: true
description: Name of the layer 3 virtual network associated with the anycast gateway. the virtual network must have already been added to the site before creating an anycast gateway with it
example: SDA_VN1
test_value: catalystcenter_virtual_network_to_fabric_site.test.virtual_network_name
- model_name: ipPoolName
requires_replace: true
query_param: true
data_path: '0'
response_data_path: response.0.ipPoolName
type: String
mandatory: true
description: Name of the IP pool associated with the anycast gateway
example: MyRes1
test_value: catalystcenter_ip_pool_reservation.test.name
- model_name: tcpMssAdjustment
data_path: '0'
response_data_path: response.0.tcpMssAdjustment
type: Int64
min_int: 500
max_int: 1440
description: TCP maximum segment size adjustment
example: 1400
- model_name: vlanName
requires_replace: true
data_path: '0'
response_data_path: response.0.vlanName
type: String
description: Name of the VLAN of the anycast gateway
mandatory: true
example: VLAN401
- model_name: vlanId
requires_replace: true
data_path: '0'
response_data_path: response.0.vlanId
type: Int64
description: ID of the VLAN of the anycast gateway. allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, 2046, and 4094. if deploying an anycast gateway on a fabric zone, this vlanId must match the vlanId of the corresponding anycast gateway on the fabric site
example: 401
- model_name: trafficType
data_path: '0'
response_data_path: response.0.trafficType
type: String
enum_values: [DATA, VOICE]
mandatory: true
description: The type of traffic the anycast gateway serves
example: DATA
- model_name: poolType
data_path: '0'
response_data_path: response.0.poolType
type: String
enum_values: [EXTENDED_NODE, FABRIC_AP]
description: The pool type of the anycast gateway (required for & applicable only to INFRA_VN)
exclude_test: true
- model_name: securityGroupName
data_path: '0'
response_data_path: response.0.securityGroupNames
type: String
description: Name of the associated Security Group (not applicable to INFRA_VN)
exclude_test: true
- model_name: isCriticalPool
requires_replace: true
data_path: '0'
response_data_path: response.0.isCriticalPool
tf_name: critical_pool
type: Bool
mandatory: true
description: Enable/disable critical VLAN. if true, autoGenerateVlanName must also be true. (isCriticalPool is not applicable to INFRA_VN)
example: false
- model_name: isLayer2FloodingEnabled
data_path: '0'
response_data_path: response.0.isLayer2FloodingEnabled
tf_name: l2_flooding_enabled
type: Bool
mandatory: true
description: Enable/disable layer 2 flooding (not applicable to INFRA_VN)
example: false
- model_name: isWirelessPool
data_path: '0'
response_data_path: response.0.isWirelessPool
tf_name: wireless_pool
type: Bool
mandatory: true
description: Enable/disable fabric-enabled wireless (not applicable to INFRA_VN)
example: false
- model_name: isIpDirectedBroadcast
data_path: '0'
response_data_path: response.0.isIpDirectedBroadcast
tf_name: ip_directed_broadcast
type: Bool
mandatory: true
description: Enable/disable IP-directed broadcast (not applicable to INFRA_VN)
example: false
- model_name: isIntraSubnetRoutingEnabled
requires_replace: true
data_path: '0'
response_data_path: response.0.isIntraSubnetRoutingEnabled
tf_name: intra_subnet_routing_enabled
type: Bool
mandatory: true
description: Enable/disable Intra-Subnet Routing (not applicable to INFRA_VN)
example: false
- model_name: isMultipleIpToMacAddresses
data_path: '0'
response_data_path: response.0.isMultipleIpToMacAddresses
tf_name: multiple_ip_to_mac_addresses
type: Bool
mandatory: true
description: Enable/disable multiple IP-to-MAC Addresses (Wireless Bridged-Network Virtual Machine; not applicable to INFRA_VN)
example: false
- model_name: isSupplicantBasedExtendedNodeOnboarding
data_path: '0'
response_data_path: response.0.isSupplicantBasedExtendedNodeOnboarding
tf_name: supplicant_based_extended_node_onboarding
type: Bool
description: Enable/disable Supplicant-Based Extended Node Onboarding (applicable only to INFRA_VN)
exclude_test: true
- model_name: autoGenerateVlanName
data_path: '0'
response_data_path: response.0.autoGenerateVlanName
type: Bool
description: 'This field cannot be true when vlanName is provided. the vlanName will be generated as ipPoolGroupV4Cidr-virtualNetworkName for non-critical VLANs. for critical VLANs with DATA trafficType, vlanName will be CRITICAL_VLAN. for critical VLANs with VOICE trafficType, vlanName will be VOICE_VLAN'
exclude_test: true
test_prerequisites: |
resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
depends_on = [catalystcenter_ip_pool.test]
}
resource "catalystcenter_ip_pool" "test" {
name = "MyPool1"
ip_subnet = "172.32.0.0/16"
}
resource "catalystcenter_ip_pool_reservation" "test" {
site_id = catalystcenter_area.test.id
name = "MyRes1"
type = "Generic"
ipv4_global_pool = catalystcenter_ip_pool.test.ip_subnet
ipv4_prefix = true
ipv4_prefix_length = 24
ipv4_subnet = "172.32.1.0"
depends_on = [catalystcenter_ip_pool.test]
}
resource "catalystcenter_fabric_site" "test" {
site_id = catalystcenter_area.test.id
pub_sub_enabled = false
authentication_profile_name = "No Authentication"
depends_on = [catalystcenter_area.test]
}
resource "catalystcenter_fabric_virtual_network" "test" {
virtual_network_name = "SDA_VN1"
is_guest = false
sg_names = ["Employees"]
}
resource "catalystcenter_virtual_network_to_fabric_site" "test" {
virtual_network_name = "SDA_VN1"
site_name_hierarchy = "Global/Area1"
depends_on = [catalystcenter_fabric_virtual_network.test, catalystcenter_fabric_site.test]
}
1 change: 1 addition & 0 deletions gen/definitions/assign_credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ attributes:
type: String
query_param: true
id: true
create_query_path: true
description: The site ID
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
test_value: catalystcenter_area.test.id
Expand Down
1 change: 1 addition & 0 deletions gen/definitions/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ attributes:
mandatory: true
id: true
query_param: true
query_param_no_body: true
response_data_path: response.0.name
data_path: '0'
requires_replace: true
Expand Down
1 change: 1 addition & 0 deletions gen/definitions/ip_pool_reservation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ attributes:
- model_name: siteId
type: String
query_param: true
create_query_path: true
description: The site ID
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
test_value: catalystcenter_area.test.id
Expand Down
1 change: 1 addition & 0 deletions gen/definitions/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ attributes:
- model_name: siteId
type: String
query_param: true
create_query_path: true
id: true
description: The site ID
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
Expand Down
Loading