Skip to content

Commit

Permalink
Use a function for default OP_SUBDOMAIN response
Browse files Browse the repository at this point in the history
  • Loading branch information
sjames-au authored and anasinnyk committed Jul 14, 2020
1 parent a761831 commit c12881d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions onepassword/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
Expand Down

0 comments on commit c12881d

Please sign in to comment.