diff --git a/CHANGELOG.md b/CHANGELOG.md index 88494ed0..3763c859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 2.7.32 (February, 28 2024) + +### Notes + +- Release date: **(February, 28 2024)** +- Supported Terraform version: **v1.x** + +### Fixes + +- [PR #322](https://github.com/zscaler/terraform-provider-zia/pull/322) - Fixed validation `zia_url_filtering_rules` resource to validate `protocols` attribute to accept `HTTP_RULE` and `HTTPS_RULE`. +- [PR #322](https://github.com/zscaler/terraform-provider-zia/pull/322) - Fixed validation `zia_url_filtering_rules` validations for rules with `action` configured as `ISOLATE`. +- [PR #322](https://github.com/zscaler/terraform-provider-zia/pull/322) - Fixed linter issues across several acceptance tests resources and data sources. + ## 2.7.31 (February, 28 2024) ### Notes diff --git a/GNUmakefile b/GNUmakefile index 0bcad589..d4fe9524 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -189,14 +189,14 @@ test\:integration\:zscalertwo: 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/$(ZIA_PROVIDER_NAMESPACE)/2.7.4/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.7.32/$(GOOS)_$(GOARCH) else -build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.7.4/$(GOOS)_$(GOARCH) +build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.7.32/$(GOOS)_$(GOARCH) endif build13: fmtcheck @echo "==> Installing plugin to $(DESTINATION)" @mkdir -p $(DESTINATION) - go build -o $(DESTINATION)/terraform-provider-zia_v2.7.4 + go build -o $(DESTINATION)/terraform-provider-zia_v2.7.32 coverage: test @echo "✓ Opening coverage for unit tests ..." diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index f50bef69..11ef0218 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -12,10 +12,24 @@ description: |- Track all ZIA Terraform provider's releases. New resources, features, and bug fixes will be tracked here. --- -``Last updated: v2.7.31`` +``Last updated: v2.7.32`` --- +## 2.7.32 (February, 28 2024) + +### Notes + +- Release date: **(February, 28 2024)** +- Supported Terraform version: **v1.x** + +### Fixes + +- [PR #322](https://github.com/zscaler/terraform-provider-zia/pull/322) - Fixed validation `zia_url_filtering_rules` resource to validate `protocols` attribute to accept `HTTP_RULE` and `HTTPS_RULE`. +- [PR #322](https://github.com/zscaler/terraform-provider-zia/pull/322) - Fixed validation `zia_url_filtering_rules` validations for rules with `action` configured as `ISOLATE`. +- [PR #322](https://github.com/zscaler/terraform-provider-zia/pull/322) - Fixed linter issues across several acceptance tests resources and data sources. + + ## 2.7.31 (February, 28 2024) ### Notes diff --git a/zia/GNUmakefile b/zia/GNUmakefile deleted file mode 100644 index 7900e45c..00000000 --- a/zia/GNUmakefile +++ /dev/null @@ -1,304 +0,0 @@ -SWEEP?=global -TEST?=$$(go list ./... |grep -v 'vendor') -GOFMT_FILES?=$$(find . -name '*.go' |grep "zia/") -WEBSITE_REPO=github.com/hashicorp/terraform-website -PKG_NAME=zia -GOFMT:=gofumpt -TFPROVIDERLINT=tfproviderlint -STATICCHECK=staticcheck -TF_PLUGIN_DIR=~/.terraform.d/plugins -ZIA_PROVIDER_NAMESPACE=zscaler.com/zia/zia - -# Expression to match against tests -# go test -run -# e.g. Iden will run all TestAccIdentity tests -ifdef TEST_FILTER - TEST_FILTER := -run $(TEST_FILTER) -endif - -TESTARGS?=-test.v - -default: build - -dep: # Download required dependencies - -docs: - go generate - -build: fmtcheck - go install - -clean: - go clean -cache -testcache ./... - -clean-all: - go clean -cache -testcache -modcache ./... - -sweep: - @echo "WARNING: This will destroy infrastructure. Use only in development accounts." - go test $(TEST) -sweep=$(SWEEP) $(SWEEPARGS) - -test: - echo $(TEST) | \ - xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=10 - -testacc: - TF_ACC=1 go test $(TEST) $(TESTARGS) $(TEST_FILTER) -timeout 120m - -# Default set of integration tests to run for ZscalerOne -DEFAULT_INTEGRATION_TESTS?=\ - TestAccDataSourceActivationStatus_Basic \ - TestAccDataSourceAdminRoles_Basic \ - TestAccDataSourceAdminUsers_Basic \ - TestAccDataSourceFWApplicationServicesGroupLite_Basic \ - TestAccDataSourceFWApplicationServicesLite_Basic \ - TestAccDataSourceAuthSettingsUrls_Basic \ - TestAccDataSourceCBIProfile_Basic \ - TestAccDataSourceDeviceGroups_Basic \ - TestAccDataSourceDLPDictionaries_Basic \ - TestAccDataSourceDLPEngines_Basic \ - TestAccDataSourceDLPICAPServers_Basic \ - TestAccDataSourceDLPIncidentReceiverServers_Basic \ - TestAccDataSourceDLPNotificationTemplates_Basic \ - TestAccDataSourceDlpWebRules_Basic \ - TestAccDataSourceFirewallFilteringRule_Basic \ - TestAccDataSourceFWIPDestinationGroups_Basic \ - TestAccDataSourceFWIPSourceGroups_Basic \ - TestAccDataSourceFWNetworkApplicationGroups_Basic \ - TestAccDataSourceFWNetworkServiceGroups_Basic \ - TestAccResourceFWNetworkServicesBasic \ - TestAccDataSourceFWTimeWindow_Basic \ - TestAccDataSourceLocationGroup_Basic \ - TestAccDataSourceLocationLite_Basic \ - TestAccDataSourceLocationManagement_Basic \ - TestAccDataSourceRuleLabels_Basic \ - TestResourceSandboxSettings_basic \ - TestAccDataSourceTrafficGreInternalIPRangeList_Basic \ - TestAccDataSourceTrafficForwardingStaticIP_Basic \ - TestAccDataSourceTrafficForwardingVPNCredentials_Basic \ - TestAccDataSourceURLCategories_Basic \ - TestAccDataSourceURLFilteringRules_Basic \ - TestAccDataSourceDepartmentManagement_Basic \ - TestAccDataSourceGroupManagement_Basic \ - TestAccDataSourceUserManagement_Basic \ - TestAccResourceAdminUsersBasic \ - TestAccResourceAuthSettingsUrls_basic \ - TestAccResourceDLPDictionariesBasic \ - TestAccResourceDLPEnginesBasic \ - TestAccResourceDLPNotificationTemplatesBasic \ - TestAccResourceDlpWebRules_Basic \ - TestAccResourceFirewallFilteringRuleBasic \ - TestAccResourceFWIPDestinationGroupsBasic \ - TestAccResourceFWIPSourceGroupsBasic \ - TestAccResourceFWNetworkApplicationGroupsBasic \ - TestAccResourceFWNetworkServiceGroupsBasic \ - TestAccResourceFWNetworkServicesBasic \ - TestAccResourceLocationManagementBasic \ - TestAccResourceRuleLabelsBasic \ - TestResourceSandboxSettings_basic \ - TestAccResourceSecurityPolicySettings_basic \ - TestAccResourceTrafficForwardingStaticIPBasic \ - TestAccResourceTrafficForwardingVPNCredentialsBasic \ - TestAccResourceURLCategoriesBasic \ - TestAccResourceURLFilteringRulesBasic \ - TestAccResourceUserManagementBasic - -ifeq ($(strip $(INTEGRATION_TESTS)),) - INTEGRATION_TESTS = $(DEFAULT_INTEGRATION_TESTS) -endif - -space := $(subst ,, ) -integration_tests := $(subst $(space),\|,$(INTEGRATION_TESTS)) - -# Target to run integration tests for ZscalerOne -test\:integration\:zscalerone: - @echo "Running integration tests for ZscalerOne..." - @TF_ACC=1 go test -v -cover ./zia -timeout 120m -run ^$(integration_tests)$$ - -# Default set of integration tests to run for ZscalerOne -ZS2_INTEGRATION_TESTS?=\ - TestAccDataSourceActivationStatus_Basic \ - TestAccDataSourceAdminRoles_Basic \ - TestAccDataSourceAdminUsers_Basic \ - TestAccDataSourceFWApplicationServicesGroupLite_Basic \ - TestAccDataSourceFWApplicationServicesLite_Basic \ - TestAccDataSourceAuthSettingsUrls_Basic \ - TestAccDataSourceCBIProfile_Basic \ - TestAccDataSourceDeviceGroups_Basic \ - TestAccDataSourceDLPDictionaries_Basic \ - TestAccDataSourceDLPEngines_Basic \ - TestAccDataSourceDLPICAPServers_Basic \ - TestAccDataSourceDLPIncidentReceiverServers_Basic \ - TestAccDataSourceDLPNotificationTemplates_Basic \ - TestAccDataSourceDlpWebRules_Basic \ - TestAccDataSourceFWIPDestinationGroups_Basic \ - TestAccDataSourceFWIPSourceGroups_Basic \ - TestAccDataSourceFWNetworkApplicationGroups_Basic \ - TestAccDataSourceFWNetworkServiceGroups_Basic \ - TestAccResourceFWNetworkServicesBasic \ - TestAccDataSourceFWTimeWindow_Basic \ - TestAccDataSourceLocationGroup_Basic \ - TestAccDataSourceLocationLite_Basic \ - TestAccDataSourceLocationManagement_Basic \ - TestAccDataSourceRuleLabels_Basic \ - TestResourceSandboxSettings_basic \ - TestAccDataSourceTrafficGreInternalIPRangeList_Basic \ - TestAccDataSourceTrafficForwardingStaticIP_Basic \ - TestAccDataSourceTrafficForwardingVPNCredentials_Basic \ - TestAccDataSourceTrafficForwardingGreTunnels_Basic \ - TestAccDataSourceURLCategories_Basic \ - TestAccDataSourceURLFilteringRules_Basic \ - TestAccDataSourceDepartmentManagement_Basic \ - TestAccDataSourceGroupManagement_Basic \ - TestAccDataSourceUserManagement_Basic \ - TestAccResourceAdminUsersBasic \ - TestAccResourceAuthSettingsUrls_basic \ - TestAccResourceDLPDictionariesBasic \ - TestAccResourceDLPEnginesBasic \ - TestAccResourceDLPNotificationTemplatesBasic \ - TestAccResourceDlpWebRules_Basic \ - TestAccResourceFWIPDestinationGroupsBasic \ - TestAccResourceFWIPSourceGroupsBasic \ - TestAccResourceFWNetworkApplicationGroupsBasic \ - TestAccResourceFWNetworkServiceGroupsBasic \ - TestAccResourceFWNetworkServicesBasic \ - TestAccResourceLocationManagementBasic \ - TestAccResourceRuleLabelsBasic \ - TestAccZiaSandboxFileSubmission_basic \ - TestResourceSandboxSettings_basic \ - TestAccResourceSecurityPolicySettings_basic \ - TestAccResourceTrafficForwardingStaticIPBasic \ - TestAccResourceTrafficForwardingVPNCredentialsBasic \ - TestAccResourceTrafficForwardingGRETunnelBasic \ - TestAccResourceURLCategoriesBasic \ - TestAccResourceURLFilteringRulesBasic \ - TestAccResourceUserManagementBasic - -ifeq ($(strip $(ZS_INTEGRATION_TESTS)),) - ZS_INTEGRATION_TESTS = $(ZS2_INTEGRATION_TESTS) -endif - -space := $(subst ,, ) -integration_zs2_tests := $(subst $(space),\|,$(ZS_INTEGRATION_TESTS)) - -# Target to run integration tests for ZscalerTwo -test\:integration\:zscalertwo: - @echo "Running integration tests for ZscalerTwo..." - @TF_ACC=1 go test -v -cover ./zia -timeout 120m -run ^$(integration_zs2_tests)$$ - -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/$(ZIA_PROVIDER_NAMESPACE)/2.8.0/$(GOOS)_$(GOARCH) -else -build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.8.0/$(GOOS)_$(GOARCH) -endif -build13: fmtcheck - @echo "==> Installing plugin to $(DESTINATION)" - @mkdir -p $(DESTINATION) - go build -o $(DESTINATION)/terraform-provider-zia_v2.8.0 - -coverage: test - @echo "✓ Opening coverage for unit tests ..." - @go tool cover -html=coverage.txt - -vet: - @echo "==> Checking source code against go vet and staticcheck" - @go vet ./... - @staticcheck ./... - -imports: - goimports -w $(GOFMT_FILES) - -fmt: tools # Format the code - @echo "formatting the code with $(GOFMT)..." - @$(GOFMT) -l -w . - -fmtcheck: - @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" - -errcheck: - @sh -c "'$(CURDIR)/scripts/errcheck.sh'" - -fmt-docs: - @echo "✓ Formatting code samples in documentation" - @terrafmt fmt -p '*.md' . - -vendor-status: - @govendor status - -test-compile: - @if [ "$(TEST)" = "./..." ]; then \ - echo "ERROR: Set TEST to a specific package. For example,"; \ - echo " make test-compile TEST=./$(PKG_NAME)"; \ - exit 1; \ - fi - go test -c $(TEST) $(TESTARGS) - -lint: - @echo "==> Checking source code against linters..." - @$(TFPROVIDERLINT) \ - -c 1 \ - -AT001 \ - -R004 \ - -S001 \ - -S002 \ - -S003 \ - -S004 \ - -S005 \ - -S007 \ - -S008 \ - -S009 \ - -S010 \ - -S011 \ - -S012 \ - -S013 \ - -S014 \ - -S015 \ - -S016 \ - -S017 \ - -S019 \ - ./$(PKG_NAME) - -tools: - @which $(GOFMT) || go install mvdan.cc/gofumpt@v0.5.0 - @which $(TFPROVIDERLINT) || go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@v0.29.0 - @which $(STATICCHECK) || go install honnef.co/go/tools/cmd/staticcheck@v0.4.6 - -tools-update: - @go install mvdan.cc/gofumpt@v0.5.0 - @go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@v0.29.0 - @go install honnef.co/go/tools/cmd/staticcheck@v0.4.6 - -ziaActivator: GOOS=$(shell go env GOOS) -ziaActivator: GOARCH=$(shell go env GOARCH) -ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10... -ziaActivator: DESTINATION=C:\Windows\System32 -else -ziaActivator: DESTINATION=/usr/local/bin -endif -ziaActivator: - @echo "==> Installing ziaActivator cli $(DESTINATION)" - @mkdir -p $(DESTINATION) - @rm -f $(DESTINATION)/ziaActivator - @go build -o $(DESTINATION)/ziaActivator ./cli/ziaActivator.go - -website: -ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) - echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." - git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO) -endif - @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) - -website-lint: - @echo "==> Checking website against linters..." - @misspell -error -source=text website/ - -website-test: -ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) - echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." - git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO) -endif - @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) - -.PHONY: build test testacc vet fmt fmtcheck errcheck tools vendor-status test-compile website-lint website website-test \ No newline at end of file diff --git a/zia/common/version.go b/zia/common/version.go index b38bacf4..87274207 100644 --- a/zia/common/version.go +++ b/zia/common/version.go @@ -1,6 +1,6 @@ package common -var version = "2.7.2" +var version = "2.7.32" // Version returns version of provider func Version() string { diff --git a/zia/data_source_zia_auth_settings_urls_test.go b/zia/data_source_zia_auth_settings_urls_test.go index 99ca7448..0968bad7 100644 --- a/zia/data_source_zia_auth_settings_urls_test.go +++ b/zia/data_source_zia_auth_settings_urls_test.go @@ -22,7 +22,9 @@ func TestAccDataSourceAuthSettingsUrls_Basic(t *testing.T) { } func testAccDataSourceAuthSettingsUrlsCheck(name string) resource.TestCheckFunc { - return resource.ComposeTestCheckFunc() + return resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(name, "urls.#"), + ) } var testAccCheckDataSourceAuthSettingsUrlsConfig_basic = ` diff --git a/zia/data_source_zia_dlp_web_rules_test.go b/zia/data_source_zia_dlp_web_rules_test.go index dae1abbf..3a99bc17 100644 --- a/zia/data_source_zia_dlp_web_rules_test.go +++ b/zia/data_source_zia_dlp_web_rules_test.go @@ -19,7 +19,7 @@ func TestAccDataSourceDlpWebRules_Basic(t *testing.T) { CheckDestroy: testAccCheckDlpWebRulesDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckDlpWebRulesConfigure(resourceTypeAndName, generatedName, generatedName, variable.DLPWebRuleDesc, variable.DLPRuleResourceAction, variable.DLPRuleResourceState), + Config: testAccCheckDlpWebRulesConfigure(resourceTypeAndName, generatedName, variable.DLPWebRuleDesc, variable.DLPRuleResourceAction, variable.DLPRuleResourceState), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceTypeAndName, "id", resourceTypeAndName, "id"), resource.TestCheckResourceAttrPair(dataSourceTypeAndName, "name", resourceTypeAndName, "name"), diff --git a/zia/data_source_zia_location_groups.go b/zia/data_source_zia_location_groups.go index 24981fc8..80b889d6 100644 --- a/zia/data_source_zia_location_groups.go +++ b/zia/data_source_zia_location_groups.go @@ -191,6 +191,16 @@ func dataSourceLocationGroupRead(d *schema.ResourceData, m interface{}) error { zClient := m.(*Client) var resp *locationgroups.LocationGroup + id, ok := getIntFromResourceData(d, "id") + if ok { + log.Printf("[INFO] Getting time window id: %d\n", id) + res, err := zClient.locationgroups.GetLocationGroup(id) + if err != nil { + return err + } + resp = res + } + name, _ := d.Get("name").(string) if resp == nil && name != "" { log.Printf("[INFO] Getting data for location name: %s\n", name) diff --git a/zia/data_source_zia_location_management_test.go b/zia/data_source_zia_location_management_test.go index 473dd9ec..37379bfa 100644 --- a/zia/data_source_zia_location_management_test.go +++ b/zia/data_source_zia_location_management_test.go @@ -18,8 +18,8 @@ func TestAccDataSourceLocationManagement_Basic(t *testing.T) { staticIPTypeAndName, _, staticIPGeneratedName := method.GenerateRandomSourcesTypeAndName(resourcetype.TrafficForwardingStaticIP) staticIPResourceHCL := testAccCheckTrafficForwardingStaticIPConfigure(staticIPTypeAndName, staticIPGeneratedName, rIP, variable.StaticRoutableIP, variable.StaticGeoOverride) - vpnCredentialTypeAndName, _, vpnCredentialGeneratedName := method.GenerateRandomSourcesTypeAndName(resourcetype.TrafficForwardingVPNCredentials) - vpnCredentialResourceHCL := testAccCheckTrafficForwardingVPNCredentialsIPConfigure(vpnCredentialTypeAndName, vpnCredentialGeneratedName, variable.VPNCredentialTypeIP, "", "") + // vpnCredentialTypeAndName, _, vpnCredentialGeneratedName := method.GenerateRandomSourcesTypeAndName(resourcetype.TrafficForwardingVPNCredentials) + // vpnCredentialResourceHCL := testAccCheckTrafficForwardingVPNCredentialsIPConfigure(vpnCredentialTypeAndName, vpnCredentialGeneratedName, variable.VPNCredentialTypeIP, "", "") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -27,7 +27,7 @@ func TestAccDataSourceLocationManagement_Basic(t *testing.T) { CheckDestroy: testAccCheckLocationManagementDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, vpnCredentialResourceHCL, vpnCredentialTypeAndName, variable.LocAuthRequired, variable.LocSurrogateIP, variable.LocXFF, variable.LocOFW, variable.LocIPS), + Config: testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, variable.LocAuthRequired, variable.LocSurrogateIP, variable.LocXFF, variable.LocOFW, variable.LocIPS), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceTypeAndName, "id", resourceTypeAndName, "id"), resource.TestCheckResourceAttrPair(dataSourceTypeAndName, "name", resourceTypeAndName, "name"), diff --git a/zia/data_source_zia_sandbox_report.go b/zia/data_source_zia_sandbox_report.go index a0f2c433..56f3a5f5 100644 --- a/zia/data_source_zia_sandbox_report.go +++ b/zia/data_source_zia_sandbox_report.go @@ -148,6 +148,9 @@ func filePropertiesSchema() *schema.Resource { // Helper function to create schema for SandboxRSS fields func commonSandboxRSSSchema(fieldName string) *schema.Schema { + // No-op use of fieldName to avoid unused parameter warning + _ = fieldName + return &schema.Schema{ Type: schema.TypeSet, Computed: true, diff --git a/zia/data_source_zia_traffic_forwarding_public_nodes_vips.go b/zia/data_source_zia_traffic_forwarding_public_nodes_vips.go index a1a4519a..c88bc5aa 100644 --- a/zia/data_source_zia_traffic_forwarding_public_nodes_vips.go +++ b/zia/data_source_zia_traffic_forwarding_public_nodes_vips.go @@ -68,7 +68,7 @@ func dataSourceTrafficForwardingPublicNodeVIPsRead(d *schema.ResourceData, m int var resp *virtualipaddress.ZscalerVIPs datacenter, _ := d.Get("datacenter").(string) - if resp == nil && datacenter != "" { + if datacenter != "" { log.Printf("[INFO] Getting data for datacenter name: %s\n", datacenter) res, err := zClient.virtualipaddress.GetZscalerVIPs(datacenter) if err != nil { @@ -90,7 +90,6 @@ func dataSourceTrafficForwardingPublicNodeVIPsRead(d *schema.ResourceData, m int _ = d.Set("gre_ips", resp.GREIPs) _ = d.Set("pac_ips", resp.PACIPs) _ = d.Set("pac_domain_name", resp.PACDomainName) - } else { return fmt.Errorf("couldn't find any datacenter with name '%s'", datacenter) } diff --git a/zia/data_source_zia_url_categories.go b/zia/data_source_zia_url_categories.go index 3c302743..bb125728 100644 --- a/zia/data_source_zia_url_categories.go +++ b/zia/data_source_zia_url_categories.go @@ -183,51 +183,51 @@ func dataSourceURLCategoriesRead(d *schema.ResourceData, m interface{}) error { zClient := m.(*Client) var resp *urlcategories.URLCategory + var err error + id, _ := d.Get("id").(string) - if resp == nil && id != "" { - log.Printf("[INFO] Getting url categories : %s\n", id) - res, err := zClient.urlcategories.Get(id) + name, _ := d.Get("configured_name").(string) + + if id != "" { + log.Printf("[INFO] Getting URL categories by ID: %s\n", id) + resp, err = zClient.urlcategories.Get(id) if err != nil { return err } - resp = res - } - - name, _ := d.Get("configured_name").(string) - if resp == nil && name != "" { - log.Printf("[INFO] Getting url categories : %s\n", name) - res, err := zClient.urlcategories.GetCustomURLCategories(name) + } else if name != "" { + log.Printf("[INFO] Getting URL categories by name: %s\n", name) + resp, err = zClient.urlcategories.GetCustomURLCategories(name) if err != nil { return err } - resp = res } - if resp != nil { - d.SetId(fmt.Sprintf(resp.ID)) - _ = d.Set("configured_name", resp.ConfiguredName) - _ = d.Set("keywords", resp.Keywords) - _ = d.Set("keywords_retaining_parent_category", resp.KeywordsRetainingParentCategory) - _ = d.Set("urls", resp.Urls) - _ = d.Set("db_categorized_urls", resp.DBCategorizedUrls) - _ = d.Set("custom_category", resp.CustomCategory) - _ = d.Set("editable", resp.Editable) - _ = d.Set("description", resp.Description) - _ = d.Set("type", resp.Type) - _ = d.Set("val", resp.Val) - _ = d.Set("custom_urls_count", resp.CustomUrlsCount) - _ = d.Set("urls_retaining_parent_category_count", resp.UrlsRetainingParentCategoryCount) + // After attempting to fetch, check if resp is still nil, indicating no data was found. + if resp == nil { + return fmt.Errorf("couldn't find any URL category with ID '%s' or name '%s'", id, name) + } - if err := d.Set("scopes", flattenScopes(resp)); err != nil { - return err - } + // Set the data source fields with the response + d.SetId(fmt.Sprintf(resp.ID)) + _ = d.Set("configured_name", resp.ConfiguredName) + _ = d.Set("keywords", resp.Keywords) + _ = d.Set("keywords_retaining_parent_category", resp.KeywordsRetainingParentCategory) + _ = d.Set("urls", resp.Urls) + _ = d.Set("db_categorized_urls", resp.DBCategorizedUrls) + _ = d.Set("custom_category", resp.CustomCategory) + _ = d.Set("editable", resp.Editable) + _ = d.Set("description", resp.Description) + _ = d.Set("type", resp.Type) + _ = d.Set("val", resp.Val) + _ = d.Set("custom_urls_count", resp.CustomUrlsCount) + _ = d.Set("urls_retaining_parent_category_count", resp.UrlsRetainingParentCategoryCount) - if err := d.Set("url_keyword_counts", flattenUrlKeywordCounts(resp.URLKeywordCounts)); err != nil { - return err - } + if err := d.Set("scopes", flattenScopes(resp)); err != nil { + return err + } - } else { - return fmt.Errorf("couldn't find any category or custom category with name '%s' or id '%s'", name, id) + if err := d.Set("url_keyword_counts", flattenUrlKeywordCounts(resp.URLKeywordCounts)); err != nil { + return err } return nil diff --git a/zia/data_source_zia_user_management_users_test.go b/zia/data_source_zia_user_management_users_test.go index a1fe340c..c859deea 100644 --- a/zia/data_source_zia_user_management_users_test.go +++ b/zia/data_source_zia_user_management_users_test.go @@ -21,7 +21,7 @@ func TestAccDataSourceUserManagement_Basic(t *testing.T) { CheckDestroy: testAccCheckUserManagementDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckUserManagementConfigure(resourceTypeAndName, generatedName, resourceTypeAndName, rEmail, rPassword, rComments), + Config: testAccCheckUserManagementConfigure(resourceTypeAndName, generatedName, rEmail, rPassword, rComments), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceTypeAndName, "id", resourceTypeAndName, "id"), resource.TestCheckResourceAttrPair(dataSourceTypeAndName, "name", resourceTypeAndName, "name"), diff --git a/zia/resource_zia_admin_users_test.go b/zia/resource_zia_admin_users_test.go index 4659adf7..5047d7e2 100644 --- a/zia/resource_zia_admin_users_test.go +++ b/zia/resource_zia_admin_users_test.go @@ -32,7 +32,7 @@ func TestAccResourceAdminUsersBasic(t *testing.T) { Config: testAccCheckAdminUsersConfigure(resourceTypeAndName, generatedName, rEmail, rPassword), Check: resource.ComposeTestCheckFunc( testAccCheckAdminUsersExists(resourceTypeAndName, &admins), - resource.TestCheckResourceAttr(resourceTypeAndName, "login_name", fmt.Sprintf(rEmail+"@bd-hashicorp.com")), + resource.TestCheckResourceAttr(resourceTypeAndName, "login_name", fmt.Sprintf(generatedName+"@bd-hashicorp.com")), resource.TestCheckResourceAttr(resourceTypeAndName, "email", fmt.Sprintf(rEmail+"@bd-hashicorp.com")), resource.TestCheckResourceAttr(resourceTypeAndName, "username", variable.AdminUserName), resource.TestCheckResourceAttr(resourceTypeAndName, "password", fmt.Sprintf(rPassword+"Super@Secret007")), @@ -46,7 +46,7 @@ func TestAccResourceAdminUsersBasic(t *testing.T) { Config: testAccCheckAdminUsersConfigure(resourceTypeAndName, generatedName, rEmail, rPasswordUpdate), Check: resource.ComposeTestCheckFunc( testAccCheckAdminUsersExists(resourceTypeAndName, &admins), - resource.TestCheckResourceAttr(resourceTypeAndName, "login_name", fmt.Sprintf(rEmail+"@bd-hashicorp.com")), + resource.TestCheckResourceAttr(resourceTypeAndName, "login_name", fmt.Sprintf(generatedName+"@bd-hashicorp.com")), resource.TestCheckResourceAttr(resourceTypeAndName, "email", fmt.Sprintf(rEmail+"@bd-hashicorp.com")), resource.TestCheckResourceAttr(resourceTypeAndName, "username", variable.AdminUserName), resource.TestCheckResourceAttr(resourceTypeAndName, "password", fmt.Sprintf(rPasswordUpdate+"Super@Secret007")), @@ -157,7 +157,7 @@ data "%s" "%s" { // Resource type and name for the admin user resourcetype.AdminUsers, resourceName, - rEmail, + generatedName, rEmail, variable.AdminUserName, rPassword, diff --git a/zia/resource_zia_auth_settings_urls_test.go b/zia/resource_zia_auth_settings_urls_test.go index aa4db3fc..745fe18b 100644 --- a/zia/resource_zia_auth_settings_urls_test.go +++ b/zia/resource_zia_auth_settings_urls_test.go @@ -1,6 +1,7 @@ package zia import ( + "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -42,7 +43,14 @@ func testAccCheckAuthSettingsUrlsDestroy(s *terraform.State) error { func testAccCheckAuthSettingsUrlsExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { - // Implement this function to ensure the resource exists in the infrastructure + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Security Policy Settings ID is set") + } return nil } } diff --git a/zia/resource_zia_dlp_web_rules_test.go b/zia/resource_zia_dlp_web_rules_test.go index 10907b7d..573e1a49 100644 --- a/zia/resource_zia_dlp_web_rules_test.go +++ b/zia/resource_zia_dlp_web_rules_test.go @@ -28,7 +28,7 @@ func TestAccResourceDlpWebRules_Basic(t *testing.T) { CheckDestroy: testAccCheckDlpWebRulesDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckDlpWebRulesConfigure(resourceTypeAndName, generatedName, initialName, variable.DLPWebRuleDesc, variable.DLPRuleResourceAction, variable.DLPRuleResourceState), + Config: testAccCheckDlpWebRulesConfigure(resourceTypeAndName, initialName, variable.DLPWebRuleDesc, variable.DLPRuleResourceAction, variable.DLPRuleResourceState), Check: resource.ComposeTestCheckFunc( testAccCheckDlpWebRulesExists(resourceTypeAndName, &rules), resource.TestCheckResourceAttr(resourceTypeAndName, "name", initialName), @@ -43,7 +43,7 @@ func TestAccResourceDlpWebRules_Basic(t *testing.T) { // Update test { - Config: testAccCheckDlpWebRulesConfigure(resourceTypeAndName, generatedName, updatedName, variable.DLPWebRuleDesc, variable.DLPRuleResourceAction, variable.DLPRuleResourceState), + Config: testAccCheckDlpWebRulesConfigure(resourceTypeAndName, updatedName, variable.DLPWebRuleDesc, variable.DLPRuleResourceAction, variable.DLPRuleResourceState), Check: resource.ComposeTestCheckFunc( testAccCheckDlpWebRulesExists(resourceTypeAndName, &rules), resource.TestCheckResourceAttr(resourceTypeAndName, "name", updatedName), @@ -132,7 +132,7 @@ func testAccCheckDlpWebRulesExists(resource string, rule *dlp_web_rules.WebDLPRu } } -func testAccCheckDlpWebRulesConfigure(resourceTypeAndName, generatedName, name, description, action, state string) string { +func testAccCheckDlpWebRulesConfigure(resourceTypeAndName, name, description, action, state string) string { resourceName := strings.Split(resourceTypeAndName, ".")[1] // Extract the resource name return fmt.Sprintf(` diff --git a/zia/resource_zia_location_management_test.go b/zia/resource_zia_location_management_test.go index a994b160..26994805 100644 --- a/zia/resource_zia_location_management_test.go +++ b/zia/resource_zia_location_management_test.go @@ -23,9 +23,9 @@ func TestAccResourceLocationManagementBasic(t *testing.T) { staticIPTypeAndName, _, staticIPGeneratedName := method.GenerateRandomSourcesTypeAndName(resourcetype.TrafficForwardingStaticIP) staticIPResourceHCL := testAccCheckTrafficForwardingStaticIPConfigure(staticIPTypeAndName, staticIPGeneratedName, rIP, variable.StaticRoutableIP, variable.StaticGeoOverride) - rSharedKey := acctest.RandString(20) - vpnCredentialTypeAndName, _, vpnCredentialGeneratedName := method.GenerateRandomSourcesTypeAndName(resourcetype.TrafficForwardingVPNCredentials) - vpnCredentialResourceHCL := testAccCheckTrafficForwardingVPNCredentialsIPConfigure(vpnCredentialTypeAndName, vpnCredentialGeneratedName, vpnCredentialGeneratedName, variable.VPNCredentialTypeIP, rSharedKey) + // rSharedKey := acctest.RandString(20) + // vpnCredentialTypeAndName, _, vpnCredentialGeneratedName := method.GenerateRandomSourcesTypeAndName(resourcetype.TrafficForwardingVPNCredentials) + // vpnCredentialResourceHCL := testAccCheckTrafficForwardingVPNCredentialsIPConfigure(vpnCredentialTypeAndName, vpnCredentialGeneratedName, vpnCredentialGeneratedName, variable.VPNCredentialTypeIP, rSharedKey) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -33,7 +33,7 @@ func TestAccResourceLocationManagementBasic(t *testing.T) { CheckDestroy: testAccCheckLocationManagementDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, vpnCredentialResourceHCL, vpnCredentialTypeAndName, variable.LocAuthRequired, variable.LocSurrogateIP, variable.LocXFF, variable.LocOFW, variable.LocIPS), + Config: testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, variable.LocAuthRequired, variable.LocSurrogateIP, variable.LocXFF, variable.LocOFW, variable.LocIPS), Check: resource.ComposeTestCheckFunc( testAccCheckLocationManagementExists(resourceTypeAndName, &locations), resource.TestCheckResourceAttr(resourceTypeAndName, "name", "tf-acc-test-"+generatedName), @@ -54,7 +54,7 @@ func TestAccResourceLocationManagementBasic(t *testing.T) { // Update test { - Config: testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, vpnCredentialResourceHCL, vpnCredentialTypeAndName, variable.LocAuthRequired, variable.LocSurrogateIP, variable.LocXFF, variable.LocOFW, variable.LocIPS), + Config: testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, variable.LocAuthRequired, variable.LocSurrogateIP, variable.LocXFF, variable.LocOFW, variable.LocIPS), Check: resource.ComposeTestCheckFunc( testAccCheckLocationManagementExists(resourceTypeAndName, &locations), resource.TestCheckResourceAttr(resourceTypeAndName, "name", "tf-acc-test-"+generatedName), @@ -149,7 +149,7 @@ func testAccCheckLocationManagementExists(resource string, rule *locationmanagem } } -func testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName, vpnCredentialResourceHCL, vpnCredentialTypeAndName string, authRequired, surrogateIP, xffEnabled, ofwEnabled, ipsEnabled bool) string { +func testAccCheckLocationManagementConfigure(resourceTypeAndName, generatedName, staticIPResourceHCL, staticIPTypeAndName string, authRequired, surrogateIP, xffEnabled, ofwEnabled, ipsEnabled bool) string { return fmt.Sprintf(` // static ip resource @@ -165,7 +165,7 @@ data "%s" "%s" { // resource variables staticIPResourceHCL, // vpnCredentialResourceHCL, - getLocationManagementHCL(generatedName, staticIPTypeAndName, vpnCredentialTypeAndName, authRequired, surrogateIP, xffEnabled, ofwEnabled, ipsEnabled), + getLocationManagementHCL(generatedName, staticIPTypeAndName, authRequired, surrogateIP, xffEnabled, ofwEnabled, ipsEnabled), // data source variables resourcetype.TrafficForwardingLocManagement, @@ -174,7 +174,7 @@ data "%s" "%s" { ) } -func getLocationManagementHCL(generatedName, staticIPTypeAndName, vpnCredentialTypeAndName string, authRequired, surrogateIP, xffEnabled, ofwEnabled, ipsEnabled bool) string { +func getLocationManagementHCL(generatedName, staticIPTypeAndName string, authRequired, surrogateIP, xffEnabled, ofwEnabled, ipsEnabled bool) string { return fmt.Sprintf(` diff --git a/zia/resource_zia_sandbox_behavioral_analysis_advanced_settings_test.go b/zia/resource_zia_sandbox_behavioral_analysis_advanced_settings_test.go index d2d812d0..82b3726f 100644 --- a/zia/resource_zia_sandbox_behavioral_analysis_advanced_settings_test.go +++ b/zia/resource_zia_sandbox_behavioral_analysis_advanced_settings_test.go @@ -113,7 +113,14 @@ func testAccCheckSandboxSettingsDestroy(s *terraform.State) error { func testAccCheckSandboxSettingsExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { - // Implement this function to ensure the resource exists in the infrastructure + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Sandbox Setting ID is set") + } return nil } } diff --git a/zia/resource_zia_security_policy_settings_test.go b/zia/resource_zia_security_policy_settings_test.go index dbd62f98..6db6f21c 100644 --- a/zia/resource_zia_security_policy_settings_test.go +++ b/zia/resource_zia_security_policy_settings_test.go @@ -1,6 +1,7 @@ package zia import ( + "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -45,7 +46,14 @@ func testAccCheckSecurityPolicySettingsDestroy(s *terraform.State) error { func testAccCheckSecurityPolicySettingsExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { - // Implement this function to ensure the resource exists in the infrastructure + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Security Policy Settings ID is set") + } return nil } } diff --git a/zia/resource_zia_url_filtering_rules.go b/zia/resource_zia_url_filtering_rules.go index fc8c25b9..a38229e4 100644 --- a/zia/resource_zia_url_filtering_rules.go +++ b/zia/resource_zia_url_filtering_rules.go @@ -153,20 +153,19 @@ func resourceURLFilteringRules() *schema.Resource { Optional: true, Description: "If set to true, the CIPA Compliance rule is enabled", }, - "cbi_profile_id": { - Type: schema.TypeInt, - Computed: true, - }, + // "cbi_profile_id": { + // Type: schema.TypeInt, + // Computed: true, + // }, "cbi_profile": { Type: schema.TypeList, Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "profile_seq": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, + // "profile_seq": { + // Type: schema.TypeInt, + // Computed: true, + // }, "id": { Type: schema.TypeString, Optional: true, @@ -347,9 +346,9 @@ func resourceURLFilteringRulesRead(d *schema.ResourceData, m interface{}) error _ = d.Set("action", resp.Action) _ = d.Set("ciparule", resp.Ciparule) _ = d.Set("order", resp.Order) - if resp.CBIProfileID > 0 { - _ = d.Set("cbi_profile_id", resp.CBIProfileID) - } + // if resp.CBIProfileID > 0 { + // _ = d.Set("cbi_profile_id", resp.CBIProfileID) + // } // Update the cbi_profile block in the state if resp.CBIProfile.ID != "" { @@ -509,20 +508,20 @@ func expandURLFilteringRules(d *schema.ResourceData) urlfilteringpolicies.URLFil EnforceTimeValidity: d.Get("enforce_time_validity").(bool), Action: d.Get("action").(string), Ciparule: d.Get("ciparule").(bool), - CBIProfileID: d.Get("cbi_profile_id").(int), - Locations: expandIDNameExtensionsSet(d, "locations"), - Groups: expandIDNameExtensionsSet(d, "groups"), - Departments: expandIDNameExtensionsSet(d, "departments"), - Users: expandIDNameExtensionsSet(d, "users"), - TimeWindows: expandIDNameExtensionsSet(d, "time_windows"), - OverrideUsers: expandIDNameExtensionsSet(d, "override_users"), - OverrideGroups: expandIDNameExtensionsSet(d, "override_groups"), - LocationGroups: expandIDNameExtensionsSet(d, "location_groups"), - Labels: expandIDNameExtensionsSet(d, "labels"), - DeviceGroups: expandIDNameExtensionsSet(d, "device_groups"), - Devices: expandIDNameExtensionsSet(d, "devices"), - WorkloadGroups: expandWorkloadGroups(d, "workload_groups"), - CBIProfile: expandCBIProfile(d), + // CBIProfileID: d.Get("cbi_profile_id").(int), + Locations: expandIDNameExtensionsSet(d, "locations"), + Groups: expandIDNameExtensionsSet(d, "groups"), + Departments: expandIDNameExtensionsSet(d, "departments"), + Users: expandIDNameExtensionsSet(d, "users"), + TimeWindows: expandIDNameExtensionsSet(d, "time_windows"), + OverrideUsers: expandIDNameExtensionsSet(d, "override_users"), + OverrideGroups: expandIDNameExtensionsSet(d, "override_groups"), + LocationGroups: expandIDNameExtensionsSet(d, "location_groups"), + Labels: expandIDNameExtensionsSet(d, "labels"), + DeviceGroups: expandIDNameExtensionsSet(d, "device_groups"), + Devices: expandIDNameExtensionsSet(d, "devices"), + WorkloadGroups: expandWorkloadGroups(d, "workload_groups"), + CBIProfile: expandCBIProfile(d), } return result @@ -534,10 +533,10 @@ func expandCBIProfile(d *schema.ResourceData) urlfilteringpolicies.CBIProfile { if len(cbiProfileList) > 0 { cbiProfileData := cbiProfileList[0].(map[string]interface{}) return urlfilteringpolicies.CBIProfile{ - ProfileSeq: cbiProfileData["profile_seq"].(int), - ID: cbiProfileData["id"].(string), - Name: cbiProfileData["name"].(string), - URL: cbiProfileData["url"].(string), + // ProfileSeq: cbiProfileData["profile_seq"].(int), + ID: cbiProfileData["id"].(string), + Name: cbiProfileData["name"].(string), + URL: cbiProfileData["url"].(string), } } } @@ -550,10 +549,10 @@ func flattenCBIProfileSimple(cbiProfile *urlfilteringpolicies.CBIProfile) []inte } return []interface{}{ map[string]interface{}{ - "id": cbiProfile.ID, - "name": cbiProfile.Name, - "url": cbiProfile.URL, - "profile_seq": cbiProfile.ProfileSeq, + "id": cbiProfile.ID, + "name": cbiProfile.Name, + "url": cbiProfile.URL, + // "profile_seq": cbiProfile.ProfileSeq, }, } } @@ -574,7 +573,7 @@ func validateURLFilteringActions(rule urlfilteringpolicies.URLFilteringRule) err } // Validation 3: Check Protocols should be HTTP or HTTPS - validProtocols := map[string]bool{"HTTP": true, "HTTPS": true} + validProtocols := map[string]bool{"HTTPS_RULE": true, "HTTP_RULE": true} for _, protocol := range rule.Protocols { if !validProtocols[strings.ToUpper(protocol)] { return errors.New("when action is ISOLATE, valid options for protocols are: HTTP and/or HTTPS") diff --git a/zia/resource_zia_user_management_users_test.go b/zia/resource_zia_user_management_users_test.go index 3fb55ee1..1769e830 100644 --- a/zia/resource_zia_user_management_users_test.go +++ b/zia/resource_zia_user_management_users_test.go @@ -30,7 +30,7 @@ func TestAccResourceUserManagementBasic(t *testing.T) { CheckDestroy: testAccCheckUserManagementDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckUserManagementConfigure(resourceTypeAndName, generatedName, name, rEmail, rPassword, rComments), + Config: testAccCheckUserManagementConfigure(resourceTypeAndName, name, rEmail, rPassword, rComments), Check: resource.ComposeTestCheckFunc( testAccCheckUserManagementExists(resourceTypeAndName, &users), resource.TestCheckResourceAttr(resourceTypeAndName, "name", name), @@ -44,7 +44,7 @@ func TestAccResourceUserManagementBasic(t *testing.T) { // Update test { - Config: testAccCheckUserManagementConfigure(resourceTypeAndName, generatedName, name, rEmail, rPasswordUpdate, rComments), + Config: testAccCheckUserManagementConfigure(resourceTypeAndName, name, rEmail, rPasswordUpdate, rComments), Check: resource.ComposeTestCheckFunc( testAccCheckUserManagementExists(resourceTypeAndName, &users), resource.TestCheckResourceAttr(resourceTypeAndName, "name", name), @@ -114,7 +114,7 @@ func testAccCheckUserManagementExists(resource string, users *users.Users) resou } } -func testAccCheckUserManagementConfigure(resourceTypeAndName, generatedName, name, rEmail, rPassword, rComments string) string { +func testAccCheckUserManagementConfigure(resourceTypeAndName, name, rEmail, rPassword, rComments string) string { resourceName := strings.Split(resourceTypeAndName, ".")[1] // Extract the resource name return fmt.Sprintf(` diff --git a/zia/version.go b/zia/version.go index 3b14ae1b..8362ac6b 100644 --- a/zia/version.go +++ b/zia/version.go @@ -1,4 +1,4 @@ package zia // ProviderVersion is set at build-time in the release process -var ProviderVersion = "2.7.2" +var ProviderVersion = "2.7.32"