diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 993e6eaf..fb73f938 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,7 @@ on: schedule: - cron: '0 13 * * 1-5' # UTC + workflow_dispatch: jobs: zpa-qa-tenant01: diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a760403..38c9df66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.0.3 (October, xx 2023) + +### Notes + +- Release date: **(October, xx 2023)** +- Supported Terraform version: **v1.x** + +### Fixes + +- [PR #375](https://github.com/zscaler/terraform-provider-zpa/pull/375) - Fixed drift issues in ``zpa_application_segment_pra`` and ``zpa_application_segment_inspection`` when setting up ``apps_config`` options. +- [PR #375](https://github.com/zscaler/terraform-provider-zpa/pull/375) - Upgrade to [Zscaler-SDK-GO v2.1.3](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v2.1.3). The upgrade allows searches for resources in which the name include 1 or more spaces. + + ## 3.0.2 (September, 30 2023) ### Notes diff --git a/GNUmakefile b/GNUmakefile index cb6d1096..6922fc78 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,15 +46,15 @@ testacc: build13: GOOS=$(shell go env GOOS) build13: GOARCH=$(shell go env GOARCH) ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... -build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.0.2/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.0.3/$(GOOS)_$(GOARCH) else -build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.0.2/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.0.3/$(GOOS)_$(GOARCH) endif build13: fmtcheck go mod tidy && go mod vendor @echo "==> Installing plugin to $(DESTINATION)" @mkdir -p $(DESTINATION) - go build -o $(DESTINATION)/terraform-provider-zpa_v3.0.2 + go build -o $(DESTINATION)/terraform-provider-zpa_v3.0.3 lint: vendor @echo "✓ Linting source code with https://staticcheck.io/ ..." diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index afd9ff5d..8c933a96 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -12,10 +12,22 @@ Track all ZPA Terraform provider's releases. New resources, features, and bug fi --- -``Last updated: v3.0.2`` +``Last updated: v3.0.3`` --- +## 3.0.3 (October, xx 2023) + +### Notes + +- Release date: **(October, xx 2023)** +- Supported Terraform version: **v1.x** + +### Fixes + +- [PR #375](https://github.com/zscaler/terraform-provider-zpa/pull/375) - Fixed drift issues in ``zpa_application_segment_pra`` and ``zpa_application_segment_inspection`` when setting up ``apps_config`` options. +- [PR #375](https://github.com/zscaler/terraform-provider-zpa/pull/375) - Upgrade to [Zscaler-SDK-GO v2.1.3](https://github.com/zscaler/zscaler-sdk-go/releases/tag/v2.1.3). The upgrade allows searches for resources in which the name include 1 or more spaces. + ## 3.0.2 (September, 30 2023) ### Notes diff --git a/docs/resources/zpa_application_segment_inspection.md b/docs/resources/zpa_application_segment_inspection.md index 24eb081f..39086d6a 100644 --- a/docs/resources/zpa_application_segment_inspection.md +++ b/docs/resources/zpa_application_segment_inspection.md @@ -59,7 +59,7 @@ The following arguments are supported: * `application_protocol` - (Required) Protocol for the Inspection Application Segment.. Supported values: `HTTP` and `HTTPS` * `application_port` - (Required) Port for the Inspection Application Segment. * `app_types` - (Required) Indicates the type of application as inspection. Supported value: `INSPECT` - * `certificate_id` - (string) - ID of the signing certificate. This field is required if the applicationProtocol is set to `HTTPS`. The certificateId is not supported if the applicationProtocol is set to `HTTP`. + * `certificate_id` - (string) - ID of the signing certificate. This field is required if the ``application_protocol`` is set to `HTTPS`. The ``certificate_id`` is **NOT** supported if the application_protocol is set to `HTTP`. * `enabled` - (Optional) Whether this application is enabled or not * `tcp_port_ranges` - (Required) TCP port ranges used to access the app. * `udp_port_ranges` - (Required) UDP port ranges used to access the app. diff --git a/go.mod b/go.mod index a9308cdb..45ba6720 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/terraform-plugin-docs v0.16.0 github.com/hashicorp/terraform-plugin-sdk v1.17.2 github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 - github.com/zscaler/zscaler-sdk-go/v2 v2.1.1 + github.com/zscaler/zscaler-sdk-go/v2 v2.1.3 ) require ( diff --git a/go.sum b/go.sum index 6d0fcf2d..dc85db9b 100644 --- a/go.sum +++ b/go.sum @@ -401,8 +401,8 @@ github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -github.com/zscaler/zscaler-sdk-go/v2 v2.1.1 h1:7PpU0fLUCJIx8R8ZIMnjwrWBrQPG6mtm2wdyRgmSlEE= -github.com/zscaler/zscaler-sdk-go/v2 v2.1.1/go.mod h1:PQscsdJVbmOXn7xqkRz3MdwYrt2UGHg37ZlON77iptg= +github.com/zscaler/zscaler-sdk-go/v2 v2.1.3 h1:DKFlvNVGXGgHTQjggj0kFs7S9IGGoP2ICc+svbn8E4A= +github.com/zscaler/zscaler-sdk-go/v2 v2.1.3/go.mod h1:PQscsdJVbmOXn7xqkRz3MdwYrt2UGHg37ZlON77iptg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= diff --git a/zpa/data_source_zpa_machine_group_test.go b/zpa/data_source_zpa_machine_group_test.go index 0011a2bd..f529f618 100644 --- a/zpa/data_source_zpa_machine_group_test.go +++ b/zpa/data_source_zpa_machine_group_test.go @@ -1,40 +1,60 @@ package zpa import ( + "fmt" + "strings" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) +var machineGroupNames = []string{ + "BD-MGR01", "BD-MGR02", "BD MGR 03", "BD MGR 04", "BD MGR 05", + "BD MGR06", "BD MGR 07", "BD M GR 08", "BD M GR 09", +} + func TestAccDataSourceMachineGroup_Basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckDataSourceMachineGroup_basic, + Config: testAccCheckDataSourceMachineGroup_basic(), Check: resource.ComposeTestCheckFunc( - testAccDataSourceMachineGroupCheck("data.zpa_machine_group.bd_mgr01"), - testAccDataSourceMachineGroupCheck("data.zpa_machine_group.bd_mgr02"), + generateMachineGroupChecks()..., ), }, }, }) } -func testAccDataSourceMachineGroupCheck(name string) resource.TestCheckFunc { - return resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrSet(name, "id"), - resource.TestCheckResourceAttrSet(name, "name"), - ) +func generateMachineGroupChecks() []resource.TestCheckFunc { + var checks []resource.TestCheckFunc + for _, name := range machineGroupNames { + resourceName := createValidResourceName(name) + checkName := fmt.Sprintf("data.zpa_machine_group.%s", resourceName) + checks = append(checks, resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(checkName, "id"), + resource.TestCheckResourceAttrSet(checkName, "name"), + )) + } + return checks } -var testAccCheckDataSourceMachineGroup_basic = ` -data "zpa_machine_group" "bd_mgr01" { - name = "BD-MGR01" +func testAccCheckDataSourceMachineGroup_basic() string { + var configs string + for _, name := range machineGroupNames { + resourceName := createValidResourceName(name) + configs += fmt.Sprintf(` +data "zpa_machine_group" "%s" { + name = "%s" +} +`, resourceName, name) + } + return configs } -data "zpa_machine_group" "bd_mgr02" { - name = "BD-MGR02" +// createValidResourceName converts the given name to a valid Terraform resource name +func createValidResourceName(name string) string { + return strings.ReplaceAll(name, " ", "_") } -` diff --git a/zpa/resource_zpa_application_segment_inspection.go b/zpa/resource_zpa_application_segment_inspection.go index f946e11a..2bb37c23 100644 --- a/zpa/resource_zpa_application_segment_inspection.go +++ b/zpa/resource_zpa_application_segment_inspection.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" client "github.com/zscaler/zscaler-sdk-go/v2/zpa" "github.com/zscaler/zscaler-sdk-go/v2/zpa/services/applicationsegmentinspection" + "github.com/zscaler/zscaler-sdk-go/v2/zpa/services/common" "github.com/zscaler/zscaler-sdk-go/v2/zpa/services/segmentgroup" ) @@ -188,52 +189,41 @@ func resourceApplicationSegmentInspection() *schema.Resource { }, false), }, "common_apps_dto": { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, - Computed: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "apps_config": { Type: schema.TypeSet, - Computed: true, Optional: true, + ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "allow_options": { - Type: schema.TypeBool, - Computed: true, + "name": { + Type: schema.TypeString, Optional: true, }, - "app_id": { + "description": { Type: schema.TypeString, - Computed: true, Optional: true, }, - "id": { - Type: schema.TypeString, - Computed: true, + "enabled": { + Type: schema.TypeBool, Optional: true, }, "app_types": { Type: schema.TypeSet, - Computed: true, Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "INSPECT", - }, false), - }, + Elem: &schema.Schema{Type: schema.TypeString}, }, "application_port": { Type: schema.TypeString, - Computed: true, Optional: true, }, "application_protocol": { Type: schema.TypeString, - Computed: true, Optional: true, ValidateFunc: validation.StringInSlice([]string{ "HTTP", @@ -242,58 +232,15 @@ func resourceApplicationSegmentInspection() *schema.Resource { }, "certificate_id": { Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "certificate_name": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "cname": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, Optional: true, }, "domain": { Type: schema.TypeString, - Computed: true, Optional: true, }, - "enabled": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - }, - "hidden": { - Type: schema.TypeBool, - Computed: true, - Optional: true, - }, - "local_domain": { - Type: schema.TypeString, - Computed: true, - Optional: true, - }, - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "portal": { - Type: schema.TypeBool, - Optional: true, - Computed: true, - }, "trust_untrusted_cert": { Type: schema.TypeBool, Optional: true, - Computed: true, }, }, }, @@ -330,7 +277,9 @@ func resourceApplicationSegmentInspectionCreate(d *schema.ResourceData, m interf if err := validateAppPorts(req.SelectConnectorCloseToApp, req.UDPAppPortRange, req.UDPPortRanges); err != nil { return err } - + if err := validateProtocolAndCertID(d); err != nil { + return err + } log.Printf("[INFO] Creating application segment request\n%+v\n", req) if req.SegmentGroupID == "" { log.Println("[ERROR] Please provide a valid segment group for the application segment") @@ -361,7 +310,7 @@ func resourceApplicationSegmentInspectionRead(d *schema.ResourceData, m interfac return err } - log.Printf("[INFO] Getting inspection application segment:\n%+v\n", resp) + log.Printf("[INFO] Getting sra application segment:\n%+v\n", resp) d.SetId(resp.ID) _ = d.Set("segment_group_id", resp.SegmentGroupID) _ = d.Set("segment_group_name", resp.SegmentGroupName) @@ -376,18 +325,17 @@ func resourceApplicationSegmentInspectionRead(d *schema.ResourceData, m interfac _ = d.Set("health_check_type", resp.HealthCheckType) _ = d.Set("is_cname_enabled", resp.IsCnameEnabled) _ = d.Set("icmp_access_type", resp.ICMPAccessType) - _ = d.Set("ip_anchored", resp.IPAnchored) - _ = d.Set("health_reporting", resp.HealthReporting) _ = d.Set("select_connector_close_to_app", resp.SelectConnectorCloseToApp) _ = d.Set("use_in_dr_mode", resp.UseInDrMode) _ = d.Set("is_incomplete_dr_config", resp.IsIncompleteDRConfig) - _ = d.Set("is_cname_enabled", resp.IsCnameEnabled) _ = d.Set("tcp_keep_alive", resp.TCPKeepAlive) - _ = d.Set("tcp_port_ranges", resp.TCPPortRanges) - _ = d.Set("udp_port_ranges", resp.UDPPortRanges) + _ = d.Set("ip_anchored", resp.IPAnchored) + _ = d.Set("health_reporting", resp.HealthReporting) + _ = d.Set("tcp_port_ranges", convertPortsToListString(resp.TCPAppPortRange)) + _ = d.Set("udp_port_ranges", convertPortsToListString(resp.UDPAppPortRange)) _ = d.Set("server_groups", flattenInspectionAppServerGroupsSimple(resp.AppServerGroups)) - if err := d.Set("common_apps_dto", flattenInspectionCommonAppsDto(resp.InspectionAppDto)); err != nil { + if err := d.Set("common_apps_dto", flattenInspectionCommonAppsDto(d, resp.InspectionAppDto)); err != nil { return fmt.Errorf("failed to read common application in application segment %s", err) } @@ -398,9 +346,7 @@ func resourceApplicationSegmentInspectionRead(d *schema.ResourceData, m interfac if err := d.Set("tcp_port_range", flattenNetworkPorts(resp.UDPAppPortRange)); err != nil { return err } - return nil - } func flattenInspectionAppServerGroupsSimple(serverGroup []applicationsegmentinspection.AppServerGroups) []interface{} { @@ -430,7 +376,9 @@ func resourceApplicationSegmentInspectionUpdate(d *schema.ResourceData, m interf log.Println("[ERROR] Please provide a valid segment group for the inspection application segment") return fmt.Errorf("please provide a valid segment group for the inspection application segment") } - + if err := validateProtocolAndCertID(d); err != nil { + return err + } if _, _, err := zClient.applicationsegmentinspection.Get(id); err != nil { if respErr, ok := err.(*client.ErrorResponse); ok && respErr.IsObjectNotFound() { d.SetId("") @@ -495,18 +443,18 @@ func expandInspectionApplicationSegment(d *schema.ResourceData, zClient *Client, Description: d.Get("description").(string), HealthReporting: d.Get("health_reporting").(string), HealthCheckType: d.Get("health_check_type").(string), - TCPKeepAlive: d.Get("tcp_keep_alive").(string), + PassiveHealthEnabled: d.Get("passive_health_enabled").(bool), DoubleEncrypt: d.Get("double_encrypt").(bool), Enabled: d.Get("enabled").(bool), - PassiveHealthEnabled: d.Get("passive_health_enabled").(bool), IPAnchored: d.Get("ip_anchored").(bool), IsCnameEnabled: d.Get("is_cname_enabled").(bool), SelectConnectorCloseToApp: d.Get("select_connector_close_to_app").(bool), UseInDrMode: d.Get("use_in_dr_mode").(bool), + TCPKeepAlive: d.Get("tcp_keep_alive").(string), IsIncompleteDRConfig: d.Get("is_incomplete_dr_config").(bool), DomainNames: expandStringInSlice(d, "domain_names"), - TCPPortRanges: expandList(d.Get("tcp_port_ranges").([]interface{})), - UDPPortRanges: expandList(d.Get("udp_port_ranges").([]interface{})), + TCPAppPortRange: []common.NetworkPorts{}, + UDPAppPortRange: []common.NetworkPorts{}, AppServerGroups: expandInspectionAppServerGroups(d), CommonAppsDto: expandInspectionCommonAppsDto(d), } @@ -560,11 +508,11 @@ func expandInspectionCommonAppsDto(d *schema.ResourceData) applicationsegmentins if !ok { return result } - appsConfigList, ok := appsConfigInterface.([]interface{}) + appsConfigList, ok := appsConfigInterface.(*schema.Set) if !ok { return result } - for _, appconf := range appsConfigList { + for _, appconf := range appsConfigList.List() { appConfMap, ok := appconf.(map[string]interface{}) if !ok { return result @@ -590,21 +538,14 @@ func expandInspectionAppsConfig(appsConfigInterface interface{}) []applicationse } appTypes := SetToStringSlice(appTypesSet) commonAppConfigDto = append(commonAppConfigDto, applicationsegmentinspection.AppsConfig{ - AllowOptions: commonAppConfig["allow_options"].(bool), - AppID: commonAppConfig["app_id"].(string), - ID: commonAppConfig["id"].(string), + Name: commonAppConfig["name"].(string), + Description: commonAppConfig["description"].(string), + Enabled: commonAppConfig["enabled"].(bool), ApplicationPort: commonAppConfig["application_port"].(string), ApplicationProtocol: commonAppConfig["application_protocol"].(string), CertificateID: commonAppConfig["certificate_id"].(string), - CertificateName: commonAppConfig["certificate_name"].(string), - Cname: commonAppConfig["cname"].(string), - Description: commonAppConfig["description"].(string), Domain: commonAppConfig["domain"].(string), - Enabled: commonAppConfig["enabled"].(bool), - Hidden: commonAppConfig["hidden"].(bool), - LocalDomain: commonAppConfig["local_domain"].(string), - Name: commonAppConfig["name"].(string), - Portal: commonAppConfig["portal"].(bool), + TrustUntrustedCert: commonAppConfig["trust_untrusted_cert"].(bool), AppTypes: appTypes, }) } @@ -634,31 +575,55 @@ func expandInspectionAppServerGroups(d *schema.ResourceData) []applicationsegmen return []applicationsegmentinspection.AppServerGroups{} } -func flattenInspectionCommonAppsDto(apps []applicationsegmentinspection.InspectionAppDto) []interface{} { +func flattenInspectionCommonAppsDto(d *schema.ResourceData, apps []applicationsegmentinspection.InspectionAppDto) []interface{} { commonApp := make([]interface{}, 1) commonApp[0] = map[string]interface{}{ - "apps_config": flattenInspectionAppsConfig(apps), + "apps_config": flattenInspectionAppsConfig(d, apps), } return commonApp } -func flattenInspectionAppsConfig(appConfigs []applicationsegmentinspection.InspectionAppDto) []interface{} { +func flattenInspectionAppsConfig(d *schema.ResourceData, appConfigs []applicationsegmentinspection.InspectionAppDto) []interface{} { + cApp := expandInspectionCommonAppsDto(d) + appConfig := make([]interface{}, len(appConfigs)) for i, val := range appConfigs { + appTypes := []string{} + for _, a := range cApp.AppsConfig { + if a.Name == val.Name { + appTypes = a.AppTypes + } + } appConfig[i] = map[string]interface{}{ "name": val.Name, - "id": val.ID, - "app_id": val.AppID, - "application_port": val.ApplicationPort, - "application_protocol": val.ApplicationProtocol, - "certificate_id": val.CertificateID, - "certificate_name": val.CertificateName, "description": val.Description, - "domain": val.Domain, "enabled": val.Enabled, - "hidden": val.Hidden, - "portal": val.Portal, + "domain": val.Domain, + "application_port": val.ApplicationPort, + "certificate_id": val.CertificateID, + "application_protocol": val.ApplicationProtocol, + "trust_untrusted_cert": val.TrustUntrustedCert, + "app_types": appTypes, } } return appConfig } + +func validateProtocolAndCertID(d *schema.ResourceData) error { + commonAppsDto, ok := d.Get("common_apps_dto").([]interface{}) + if !ok || len(commonAppsDto) == 0 { + return nil // or handle it as per your logic + } + + appsConfig := commonAppsDto[0].(map[string]interface{})["apps_config"].(*schema.Set).List() + for _, config := range appsConfig { + appConfig := config.(map[string]interface{}) + protocol := appConfig["application_protocol"].(string) + certID := appConfig["certificate_id"].(string) + + if protocol == "HTTP" && certID != "" { + return fmt.Errorf("certificate ID should not be set when application protocol is HTTP") + } + } + return nil +} diff --git a/zpa/resource_zpa_application_segment_pra.go b/zpa/resource_zpa_application_segment_pra.go index f9407288..e02293b1 100644 --- a/zpa/resource_zpa_application_segment_pra.go +++ b/zpa/resource_zpa_application_segment_pra.go @@ -194,39 +194,46 @@ func resourceApplicationSegmentPRA() *schema.Resource { "common_apps_dto": { Type: schema.TypeSet, Optional: true, - // Computed: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "apps_config": { - Type: schema.TypeSet, - // Computed: true, + Type: schema.TypeSet, + ForceNew: true, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, - // Computed: true, + ForceNew: true, + }, + "description": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, }, "enabled": { - Type: schema.TypeBool, - // Computed: true, + Type: schema.TypeBool, + ForceNew: true, Optional: true, }, "app_types": { - Type: schema.TypeSet, - // Computed: true, + Type: schema.TypeSet, Optional: true, + ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, "application_port": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "application_protocol": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ "RDP", "SSH", @@ -235,6 +242,7 @@ func resourceApplicationSegmentPRA() *schema.Resource { "connection_security": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ "ANY", "NLA", @@ -247,6 +255,7 @@ func resourceApplicationSegmentPRA() *schema.Resource { "domain": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, }, }, @@ -353,9 +362,7 @@ func resourceApplicationSegmentPRARead(d *schema.ResourceData, m interface{}) er if err := d.Set("udp_port_range", flattenNetworkPorts(resp.UDPAppPortRange)); err != nil { return err } - return nil - } func flattenPRAAppServerGroupsSimple(serverGroup []applicationsegmentpra.AppServerGroups) []interface{} { @@ -550,6 +557,7 @@ func expandAppsConfig(appsConfigInterface interface{}) []applicationsegmentpra.A appTypes := SetToStringSlice(appTypesSet) commonAppConfigDto = append(commonAppConfigDto, applicationsegmentpra.AppsConfig{ Name: commonAppConfig["name"].(string), + Description: commonAppConfig["description"].(string), Enabled: commonAppConfig["enabled"].(bool), Domain: commonAppConfig["domain"].(string), ApplicationPort: commonAppConfig["application_port"].(string),