Skip to content
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

Fixes in templates, new fabric_l2_virtual_network resource, remove max_async_wait_time leftover, device unreachaibitliy warning for l3 handoff #152

Merged
merged 10 commits into from
Nov 29, 2024
Merged
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.1.16 (unreleased)

- Add Device Unreachability Warning to `catalystcenter_fabric_l3_handoff_ip_transit` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/150)
- Add `catalystcenter_fabric_l2_virtual_network` resource and data source
- Remove `max_async_wait_time` attribute and use timeout from `CC_MAX_TIMEOUT`
- Modify `catalystcenter_deploy_template` resource to support deploying composite templates
- Modify `catalystcenter_template_version` resource to use versioned template id as `id` and remove data_source

## 0.1.15

- Fix issue in `catalystcenter_fabric_l3_handoff_ip_transit` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/146)
Expand Down
36 changes: 36 additions & 0 deletions docs/data-sources/fabric_l2_virtual_network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "catalystcenter_fabric_l2_virtual_network Data Source - terraform-provider-catalystcenter"
subcategory: "SDA"
description: |-
This data source can read the Fabric L2 Virtual Network.
---

# catalystcenter_fabric_l2_virtual_network (Data Source)

This data source can read the Fabric L2 Virtual Network.

## Example Usage

```terraform
data "catalystcenter_fabric_l2_virtual_network" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
vlan_name = "VLAN401"
}
```

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

### Required

- `fabric_id` (String) ID of the fabric this layer 2 virtual network is to be assigned to
- `vlan_name` (String) Name of the VLAN of the layer 2 virtual network. Must contain only alphanumeric characters, underscores, and hyphens

### Read-Only

- `associated_l3_virtual_network_name` (String) Name of the layer 3 virtual network associated with the layer 2 virtual network. This field is provided to support requests related to virtual network anchoring. The layer 3 virtual network must have already been added to the fabric before association. This field must either be present in all payload elements or none
- `fabric_enabled_wireless` (Boolean) Set to true to enable wireless. Default is false
- `id` (String) The id of the object
- `traffic_type` (String) The type of traffic that is served
- `vlan_id` (Number) ID of the VLAN of the layer 2 virtual network. Allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, and 2046. If deploying on a fabric zone, this vlanId must match the vlanId of the corresponding layer 2 virtual network on the fabric site
31 changes: 0 additions & 31 deletions docs/data-sources/template_version.md

This file was deleted.

8 changes: 8 additions & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ description: |-

# Changelog

## 0.1.16 (unreleased)

- Add Device Unreachability Warning to `catalystcenter_fabric_l3_handoff_ip_transit` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/150)
- Add `catalystcenter_fabric_l2_virtual_network` resource and data source
- Remove `max_async_wait_time` attribute and use timeout from `CC_MAX_TIMEOUT`
- Modify `catalystcenter_deploy_template` resource to support deploying composite templates
- Modify `catalystcenter_template_version` resource to use versioned template id as `id` and remove data_source

## 0.1.15

- Fix issue in `catalystcenter_fabric_l3_handoff_ip_transit` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/146)
Expand Down
9 changes: 5 additions & 4 deletions docs/resources/deploy_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ Required:

- `type` (String) Target type of device
- Choices: `MANAGED_DEVICE_IP`, `MANAGED_DEVICE_UUID`, `PRE_PROVISIONED_SERIAL`, `PRE_PROVISIONED_MAC`, `DEFAULT`, `MANAGED_DEVICE_HOSTNAME`
- `versioned_template_id` (String) Versioned template ID to be provisioned

Optional:

- `host_name` (String) Hostname of device is required if targetType is MANAGED_DEVICE_HOSTNAME
- `id` (String) ID of device is required if `type` is MANAGED_DEVICE_UUID
- `params` (Map of String) Template params/values to be provisioned
- `resource_params` (Attributes List) Resource params to be provisioned (see [below for nested schema](#nestedatt--target_info--resource_params))
- `versioned_template_id` (String) Versioned template ID to be provisioned

<a id="nestedatt--target_info--resource_params"></a>
### Nested Schema for `target_info.resource_params`
Expand All @@ -80,13 +80,14 @@ Optional:
Required:

- `target_info` (Attributes List) Target info to deploy template (see [below for nested schema](#nestedatt--member_template_deployment_info--target_info))
- `template_id` (String) ID of template to be provisioned
- `template_id` (String) Versioned Template ID

Optional:

- `copying_config` (Boolean) Copying Config
- `force_push_template` (Boolean) Force Push Template
- `is_composite` (Boolean) Composite template flag
- `main_template_id` (String) Composite Template ID
- `main_template_id` (String) Template ID

<a id="nestedatt--member_template_deployment_info--target_info"></a>
### Nested Schema for `member_template_deployment_info.target_info`
Expand All @@ -95,14 +96,14 @@ Required:

- `type` (String) Target type of device
- Choices: `MANAGED_DEVICE_IP`, `MANAGED_DEVICE_UUID`, `PRE_PROVISIONED_SERIAL`, `PRE_PROVISIONED_MAC`, `DEFAULT`, `MANAGED_DEVICE_HOSTNAME`
- `versioned_template_id` (String) Versioned template ID to be provisioned

Optional:

- `host_name` (String) Hostname of device is required if targetType is MANAGED_DEVICE_HOSTNAME
- `id` (String) ID of device is required if targetType is MANAGED_DEVICE_UUID
- `params` (Map of String) Template params/values to be provisioned
- `resource_params` (Attributes List) Resource params to be provisioned (see [below for nested schema](#nestedatt--member_template_deployment_info--target_info--resource_params))
- `versioned_template_id` (String) Versioned template ID to be provisioned

<a id="nestedatt--member_template_deployment_info--target_info--resource_params"></a>
### Nested Schema for `member_template_deployment_info.target_info.resource_params`
Expand Down
51 changes: 51 additions & 0 deletions docs/resources/fabric_l2_virtual_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_fabric_l2_virtual_network Resource - terraform-provider-catalystcenter"
subcategory: "SDA"
description: |-
This resource can manage a Fabric L2 Virtual Network.
---

# catalystcenter_fabric_l2_virtual_network (Resource)

This resource can manage a Fabric L2 Virtual Network.

## Example Usage

```terraform
resource "catalystcenter_fabric_l2_virtual_network" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
vlan_name = "VLAN401"
vlan_id = 401
traffic_type = "DATA"
fabric_enabled_wireless = false
}
```

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

### Required

- `fabric_id` (String) ID of the fabric this layer 2 virtual network is to be assigned to
- `traffic_type` (String) The type of traffic that is served
- Choices: `DATA`, `VOICE`
- `vlan_name` (String) Name of the VLAN of the layer 2 virtual network. Must contain only alphanumeric characters, underscores, and hyphens

### Optional

- `associated_l3_virtual_network_name` (String) Name of the layer 3 virtual network associated with the layer 2 virtual network. This field is provided to support requests related to virtual network anchoring. The layer 3 virtual network must have already been added to the fabric before association. This field must either be present in all payload elements or none
- `fabric_enabled_wireless` (Boolean) Set to true to enable wireless. Default is false
- `vlan_id` (Number) ID of the VLAN of the layer 2 virtual network. Allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, and 2046. If deploying on a fabric zone, this vlanId must match the vlanId of the corresponding layer 2 virtual network 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_fabric_l2_virtual_network.example "<fabric_id>,<vlan_name>"
```
5 changes: 1 addition & 4 deletions docs/resources/template_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ resource "catalystcenter_template_version" "example" {
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `template_id` (String) UUID of template

### Optional

- `comments` (String) Template version comments
- `template_id` (String) UUID of template

### Read-Only

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "catalystcenter_fabric_l2_virtual_network" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
vlan_name = "VLAN401"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import catalystcenter_fabric_l2_virtual_network.example "<fabric_id>,<vlan_name>"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "catalystcenter_fabric_l2_virtual_network" "example" {
fabric_id = "5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1"
vlan_name = "VLAN401"
vlan_id = 401
traffic_type = "DATA"
fabric_enabled_wireless = false
}
7 changes: 2 additions & 5 deletions gen/definitions/anycast_gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ data_source_no_id: true
skip_minimum_test: true
put_id_include_path: "0.id"
put_no_id: true
max_async_wait_time: 120
doc_category: SDA
attributes:
- model_name: fabricId
Expand Down Expand Up @@ -147,7 +146,6 @@ test_prerequisites: |
resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
depends_on = [catalystcenter_ip_pool.test]
}
resource "catalystcenter_ip_pool" "test" {
name = "MyPool1"
Expand All @@ -167,15 +165,14 @@ test_prerequisites: |
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"
virtual_network_name = catalystcenter_fabric_virtual_network.test.id
site_name_hierarchy = "Global/Area1"
depends_on = [catalystcenter_fabric_virtual_network.test, catalystcenter_fabric_site.test]
depends_on = [catalystcenter_fabric_site.test]
}
9 changes: 5 additions & 4 deletions gen/definitions/deploy_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ attributes:
- model_name: templateId
type: String
id: true
description: ID of template to be provisioned
description: Versioned Template ID
- model_name: forcePushTemplate
type: Bool
description: Force Push Template
- model_name: isComposite
type: Bool
description: Composite template flag
- model_name: copyingConfig
type: Bool
description: Copying Config
- model_name: mainTemplateId
type: String
description: Composite Template ID
description: Template ID
- model_name: targetInfo
type: List
mandatory: true
Expand Down Expand Up @@ -93,7 +96,6 @@ attributes:
description: Target type of device
- model_name: versionedTemplateId
type: String
mandatory: true
description: Versioned template ID to be provisioned
- model_name: targetInfo
type: List
Expand Down Expand Up @@ -147,7 +149,6 @@ attributes:
example: MANAGED_DEVICE_HOSTNAME
- model_name: versionedTemplateId
type: String
mandatory: true
description: Versioned template ID to be provisioned
example: 12345678-1234-1234-1234-123456789012
test_value: catalystcenter_template_version.example.id
Expand Down
1 change: 0 additions & 1 deletion gen/definitions/discovery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ no_update: true
no_import: true
get_from_all: true
id_from_query_path: response
max_async_wait_time: 600
doc_category: Discovery
attributes:
- model_name: cdpLevel
Expand Down
1 change: 0 additions & 1 deletion gen/definitions/fabric_device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ put_id_include_path: 0.id
import_no_id: true
data_source_no_id: true
put_no_id: true
max_async_wait_time: 300
doc_category: SDA
test_tags: [SDA]
attributes:
Expand Down
72 changes: 72 additions & 0 deletions gen/definitions/fabric_l2_virtual_network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: Fabric L2 Virtual Network
rest_endpoint: /dna/intent/api/v1/sda/layer2VirtualNetworks
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
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 this layer 2 virtual network is to be assigned to
type: String
example: 5e6f7b3a-2b0b-4a7d-8b1c-0d4b1cd5e1b1
test_value: catalystcenter_fabric_site.test.id
- model_name: vlanName
requires_replace: true
data_path: '0'
query_param: true
response_data_path: response.0.vlanName
type: String
mandatory: true
description: Name of the VLAN of the layer 2 virtual network. Must contain only alphanumeric characters, underscores, and hyphens
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 layer 2 virtual network. Allowed VLAN range is 2-4093 except for reserved VLANs 1002-1005, and 2046. If deploying on a fabric zone, this vlanId must match the vlanId of the corresponding layer 2 virtual network 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 that is served
example: DATA
- model_name: isFabricEnabledWireless
data_path: '0'
response_data_path: response.0.isFabricEnabledWireless
tf_name: fabric_enabled_wireless
type: Bool
description: Set to true to enable wireless. Default is false
example: false
- model_name: associatedLayer3VirtualNetworkName
requires_replace: true
data_path: '0'
response_data_path: response.0.associatedLayer3VirtualNetworkName
tf_name: associated_l3_virtual_network_name
type: String
description: Name of the layer 3 virtual network associated with the layer 2 virtual network. This field is provided to support requests related to virtual network anchoring. The layer 3 virtual network must have already been added to the fabric before association. This field must either be present in all payload elements or none
example: SDA_VN1
exclude_test: true
test_prerequisites: |
resource "catalystcenter_area" "test" {
name = "Area1"
parent_name = "Global"
}
resource "catalystcenter_fabric_site" "test" {
site_id = catalystcenter_area.test.id
pub_sub_enabled = false
authentication_profile_name = "No Authentication"
}
Loading
Loading