Skip to content

Commit

Permalink
Fix Computed values and validation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Mar 6, 2023
1 parent 95046ad commit 2aaec94
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 62 deletions.
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ build: fmtcheck
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.4.5/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.4.6/$(GOOS)_$(GOARCH)
else
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.4.5/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.4.6/$(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-zia_v2.4.5
go build -o $(DESTINATION)/terraform-provider-zia_v2.4.6

test: fmtcheck
go test $(TEST) || exit 1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk v1.17.2
github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0
github.com/zscaler/zscaler-sdk-go v1.1.3
github.com/zscaler/zscaler-sdk-go v1.1.4
)

require (
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY
github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA=
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 v1.1.3 h1:w0tKwyaSAbGuzmEonbyYykRVEsqHxXziKm+/6Qeda4E=
github.com/zscaler/zscaler-sdk-go v1.1.3/go.mod h1:h4cLV1/q579M0juEXKeU1HB1l3RHSuwTxn3xpBLLzjg=
github.com/zscaler/zscaler-sdk-go v1.1.4 h1:thCkkdhsDbLslv/yaEKU8Rh/01lX0t8lJ2RgW1YYsYY=
github.com/zscaler/zscaler-sdk-go v1.1.4/go.mod h1:h4cLV1/q579M0juEXKeU1HB1l3RHSuwTxn3xpBLLzjg=
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=
Expand Down Expand Up @@ -700,4 +700,4 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
1 change: 1 addition & 0 deletions zia/resource_zia_location_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func resourceLocationManagement() *schema.Resource {
Type: schema.TypeString,
ValidateFunc: validation.Any(
validation.IsIPv4Address,
validation.IsIPv4Range,
),
},
Description: "For locations: IP addresses of the egress points that are provisioned in the Zscaler Cloud. Each entry is a single IP address (e.g., 238.10.33.9).",
Expand Down
54 changes: 0 additions & 54 deletions zia/resource_zia_traffic_forwarding_static_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ func resourceTrafficForwardingStaticIP() *schema.Resource {
"latitude": {
Type: schema.TypeFloat,
Optional: true,
Computed: true,
ValidateFunc: validation.FloatBetween(-90, 90),
Description: "Required only if the geoOverride attribute is set. Latitude with 7 digit precision after decimal point, ranges between -90 and 90 degrees.",
},
"longitude": {
Type: schema.TypeFloat,
Optional: true,
Computed: true,
ValidateFunc: validation.FloatBetween(-180, 180),
Description: "Required only if the geoOverride attribute is set. Longitude with 7 digit precision after decimal point, ranges between -180 and 180 degrees.",
},
Expand All @@ -77,58 +75,6 @@ func resourceTrafficForwardingStaticIP() *schema.Resource {
Computed: true,
Description: "Indicates whether a non-RFC 1918 IP address is publicly routable. This attribute is ignored if there is no ZIA Private Service Edge associated to the organization.",
},
// "managed_by": {
// Type: schema.TypeSet,
// Optional: true,
// Computed: true,
// Description: "This is an immutable reference to an entity. which mainly consists of id and name",
// Elem: &schema.Resource{
// Schema: map[string]*schema.Schema{
// "id": {
// Type: schema.TypeInt,
// Optional: true,
// Description: "Identifier that uniquely identifies an entity",
// },
// "name": {
// Type: schema.TypeString,
// Optional: true,
// },
// "extensions": {
// Type: schema.TypeMap,
// Optional: true,
// Elem: &schema.Schema{
// Type: schema.TypeString,
// },
// },
// },
// },
// },
// "last_modified_by": {
// Type: schema.TypeSet,
// Optional: true,
// Computed: true,
// Description: "This is an immutable reference to an entity. which mainly consists of id and name",
// Elem: &schema.Resource{
// Schema: map[string]*schema.Schema{
// "id": {
// Type: schema.TypeInt,
// Optional: true,
// Description: "Identifier that uniquely identifies an entity",
// },
// "name": {
// Type: schema.TypeString,
// Optional: true,
// },
// "extensions": {
// Type: schema.TypeMap,
// Optional: true,
// Elem: &schema.Schema{
// Type: schema.TypeString,
// },
// },
// },
// },
// },
"comment": {
Type: schema.TypeString,
Optional: true,
Expand Down
2 changes: 1 addition & 1 deletion zia/resource_zia_url_categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func resourceURLCategories() *schema.Resource {
"editable": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Computed: true,
},
"description": {
Type: schema.TypeString,
Expand Down

0 comments on commit 2aaec94

Please sign in to comment.