diff --git a/Makefile b/Makefile index 7fbd8aa..bc2a46a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PROVIDER_BIN:=$(shell basename `git rev-parse --show-toplevel`) PROVIDER_NAME:=$(shell echo $(PROVIDER_BIN) | sed 's/terraform-provider-//g') PROVIDER_DIRECTORY:=~/.terraform.d/plugins/local/altinity/${PROVIDER_NAME} DEFAULT_GRAPHQL_SCHEMA_FILE:=internal/sdk/client/graphql.schema -DEFAULT_GRAPHQL_SCHEMA_URL:=https://anywhere.dev.altinity.cloud/api/v1/graphql.schema +DEFAULT_GRAPHQL_SCHEMA_URL:=https://anywhere.altinity.cloud/api/v1/graphql.schema GRAPHQL_SCHEMA_URL:=$(or $(GRAPHQL_SCHEMA_URL),$(DEFAULT_GRAPHQL_SCHEMA_URL)) GRAPHQL_SCHEMA_FILE:=$(or $(GRAPHQL_SCHEMA_FILE),$(DEFAULT_GRAPHQL_SCHEMA_FILE)) diff --git a/internal/provider/common/attributes.go b/internal/provider/common/attributes.go index 4665ddc..2e4243e 100644 --- a/internal/provider/common/attributes.go +++ b/internal/provider/common/attributes.go @@ -139,6 +139,7 @@ func GetNumberOfZonesAttribute(required, optional, computed bool) rschema.Int64A Optional: optional, Computed: computed, MarkdownDescription: NUMBER_OF_ZONES_DESCRIPTION, + DeprecationMessage: "The 'number_of_zones' attribute is deprecated and will be removed soon. Use 'zones' instead.", Validators: []validator.Int64{ int64validator.AtLeast(2), }, diff --git a/internal/provider/modifiers/zones_validation.go b/internal/provider/modifiers/zones_validation.go index 1fe3886..8062bf7 100644 --- a/internal/provider/modifiers/zones_validation.go +++ b/internal/provider/modifiers/zones_validation.go @@ -23,6 +23,7 @@ func (d *zonesAttributePlanModifier) MarkdownDescription(ctx context.Context) st return d.Description(ctx) } +// TODO: remove this modifier after deprecating number_of_zones func (d *zonesAttributePlanModifier) PlanModifyInt64(ctx context.Context, req planmodifier.Int64Request, resp *planmodifier.Int64Response) { var zones types.List diags := req.Plan.GetAttribute(ctx, path.Root("zones"), &zones) @@ -43,10 +44,6 @@ func (d *zonesAttributePlanModifier) PlanModifyInt64(ctx context.Context, req pl return } - // if !zones.IsNull() && numberOfZones.ValueInt64() > 0 { - // resp.Diagnostics.AddAttributeWarning(path.Root("zones"), "zones and number_of_zones are mutually exclusive", "if you set both, only zones will be used") - // } - if !zones.IsNull() && len(zones.Elements()) > 0 { resp.PlanValue = types.Int64Value(int64(len(zones.Elements()))) return