diff --git a/onepassword/provider.go b/onepassword/provider.go index 24c3888..06a4062 100644 --- a/onepassword/provider.go +++ b/onepassword/provider.go @@ -46,8 +46,12 @@ func Provider() terraform.ResourceProvider { "subdomain": { Type: schema.TypeString, Optional: true, - Default: "my", - DefaultFunc: schema.EnvDefaultFunc("OP_SUBDOMAIN", nil), + DefaultFunc: func() (interface{}, error) { + if v := os.Getenv("OP_SUBDOMAIN"); v != "" { + return v, nil + } + return "my", nil + }, Description: "Set alternative subdomain for 1password. From [subdomain].1password.com", }, },