Skip to content

Commit

Permalink
add default value to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushrangwala committed Mar 14, 2024
1 parent b6c792e commit dd38b3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/resources/metal/vlan/resource_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ package vlan

import (
"context"
equinixplanmodifiers "github.com/equinix/terraform-provider-equinix/internal/planmodifiers"

"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"

equinixplanmodifiers "github.com/equinix/terraform-provider-equinix/internal/planmodifiers"
)

func resourceSchema(ctx context.Context) schema.Schema {
Expand Down Expand Up @@ -40,13 +43,15 @@ func resourceSchema(ctx context.Context) schema.Schema {
Description: "Facility where to create the VLAN",
DeprecationMessage: "Use metro instead of facility. For more information, read the migration guide: https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_facilities_to_metros_devices",
Optional: true,
Computed: true,
Validators: []validator.String{
stringvalidator.ConflictsWith(path.MatchRoot("metro")),
},
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
stringplanmodifier.UseStateForUnknown(),
},
Default: stringdefault.StaticString(""),
},
"metro": schema.StringAttribute{
Description: "Metro in which to create the VLAN",
Expand Down

0 comments on commit dd38b3c

Please sign in to comment.