diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39447ca..23d2339 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.1.11 (unreleased)
+
+- Add `catalystcenter_fabric_vlan_to_ssid` resource and data source
+
## 0.1.10
- Add `catalystcenter_fabric_l2_handoff` resource and data source
@@ -12,8 +16,8 @@
- Add `transitPeerNetworkId` as `id` to `catalystcenter_transit_peer_network` resource
- Add `catalystcenter_anycast_gateway` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+
- BREAKING CHANGE: Modified `catalystcenter_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
+- Fix issue with mandatory attributes in `catalystcenter_transit_peer_network` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/92)
+- BREAKING CHANGE: Fix `catalystcenter_ip_pool` update if more than 25 pools are registered
- BREAKING CHANGE: Rename `radio_type_a_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_a_power_threshold_v1`
- BREAKING CHANGE: Rename `radio_type_b_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_b_power_threshold_v1`
- BREAKING CHANGE: Rename `radio_type_c_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_c_power_threshold_v1`
diff --git a/docs/data-sources/fabric_vlan_to_ssid.md b/docs/data-sources/fabric_vlan_to_ssid.md
new file mode 100644
index 0000000..10e060d
--- /dev/null
+++ b/docs/data-sources/fabric_vlan_to_ssid.md
@@ -0,0 +1,48 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "catalystcenter_fabric_vlan_to_ssid Data Source - terraform-provider-catalystcenter"
+subcategory: "Wireless"
+description: |-
+ This data source can read the Fabric VLAN to SSID.
+---
+
+# catalystcenter_fabric_vlan_to_ssid (Data Source)
+
+This data source can read the Fabric VLAN to SSID.
+
+## Example Usage
+
+```terraform
+data "catalystcenter_fabric_vlan_to_ssid" "example" {
+ id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+ fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+}
+```
+
+
+## Schema
+
+### Required
+
+- `fabric_id` (String) Fabric ID
+- `id` (String) The id of the object
+
+### Read-Only
+
+- `mappings` (Attributes List) List of VLAN to SSID mappings (see [below for nested schema](#nestedatt--mappings))
+
+
+### Nested Schema for `mappings`
+
+Read-Only:
+
+- `ssid_details` (Attributes List) SSID Details (see [below for nested schema](#nestedatt--mappings--ssid_details))
+- `vlan_name` (String) VLAN Name
+
+
+### Nested Schema for `mappings.ssid_details`
+
+Read-Only:
+
+- `name` (String) Name of the SSID
+- `security_group_tag` (String) Represents the name of the Security Group. Example: Auditors, BYOD, Developers, etc.
diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md
index 82fd486..9a96d16 100644
--- a/docs/guides/changelog.md
+++ b/docs/guides/changelog.md
@@ -7,6 +7,10 @@ description: |-
# Changelog
+## 0.1.11 (unreleased)
+
+- Add `catalystcenter_fabric_vlan_to_ssid` resource and data source
+
## 0.1.10
- Add `catalystcenter_fabric_l2_handoff` resource and data source
@@ -21,8 +25,8 @@ description: |-
- Add `transitPeerNetworkId` as `id` to `catalystcenter_transit_peer_network` resource
- Add `catalystcenter_anycast_gateway` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+
- BREAKING CHANGE: Modified `catalystcenter_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
+- Fix issue with mandatory attributes in `catalystcenter_transit_peer_network` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/92)
+- BREAKING CHANGE: Fix `catalystcenter_ip_pool` update if more than 25 pools are registered
- BREAKING CHANGE: Rename `radio_type_a_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_a_power_threshold_v1`
- BREAKING CHANGE: Rename `radio_type_b_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_b_power_threshold_v1`
- BREAKING CHANGE: Rename `radio_type_c_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_c_power_threshold_v1`
diff --git a/docs/resources/fabric_vlan_to_ssid.md b/docs/resources/fabric_vlan_to_ssid.md
new file mode 100644
index 0000000..fd8c54b
--- /dev/null
+++ b/docs/resources/fabric_vlan_to_ssid.md
@@ -0,0 +1,69 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "catalystcenter_fabric_vlan_to_ssid Resource - terraform-provider-catalystcenter"
+subcategory: "Wireless"
+description: |-
+ Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared. The request must include all SSIDs currently mapped to a VLAN, as determined by the response from the GET operation for the same fabricId used in the request. If an already-mapped SSID is not included in the payload, its mapping will be removed by this API. Conversely, if a new SSID is provided, it will be added to the Mapping. Ensure that any new SSID added is a Fabric SSID. This API can also be used to add a VLAN and associate the relevant SSIDs with it. The 'vlanName' must be 'Fabric Wireless Enabled' and should be part of the Fabric Site representing 'Fabric ID' specified in the API request
+---
+
+# catalystcenter_fabric_vlan_to_ssid (Resource)
+
+Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared. The request must include all SSIDs currently mapped to a VLAN, as determined by the response from the GET operation for the same fabricId used in the request. If an already-mapped SSID is not included in the payload, its mapping will be removed by this API. Conversely, if a new SSID is provided, it will be added to the Mapping. Ensure that any new SSID added is a Fabric SSID. This API can also be used to add a VLAN and associate the relevant SSIDs with it. The 'vlanName' must be 'Fabric Wireless Enabled' and should be part of the Fabric Site representing 'Fabric ID' specified in the API request
+
+## Example Usage
+
+```terraform
+resource "catalystcenter_fabric_vlan_to_ssid" "example" {
+ fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+ mappings = [
+ {
+ vlan_name = "VLAN_1"
+ ssid_details = [
+ {
+ name = "mySSID1"
+ security_group_tag = "Auditors"
+ }
+ ]
+ }
+ ]
+}
+```
+
+
+## Schema
+
+### Required
+
+- `fabric_id` (String) Fabric ID
+- `mappings` (Attributes List) List of VLAN to SSID mappings (see [below for nested schema](#nestedatt--mappings))
+
+### Read-Only
+
+- `id` (String) The id of the object
+
+
+### Nested Schema for `mappings`
+
+Required:
+
+- `vlan_name` (String) VLAN Name
+
+Optional:
+
+- `ssid_details` (Attributes List) SSID Details (see [below for nested schema](#nestedatt--mappings--ssid_details))
+
+
+### Nested Schema for `mappings.ssid_details`
+
+Optional:
+
+- `name` (String) Name of the SSID
+- `security_group_tag` (String) Represents the name of the Security Group. Example: Auditors, BYOD, Developers, etc.
+
+## Import
+
+Import is supported using the following syntax:
+
+```shell
+terraform import catalystcenter_fabric_vlan_to_ssid.example ""
+```
diff --git a/examples/data-sources/catalystcenter_fabric_vlan_to_ssid/data-source.tf b/examples/data-sources/catalystcenter_fabric_vlan_to_ssid/data-source.tf
new file mode 100644
index 0000000..c6fdea9
--- /dev/null
+++ b/examples/data-sources/catalystcenter_fabric_vlan_to_ssid/data-source.tf
@@ -0,0 +1,4 @@
+data "catalystcenter_fabric_vlan_to_ssid" "example" {
+ id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+ fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+}
diff --git a/examples/resources/catalystcenter_fabric_vlan_to_ssid/import.sh b/examples/resources/catalystcenter_fabric_vlan_to_ssid/import.sh
new file mode 100644
index 0000000..79e63c9
--- /dev/null
+++ b/examples/resources/catalystcenter_fabric_vlan_to_ssid/import.sh
@@ -0,0 +1 @@
+terraform import catalystcenter_fabric_vlan_to_ssid.example ""
diff --git a/examples/resources/catalystcenter_fabric_vlan_to_ssid/resource.tf b/examples/resources/catalystcenter_fabric_vlan_to_ssid/resource.tf
new file mode 100644
index 0000000..70f9a98
--- /dev/null
+++ b/examples/resources/catalystcenter_fabric_vlan_to_ssid/resource.tf
@@ -0,0 +1,14 @@
+resource "catalystcenter_fabric_vlan_to_ssid" "example" {
+ fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+ mappings = [
+ {
+ vlan_name = "VLAN_1"
+ ssid_details = [
+ {
+ name = "mySSID1"
+ security_group_tag = "Auditors"
+ }
+ ]
+ }
+ ]
+}
diff --git a/gen/definitions/fabric_vlan_to_ssid.yaml b/gen/definitions/fabric_vlan_to_ssid.yaml
new file mode 100644
index 0000000..5782e2c
--- /dev/null
+++ b/gen/definitions/fabric_vlan_to_ssid.yaml
@@ -0,0 +1,52 @@
+---
+name: Fabric VLAN to SSID
+rest_endpoint: /dna/intent/api/v1/sda/fabrics/%v/vlanToSsids
+res_description:
+ "Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName'
+ which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared.
+ The request must include all SSIDs currently mapped to a VLAN, as determined by the response
+ from the GET operation for the same fabricId used in the request.
+ If an already-mapped SSID is not included in the payload, its mapping will be removed by this API.
+ Conversely, if a new SSID is provided, it will be added to the Mapping. Ensure that any new SSID added is a Fabric SSID.
+ This API can also be used to add a VLAN and associate the relevant SSIDs with it.
+ The 'vlanName' must be 'Fabric Wireless Enabled' and should be part of the Fabric Site representing 'Fabric ID' specified in the API request"
+# Manual updates in Delete function to send PUT request with empty body []
+get_no_id: true
+delete_no_id: true
+put_create: true
+id_from_attribute: true
+root_list: true
+skip_minimum_test: true
+doc_category: Wireless
+test_tags: [WIRELESS]
+attributes:
+ - tf_name: fabric_id
+ reference: true
+ id: true
+ type: String
+ description: Fabric ID
+ example: 5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b
+ - tf_name: mappings
+ type: List
+ response_data_path: response
+ mandatory: true
+ description: List of VLAN to SSID mappings
+ attributes:
+ - model_name: vlanName
+ type: String
+ description: VLAN Name
+ id: true
+ example: VLAN_1
+ - model_name: ssidDetails
+ type: List
+ description: SSID Details
+ attributes:
+ - model_name: name
+ type: String
+ description: Name of the SSID
+ example: mySSID1
+ - model_name: securityGroupTag
+ type: String
+ description: "Represents the name of the Security Group. Example: Auditors, BYOD, Developers, etc."
+ example: Auditors
+
\ No newline at end of file
diff --git a/gen/templates/model.go b/gen/templates/model.go
index 5a11aa3..6cde75d 100644
--- a/gen/templates/model.go
+++ b/gen/templates/model.go
@@ -305,6 +305,13 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context, state {{camelCase .N
// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result) {
+ {{- if .RootList}}
+ {{- range .Attributes}}
+ {{if .ResponseDataPath}}
+ res = res.Get("{{.ResponseDataPath}}")
+ {{- end}}
+ {{- end}}
+ {{- end}}
{{- if .DataSourceNoId}}
// Retrieve the 'id' attribute, if Data Source doesn't require id
if value := res.Get("{{if .IdFromQueryPath}}{{if eq .IdFromQueryPath "." }}{{else}}{{.IdFromQueryPath}}.{{end}}{{if .IdFromQueryPathAttribute}}{{.IdFromQueryPathAttribute}}{{else}}id{{end}}{{end}}"); value.Exists() {
@@ -455,6 +462,13 @@ func (data *{{camelCase .Name}}) fromBody(ctx context.Context, res gjson.Result)
// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
func (data *{{camelCase .Name}}) updateFromBody(ctx context.Context, res gjson.Result) {
+ {{- if .RootList}}
+ {{- range .Attributes}}
+ {{if .ResponseDataPath}}
+ res = res.Get("{{.ResponseDataPath}}")
+ {{- end}}
+ {{- end}}
+ {{- end}}
{{- range .Attributes}}
{{- if and (not .Value) (not .WriteOnly) (not .Reference) (not .CreateQueryPath) (not .QueryParamNoBody)}}
{{- if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool")}}
diff --git a/internal/provider/data_source_catalystcenter_fabric_vlan_to_ssid.go b/internal/provider/data_source_catalystcenter_fabric_vlan_to_ssid.go
new file mode 100644
index 0000000..d19d24a
--- /dev/null
+++ b/internal/provider/data_source_catalystcenter_fabric_vlan_to_ssid.go
@@ -0,0 +1,137 @@
+// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
+// All rights reserved.
+//
+// Licensed under the Mozilla Public License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://mozilla.org/MPL/2.0/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: MPL-2.0
+
+package provider
+
+// Section below is generated&owned by "gen/generator.go". //template:begin imports
+import (
+ "context"
+ "fmt"
+
+ "github.com/hashicorp/terraform-plugin-framework/datasource"
+ "github.com/hashicorp/terraform-plugin-framework/datasource/schema"
+ "github.com/hashicorp/terraform-plugin-log/tflog"
+ cc "github.com/netascode/go-catalystcenter"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin model
+
+// Ensure the implementation satisfies the expected interfaces.
+var (
+ _ datasource.DataSource = &FabricVLANToSSIDDataSource{}
+ _ datasource.DataSourceWithConfigure = &FabricVLANToSSIDDataSource{}
+)
+
+func NewFabricVLANToSSIDDataSource() datasource.DataSource {
+ return &FabricVLANToSSIDDataSource{}
+}
+
+type FabricVLANToSSIDDataSource struct {
+ client *cc.Client
+}
+
+func (d *FabricVLANToSSIDDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_fabric_vlan_to_ssid"
+}
+
+func (d *FabricVLANToSSIDDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
+ resp.Schema = schema.Schema{
+ // This description is used by the documentation generator and the language server.
+ MarkdownDescription: "This data source can read the Fabric VLAN to SSID.",
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Required: true,
+ },
+ "fabric_id": schema.StringAttribute{
+ MarkdownDescription: "Fabric ID",
+ Required: true,
+ },
+ "mappings": schema.ListNestedAttribute{
+ MarkdownDescription: "List of VLAN to SSID mappings",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "vlan_name": schema.StringAttribute{
+ MarkdownDescription: "VLAN Name",
+ Computed: true,
+ },
+ "ssid_details": schema.ListNestedAttribute{
+ MarkdownDescription: "SSID Details",
+ Computed: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: "Name of the SSID",
+ Computed: true,
+ },
+ "security_group_tag": schema.StringAttribute{
+ MarkdownDescription: "Represents the name of the Security Group. Example: Auditors, BYOD, Developers, etc.",
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (d *FabricVLANToSSIDDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) {
+ if req.ProviderData == nil {
+ return
+ }
+
+ d.client = req.ProviderData.(*CcProviderData).Client
+}
+
+// End of section. //template:end model
+
+// Section below is generated&owned by "gen/generator.go". //template:begin read
+func (d *FabricVLANToSSIDDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
+ var config FabricVLANToSSID
+
+ // Read config
+ diags := req.Config.Get(ctx, &config)
+ resp.Diagnostics.Append(diags...)
+ if resp.Diagnostics.HasError() {
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", config.Id.String()))
+
+ params := ""
+ res, err := d.client.Get(config.getPath() + params)
+ if err != nil {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object, got error: %s", err))
+ return
+ }
+
+ config.fromBody(ctx, res)
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", config.Id.ValueString()))
+
+ diags = resp.State.Set(ctx, &config)
+ resp.Diagnostics.Append(diags...)
+}
+
+// End of section. //template:end read
diff --git a/internal/provider/data_source_catalystcenter_fabric_vlan_to_ssid_test.go b/internal/provider/data_source_catalystcenter_fabric_vlan_to_ssid_test.go
new file mode 100644
index 0000000..ef63444
--- /dev/null
+++ b/internal/provider/data_source_catalystcenter_fabric_vlan_to_ssid_test.go
@@ -0,0 +1,79 @@
+// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
+// All rights reserved.
+//
+// Licensed under the Mozilla Public License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://mozilla.org/MPL/2.0/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: MPL-2.0
+
+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"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource
+func TestAccDataSourceCcFabricVLANToSSID(t *testing.T) {
+ if os.Getenv("WIRELESS") == "" {
+ t.Skip("skipping test, set environment variable WIRELESS")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("data.catalystcenter_fabric_vlan_to_ssid.test", "fabric_id", "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.catalystcenter_fabric_vlan_to_ssid.test", "mappings.0.vlan_name", "VLAN_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.catalystcenter_fabric_vlan_to_ssid.test", "mappings.0.ssid_details.0.name", "mySSID1"))
+ checks = append(checks, resource.TestCheckResourceAttr("data.catalystcenter_fabric_vlan_to_ssid.test", "mappings.0.ssid_details.0.security_group_tag", "Auditors"))
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: []resource.TestStep{
+ {
+ Config: testAccDataSourceCcFabricVLANToSSIDConfig(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ },
+ },
+ })
+}
+
+// End of section. //template:end testAccDataSource
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
+func testAccDataSourceCcFabricVLANToSSIDConfig() string {
+ config := `resource "catalystcenter_fabric_vlan_to_ssid" "test" {` + "\n"
+ config += ` fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"` + "\n"
+ config += ` mappings = [{` + "\n"
+ config += ` vlan_name = "VLAN_1"` + "\n"
+ config += ` ssid_details = [{` + "\n"
+ config += ` name = "mySSID1"` + "\n"
+ config += ` security_group_tag = "Auditors"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+
+ config += `
+ data "catalystcenter_fabric_vlan_to_ssid" "test" {
+ id = catalystcenter_fabric_vlan_to_ssid.test.id
+ fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"
+ }
+ `
+ return config
+}
+
+// End of section. //template:end testAccDataSourceConfig
diff --git a/internal/provider/model_catalystcenter_fabric_vlan_to_ssid.go b/internal/provider/model_catalystcenter_fabric_vlan_to_ssid.go
new file mode 100644
index 0000000..bd28074
--- /dev/null
+++ b/internal/provider/model_catalystcenter_fabric_vlan_to_ssid.go
@@ -0,0 +1,217 @@
+// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
+// All rights reserved.
+//
+// Licensed under the Mozilla Public License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://mozilla.org/MPL/2.0/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: MPL-2.0
+
+package provider
+
+// Section below is generated&owned by "gen/generator.go". //template:begin imports
+import (
+ "context"
+ "fmt"
+ "net/url"
+
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/tidwall/gjson"
+ "github.com/tidwall/sjson"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin types
+type FabricVLANToSSID struct {
+ Id types.String `tfsdk:"id"`
+ FabricId types.String `tfsdk:"fabric_id"`
+ Mappings []FabricVLANToSSIDMappings `tfsdk:"mappings"`
+}
+
+type FabricVLANToSSIDMappings struct {
+ VlanName types.String `tfsdk:"vlan_name"`
+ SsidDetails []FabricVLANToSSIDMappingsSsidDetails `tfsdk:"ssid_details"`
+}
+
+type FabricVLANToSSIDMappingsSsidDetails struct {
+ Name types.String `tfsdk:"name"`
+ SecurityGroupTag types.String `tfsdk:"security_group_tag"`
+}
+
+// End of section. //template:end types
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPath
+func (data FabricVLANToSSID) getPath() string {
+ return fmt.Sprintf("/dna/intent/api/v1/sda/fabrics/%v/vlanToSsids", url.QueryEscape(data.FabricId.ValueString()))
+}
+
+// End of section. //template:end getPath
+
+// Section below is generated&owned by "gen/generator.go". //template:begin getPathDelete
+
+// End of section. //template:end getPathDelete
+
+// Section below is generated&owned by "gen/generator.go". //template:begin toBody
+func (data FabricVLANToSSID) toBody(ctx context.Context, state FabricVLANToSSID) string {
+ body := "[]"
+ put := false
+ if state.Id.ValueString() != "" {
+ put = true
+ }
+ _ = put
+ if len(data.Mappings) > 0 {
+ body, _ = sjson.Set(body, "", []interface{}{})
+ for _, item := range data.Mappings {
+ itemBody := ""
+ if !item.VlanName.IsNull() {
+ itemBody, _ = sjson.Set(itemBody, "vlanName", item.VlanName.ValueString())
+ }
+ if len(item.SsidDetails) > 0 {
+ itemBody, _ = sjson.Set(itemBody, "ssidDetails", []interface{}{})
+ for _, childItem := range item.SsidDetails {
+ itemChildBody := ""
+ if !childItem.Name.IsNull() {
+ itemChildBody, _ = sjson.Set(itemChildBody, "name", childItem.Name.ValueString())
+ }
+ if !childItem.SecurityGroupTag.IsNull() {
+ itemChildBody, _ = sjson.Set(itemChildBody, "securityGroupTag", childItem.SecurityGroupTag.ValueString())
+ }
+ itemBody, _ = sjson.SetRaw(itemBody, "ssidDetails.-1", itemChildBody)
+ }
+ }
+ body, _ = sjson.SetRaw(body, "-1", itemBody)
+ }
+ }
+ return body
+}
+
+// End of section. //template:end toBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
+func (data *FabricVLANToSSID) fromBody(ctx context.Context, res gjson.Result) {
+
+ res = res.Get("response")
+ if value := res; value.Exists() && len(value.Array()) > 0 {
+ data.Mappings = make([]FabricVLANToSSIDMappings, 0)
+ value.ForEach(func(k, v gjson.Result) bool {
+ item := FabricVLANToSSIDMappings{}
+ if cValue := v.Get("vlanName"); cValue.Exists() {
+ item.VlanName = types.StringValue(cValue.String())
+ } else {
+ item.VlanName = types.StringNull()
+ }
+ if cValue := v.Get("ssidDetails"); cValue.Exists() && len(cValue.Array()) > 0 {
+ item.SsidDetails = make([]FabricVLANToSSIDMappingsSsidDetails, 0)
+ cValue.ForEach(func(ck, cv gjson.Result) bool {
+ cItem := FabricVLANToSSIDMappingsSsidDetails{}
+ if ccValue := cv.Get("name"); ccValue.Exists() {
+ cItem.Name = types.StringValue(ccValue.String())
+ } else {
+ cItem.Name = types.StringNull()
+ }
+ if ccValue := cv.Get("securityGroupTag"); ccValue.Exists() {
+ cItem.SecurityGroupTag = types.StringValue(ccValue.String())
+ } else {
+ cItem.SecurityGroupTag = types.StringNull()
+ }
+ item.SsidDetails = append(item.SsidDetails, cItem)
+ return true
+ })
+ }
+ data.Mappings = append(data.Mappings, item)
+ return true
+ })
+ }
+}
+
+// End of section. //template:end fromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
+func (data *FabricVLANToSSID) updateFromBody(ctx context.Context, res gjson.Result) {
+
+ res = res.Get("response")
+ for i := range data.Mappings {
+ keys := [...]string{"vlanName"}
+ keyValues := [...]string{data.Mappings[i].VlanName.ValueString()}
+
+ var r gjson.Result
+ res.ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ if v.Get(keys[ik]).String() == keyValues[ik] {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ if found {
+ r = v
+ return false
+ }
+ return true
+ },
+ )
+ if value := r.Get("vlanName"); value.Exists() && !data.Mappings[i].VlanName.IsNull() {
+ data.Mappings[i].VlanName = types.StringValue(value.String())
+ } else {
+ data.Mappings[i].VlanName = types.StringNull()
+ }
+ for ci := range data.Mappings[i].SsidDetails {
+ keys := [...]string{"name", "securityGroupTag"}
+ keyValues := [...]string{data.Mappings[i].SsidDetails[ci].Name.ValueString(), data.Mappings[i].SsidDetails[ci].SecurityGroupTag.ValueString()}
+
+ var cr gjson.Result
+ r.Get("ssidDetails").ForEach(
+ func(_, v gjson.Result) bool {
+ found := false
+ for ik := range keys {
+ if v.Get(keys[ik]).String() == keyValues[ik] {
+ found = true
+ continue
+ }
+ found = false
+ break
+ }
+ if found {
+ cr = v
+ return false
+ }
+ return true
+ },
+ )
+ if value := cr.Get("name"); value.Exists() && !data.Mappings[i].SsidDetails[ci].Name.IsNull() {
+ data.Mappings[i].SsidDetails[ci].Name = types.StringValue(value.String())
+ } else {
+ data.Mappings[i].SsidDetails[ci].Name = types.StringNull()
+ }
+ if value := cr.Get("securityGroupTag"); value.Exists() && !data.Mappings[i].SsidDetails[ci].SecurityGroupTag.IsNull() {
+ data.Mappings[i].SsidDetails[ci].SecurityGroupTag = types.StringValue(value.String())
+ } else {
+ data.Mappings[i].SsidDetails[ci].SecurityGroupTag = types.StringNull()
+ }
+ }
+ }
+}
+
+// End of section. //template:end updateFromBody
+
+// Section below is generated&owned by "gen/generator.go". //template:begin isNull
+func (data *FabricVLANToSSID) isNull(ctx context.Context, res gjson.Result) bool {
+ if len(data.Mappings) > 0 {
+ return false
+ }
+ return true
+}
+
+// End of section. //template:end isNull
diff --git a/internal/provider/model_catalystcenter_pnp_import_devices.go b/internal/provider/model_catalystcenter_pnp_import_devices.go
index d3c9cca..97f9017 100644
--- a/internal/provider/model_catalystcenter_pnp_import_devices.go
+++ b/internal/provider/model_catalystcenter_pnp_import_devices.go
@@ -89,6 +89,7 @@ func (data PnPImportDevices) toBody(ctx context.Context, state PnPImportDevices)
// Section below is generated&owned by "gen/generator.go". //template:begin fromBody
func (data *PnPImportDevices) fromBody(ctx context.Context, res gjson.Result) {
+
if value := res; value.Exists() && len(value.Array()) > 0 {
data.Devices = make([]PnPImportDevicesDevices, 0)
value.ForEach(func(k, v gjson.Result) bool {
@@ -123,6 +124,7 @@ func (data *PnPImportDevices) fromBody(ctx context.Context, res gjson.Result) {
// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody
func (data *PnPImportDevices) updateFromBody(ctx context.Context, res gjson.Result) {
+
for i := range data.Devices {
keys := [...]string{"deviceInfo.serialNumber", "deviceInfo.stack", "deviceInfo.pid", "deviceInfo.hostname"}
keyValues := [...]string{data.Devices[i].SerialNumber.ValueString(), strconv.FormatBool(data.Devices[i].Stack.ValueBool()), data.Devices[i].Pid.ValueString(), data.Devices[i].Hostname.ValueString()}
diff --git a/internal/provider/provider.go b/internal/provider/provider.go
index 4f4db7d..815c978 100644
--- a/internal/provider/provider.go
+++ b/internal/provider/provider.go
@@ -261,6 +261,7 @@ func (p *CcProvider) Resources(ctx context.Context) []func() resource.Resource {
NewFabricProvisionDeviceResource,
NewFabricSiteResource,
NewFabricVirtualNetworkResource,
+ NewFabricVLANToSSIDResource,
NewFloorResource,
NewImageResource,
NewImageActivationResource,
@@ -314,6 +315,7 @@ func (p *CcProvider) DataSources(ctx context.Context) []func() datasource.DataSo
NewFabricProvisionDeviceDataSource,
NewFabricSiteDataSource,
NewFabricVirtualNetworkDataSource,
+ NewFabricVLANToSSIDDataSource,
NewFloorDataSource,
NewIPPoolDataSource,
NewIPPoolReservationDataSource,
diff --git a/internal/provider/resource_catalystcenter_fabric_vlan_to_ssid.go b/internal/provider/resource_catalystcenter_fabric_vlan_to_ssid.go
new file mode 100644
index 0000000..c793c93
--- /dev/null
+++ b/internal/provider/resource_catalystcenter_fabric_vlan_to_ssid.go
@@ -0,0 +1,262 @@
+// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
+// All rights reserved.
+//
+// Licensed under the Mozilla Public License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://mozilla.org/MPL/2.0/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: MPL-2.0
+
+package provider
+
+// Section below is generated&owned by "gen/generator.go". //template:begin imports
+import (
+ "context"
+ "fmt"
+ "strings"
+
+ "github.com/CiscoDevNet/terraform-provider-catalystcenter/internal/provider/helpers"
+ "github.com/hashicorp/terraform-plugin-framework/path"
+ "github.com/hashicorp/terraform-plugin-framework/resource"
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema"
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/hashicorp/terraform-plugin-log/tflog"
+ cc "github.com/netascode/go-catalystcenter"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin model
+
+// Ensure provider defined types fully satisfy framework interfaces
+var _ resource.Resource = &FabricVLANToSSIDResource{}
+var _ resource.ResourceWithImportState = &FabricVLANToSSIDResource{}
+
+func NewFabricVLANToSSIDResource() resource.Resource {
+ return &FabricVLANToSSIDResource{}
+}
+
+type FabricVLANToSSIDResource struct {
+ client *cc.Client
+}
+
+func (r *FabricVLANToSSIDResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
+ resp.TypeName = req.ProviderTypeName + "_fabric_vlan_to_ssid"
+}
+
+func (r *FabricVLANToSSIDResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
+ resp.Schema = schema.Schema{
+ // This description is used by the documentation generator and the language server.
+ MarkdownDescription: helpers.NewAttributeDescription("Add, update, or remove SSID mappings to a VLAN. If the payload doesn't contain a 'vlanName' which has SSIDs mapping done earlier then all the mapped SSIDs of the 'vlanName' is cleared. The request must include all SSIDs currently mapped to a VLAN, as determined by the response from the GET operation for the same fabricId used in the request. If an already-mapped SSID is not included in the payload, its mapping will be removed by this API. Conversely, if a new SSID is provided, it will be added to the Mapping. Ensure that any new SSID added is a Fabric SSID. This API can also be used to add a VLAN and associate the relevant SSIDs with it. The 'vlanName' must be 'Fabric Wireless Enabled' and should be part of the Fabric Site representing 'Fabric ID' specified in the API request").String,
+
+ Attributes: map[string]schema.Attribute{
+ "id": schema.StringAttribute{
+ MarkdownDescription: "The id of the object",
+ Computed: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.UseStateForUnknown(),
+ },
+ },
+ "fabric_id": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Fabric ID").String,
+ Required: true,
+ PlanModifiers: []planmodifier.String{
+ stringplanmodifier.RequiresReplace(),
+ },
+ },
+ "mappings": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("List of VLAN to SSID mappings").String,
+ Required: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "vlan_name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("VLAN Name").String,
+ Required: true,
+ },
+ "ssid_details": schema.ListNestedAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("SSID Details").String,
+ Optional: true,
+ NestedObject: schema.NestedAttributeObject{
+ Attributes: map[string]schema.Attribute{
+ "name": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Name of the SSID").String,
+ Optional: true,
+ },
+ "security_group_tag": schema.StringAttribute{
+ MarkdownDescription: helpers.NewAttributeDescription("Represents the name of the Security Group. Example: Auditors, BYOD, Developers, etc.").String,
+ Optional: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func (r *FabricVLANToSSIDResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) {
+ if req.ProviderData == nil {
+ return
+ }
+
+ r.client = req.ProviderData.(*CcProviderData).Client
+}
+
+// End of section. //template:end model
+
+// Section below is generated&owned by "gen/generator.go". //template:begin create
+func (r *FabricVLANToSSIDResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
+ var plan FabricVLANToSSID
+
+ // Read plan
+ diags := req.Plan.Get(ctx, &plan)
+ resp.Diagnostics.Append(diags...)
+ if resp.Diagnostics.HasError() {
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.Id.ValueString()))
+
+ // Create object
+ body := plan.toBody(ctx, FabricVLANToSSID{})
+
+ params := ""
+ res, err := r.client.Put(plan.getPath()+params, body)
+ if err != nil {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (POST), got error: %s, %s", err, res.String()))
+ return
+ }
+ plan.Id = types.StringValue(fmt.Sprint(plan.FabricId.ValueString()))
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Create finished successfully", plan.Id.ValueString()))
+
+ diags = resp.State.Set(ctx, &plan)
+ resp.Diagnostics.Append(diags...)
+}
+
+// End of section. //template:end create
+
+// Section below is generated&owned by "gen/generator.go". //template:begin read
+func (r *FabricVLANToSSIDResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
+ var state FabricVLANToSSID
+
+ // Read state
+ diags := req.State.Get(ctx, &state)
+ resp.Diagnostics.Append(diags...)
+ if resp.Diagnostics.HasError() {
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Id.String()))
+
+ params := ""
+ res, err := r.client.Get(state.getPath() + params)
+ if err != nil && strings.Contains(err.Error(), "StatusCode 404") {
+ resp.State.RemoveResource(ctx)
+ return
+ } else if err != nil {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object (GET), got error: %s, %s", err, res.String()))
+ return
+ }
+
+ // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes
+ if state.isNull(ctx, res) {
+ state.fromBody(ctx, res)
+ } else {
+ state.updateFromBody(ctx, res)
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString()))
+
+ diags = resp.State.Set(ctx, &state)
+ resp.Diagnostics.Append(diags...)
+}
+
+// End of section. //template:end read
+
+// Section below is generated&owned by "gen/generator.go". //template:begin update
+func (r *FabricVLANToSSIDResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
+ var plan, state FabricVLANToSSID
+
+ // Read plan
+ diags := req.Plan.Get(ctx, &plan)
+ resp.Diagnostics.Append(diags...)
+ if resp.Diagnostics.HasError() {
+ return
+ }
+ // Read state
+ diags = req.State.Get(ctx, &state)
+ resp.Diagnostics.Append(diags...)
+ if resp.Diagnostics.HasError() {
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.Id.ValueString()))
+
+ body := plan.toBody(ctx, state)
+ params := ""
+ res, err := r.client.Put(plan.getPath()+params, body)
+ if err != nil {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String()))
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Update finished successfully", plan.Id.ValueString()))
+
+ diags = resp.State.Set(ctx, &plan)
+ resp.Diagnostics.Append(diags...)
+}
+
+// End of section. //template:end update
+
+func (r *FabricVLANToSSIDResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
+ var state FabricVLANToSSID
+
+ // Read state
+ diags := req.State.Get(ctx, &state)
+ resp.Diagnostics.Append(diags...)
+ if resp.Diagnostics.HasError() {
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Id.ValueString()))
+ body := "[]" // Empty body
+ res, err := r.client.Put(state.getPath(), body)
+ if err != nil {
+ resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (DELETE), got error: %s, %s", err, res.String()))
+ return
+ }
+
+ tflog.Debug(ctx, fmt.Sprintf("%s: Delete finished successfully", state.Id.ValueString()))
+
+ resp.State.RemoveResource(ctx)
+}
+
+// Section below is generated&owned by "gen/generator.go". //template:begin import
+func (r *FabricVLANToSSIDResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
+ idParts := strings.Split(req.ID, ",")
+
+ if len(idParts) != 1 || idParts[0] == "" {
+ resp.Diagnostics.AddError(
+ "Unexpected Import Identifier",
+ fmt.Sprintf("Expected import identifier with format: . Got: %q", req.ID),
+ )
+ return
+ }
+ resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("fabric_id"), idParts[0])...)
+ resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), idParts[0])...)
+}
+
+// End of section. //template:end import
diff --git a/internal/provider/resource_catalystcenter_fabric_vlan_to_ssid_test.go b/internal/provider/resource_catalystcenter_fabric_vlan_to_ssid_test.go
new file mode 100644
index 0000000..9c4f650
--- /dev/null
+++ b/internal/provider/resource_catalystcenter_fabric_vlan_to_ssid_test.go
@@ -0,0 +1,87 @@
+// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
+// All rights reserved.
+//
+// Licensed under the Mozilla Public License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// https://mozilla.org/MPL/2.0/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: MPL-2.0
+
+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"
+)
+
+// End of section. //template:end imports
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAcc
+func TestAccCcFabricVLANToSSID(t *testing.T) {
+ if os.Getenv("WIRELESS") == "" {
+ t.Skip("skipping test, set environment variable WIRELESS")
+ }
+ var checks []resource.TestCheckFunc
+ checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_fabric_vlan_to_ssid.test", "fabric_id", "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"))
+ checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_fabric_vlan_to_ssid.test", "mappings.0.vlan_name", "VLAN_1"))
+ checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_fabric_vlan_to_ssid.test", "mappings.0.ssid_details.0.name", "mySSID1"))
+ checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_fabric_vlan_to_ssid.test", "mappings.0.ssid_details.0.security_group_tag", "Auditors"))
+
+ var steps []resource.TestStep
+ steps = append(steps, resource.TestStep{
+ Config: testAccCcFabricVLANToSSIDConfig_all(),
+ Check: resource.ComposeTestCheckFunc(checks...),
+ })
+
+ resource.Test(t, resource.TestCase{
+ PreCheck: func() { testAccPreCheck(t) },
+ ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
+ Steps: steps,
+ })
+}
+
+// End of section. //template:end testAcc
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites
+// End of section. //template:end testPrerequisites
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimal
+func testAccCcFabricVLANToSSIDConfig_minimum() string {
+ config := `resource "catalystcenter_fabric_vlan_to_ssid" "test" {` + "\n"
+ config += ` fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"` + "\n"
+ config += ` mappings = [{` + "\n"
+ config += ` vlan_name = "VLAN_1"` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigMinimal
+
+// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
+func testAccCcFabricVLANToSSIDConfig_all() string {
+ config := `resource "catalystcenter_fabric_vlan_to_ssid" "test" {` + "\n"
+ config += ` fabric_id = "5e8e3e3e-1b6b-4b6b-8b6b-1b6b4b6b8b6b"` + "\n"
+ config += ` mappings = [{` + "\n"
+ config += ` vlan_name = "VLAN_1"` + "\n"
+ config += ` ssid_details = [{` + "\n"
+ config += ` name = "mySSID1"` + "\n"
+ config += ` security_group_tag = "Auditors"` + "\n"
+ config += ` }]` + "\n"
+ config += ` }]` + "\n"
+ config += `}` + "\n"
+ return config
+}
+
+// End of section. //template:end testAccConfigAll
diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl
index 82fd486..9a96d16 100644
--- a/templates/guides/changelog.md.tmpl
+++ b/templates/guides/changelog.md.tmpl
@@ -7,6 +7,10 @@ description: |-
# Changelog
+## 0.1.11 (unreleased)
+
+- Add `catalystcenter_fabric_vlan_to_ssid` resource and data source
+
## 0.1.10
- Add `catalystcenter_fabric_l2_handoff` resource and data source
@@ -21,8 +25,8 @@ description: |-
- Add `transitPeerNetworkId` as `id` to `catalystcenter_transit_peer_network` resource
- Add `catalystcenter_anycast_gateway` resource and data source, this resource now only works with Catalyst Center version 2.3.7.5+
- BREAKING CHANGE: Modified `catalystcenter_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
+- Fix issue with mandatory attributes in `catalystcenter_transit_peer_network` resource, [link](https://github.com/CiscoDevNet/terraform-provider-catalystcenter/issues/92)
+- BREAKING CHANGE: Fix `catalystcenter_ip_pool` update if more than 25 pools are registered
- BREAKING CHANGE: Rename `radio_type_a_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_a_power_threshold_v1`
- BREAKING CHANGE: Rename `radio_type_b_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_b_power_threshold_v1`
- BREAKING CHANGE: Rename `radio_type_c_power_treshold_v1` attribute of `catalystcenter_wireless_rf_profile` resource to `radio_type_c_power_threshold_v1`