diff --git a/CHANGELOG.md b/CHANGELOG.md index 7783cec..e7bfba1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 31f3a27..9721b4f 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -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) diff --git a/docs/resources/anycast_gateway.md b/docs/resources/anycast_gateway.md index 16884c8..97ece4c 100644 --- a/docs/resources/anycast_gateway.md +++ b/docs/resources/anycast_gateway.md @@ -35,22 +35,21 @@ 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) @@ -58,6 +57,7 @@ resource "catalystcenter_anycast_gateway" "example" { - `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 diff --git a/gen/definitions/anycast_gateway.yaml b/gen/definitions/anycast_gateway.yaml index 68064ee..f0a08cd 100644 --- a/gen/definitions/anycast_gateway.yaml +++ b/gen/definitions/anycast_gateway.yaml @@ -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 @@ -91,7 +92,6 @@ 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 @@ -99,7 +99,6 @@ attributes: 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 @@ -107,7 +106,6 @@ attributes: 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 @@ -115,7 +113,6 @@ attributes: 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 @@ -124,7 +121,6 @@ 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 @@ -132,7 +128,6 @@ attributes: 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 diff --git a/internal/provider/resource_catalystcenter_anycast_gateway.go b/internal/provider/resource_catalystcenter_anycast_gateway.go index 24dcdfa..9e13153 100644 --- a/internal/provider/resource_catalystcenter_anycast_gateway.go +++ b/internal/provider/resource_catalystcenter_anycast_gateway.go @@ -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, diff --git a/internal/provider/resource_catalystcenter_anycast_gateway_test.go b/internal/provider/resource_catalystcenter_anycast_gateway_test.go index 94825d6..8d6c4ba 100644 --- a/internal/provider/resource_catalystcenter_anycast_gateway_test.go +++ b/internal/provider/resource_catalystcenter_anycast_gateway_test.go @@ -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" @@ -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...), @@ -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 } diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 31f3a27..9721b4f 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -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)