Skip to content

Commit

Permalink
Modify anycast gateway to support pool type FABRIC_AP (CiscoDevNet#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz authored Oct 15, 2024
1 parent f4035c6 commit 0701ac8
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.1.13 (unreleased)

- Modify `anycast_gateway` to support pool_type FABRIC_AP
- Add composite templates support to `catalystcenter_template` resource
- Fix issue with catalystcenter_ip_pool forces replacement on `catalystcenter_ip_pool` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/125)

Expand Down
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.13 (unreleased)

- Modify `anycast_gateway` to support pool_type FABRIC_AP
- Add composite templates support to `catalystcenter_template` resource
- Fix issue with catalystcenter_ip_pool forces replacement on `catalystcenter_ip_pool` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/125)

Expand Down
12 changes: 6 additions & 6 deletions docs/resources/anycast_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,29 @@ resource "catalystcenter_anycast_gateway" "example" {

### 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
- `critical_pool` (Boolean) Enable/disable critical VLAN. if true, autoGenerateVlanName must also be true. (isCriticalPool is not applicable to INFRA_VN)
- `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)
- 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
- `wireless_pool` (Boolean) Enable/disable fabric-enabled wireless (not applicable to INFRA_VN)

### Read-Only

Expand Down
7 changes: 1 addition & 6 deletions gen/definitions/anycast_gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ id_from_query_path: response.0
id_from_query_path_attribute: id
import_no_id: true
data_source_no_id: true
skip_minimum_test: true
put_id_include_path: "0.id"
put_no_id: true
max_async_wait_time: 120
Expand Down Expand Up @@ -91,31 +92,27 @@ attributes:
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
Expand All @@ -124,15 +121,13 @@ attributes:
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
Expand Down
12 changes: 6 additions & 6 deletions internal/provider/resource_catalystcenter_anycast_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,33 +135,33 @@ func (r *AnycastGatewayResource) Schema(ctx context.Context, req resource.Schema
},
"critical_pool": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable critical VLAN. if true, autoGenerateVlanName must also be true. (isCriticalPool is not applicable to INFRA_VN)").String,
Required: true,
Optional: true,
PlanModifiers: []planmodifier.Bool{
boolplanmodifier.RequiresReplace(),
},
},
"l2_flooding_enabled": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable layer 2 flooding (not applicable to INFRA_VN)").String,
Required: true,
Optional: true,
},
"wireless_pool": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable fabric-enabled wireless (not applicable to INFRA_VN)").String,
Required: true,
Optional: true,
},
"ip_directed_broadcast": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable IP-directed broadcast (not applicable to INFRA_VN)").String,
Required: true,
Optional: true,
},
"intra_subnet_routing_enabled": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable Intra-Subnet Routing (not applicable to INFRA_VN)").String,
Required: true,
Optional: true,
PlanModifiers: []planmodifier.Bool{
boolplanmodifier.RequiresReplace(),
},
},
"multiple_ip_to_mac_addresses": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable multiple IP-to-MAC Addresses (Wireless Bridged-Network Virtual Machine; not applicable to INFRA_VN)").String,
Required: true,
Optional: true,
},
"supplicant_based_extended_node_onboarding": schema.BoolAttribute{
MarkdownDescription: helpers.NewAttributeDescription("Enable/disable Supplicant-Based Extended Node Onboarding (applicable only to INFRA_VN)").String,
Expand Down
12 changes: 0 additions & 12 deletions internal/provider/resource_catalystcenter_anycast_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
"os"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand All @@ -42,11 +41,6 @@ func TestAccCcAnycastGateway(t *testing.T) {
checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_anycast_gateway.test", "multiple_ip_to_mac_addresses", "false"))

var steps []resource.TestStep
if os.Getenv("SKIP_MINIMUM_TEST") == "" {
steps = append(steps, resource.TestStep{
Config: testAccCcAnycastGatewayPrerequisitesConfig + testAccCcAnycastGatewayConfig_minimum(),
})
}
steps = append(steps, resource.TestStep{
Config: testAccCcAnycastGatewayPrerequisitesConfig + testAccCcAnycastGatewayConfig_all(),
Check: resource.ComposeTestCheckFunc(checks...),
Expand Down Expand Up @@ -110,12 +104,6 @@ func testAccCcAnycastGatewayConfig_minimum() string {
config += ` ip_pool_name = catalystcenter_ip_pool_reservation.test.name` + "\n"
config += ` vlan_name = "VLAN401"` + "\n"
config += ` traffic_type = "DATA"` + "\n"
config += ` critical_pool = false` + "\n"
config += ` l2_flooding_enabled = false` + "\n"
config += ` wireless_pool = false` + "\n"
config += ` ip_directed_broadcast = false` + "\n"
config += ` intra_subnet_routing_enabled = false` + "\n"
config += ` multiple_ip_to_mac_addresses = false` + "\n"
config += `}` + "\n"
return config
}
Expand Down
1 change: 1 addition & 0 deletions templates/guides/changelog.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description: |-

## 0.1.13 (unreleased)

- Modify `anycast_gateway` to support pool_type FABRIC_AP
- Add composite templates support to `catalystcenter_template` resource
- Fix issue with catalystcenter_ip_pool forces replacement on `catalystcenter_ip_pool` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/125)

Expand Down

0 comments on commit 0701ac8

Please sign in to comment.