Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit ce1302b

Browse files
author
Alex Kalyvitis
committed
Validate trigger value
1 parent f9b3ac3 commit ce1302b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

auth0/resource_auth0_trigger_binding.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"net/http"
55

66
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
7+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
78

89
"gopkg.in/auth0.v5"
910
"gopkg.in/auth0.v5/management"
@@ -23,9 +24,21 @@ func newTriggerBinding() *schema.Resource {
2324

2425
Schema: map[string]*schema.Schema{
2526
"trigger": {
26-
Type: schema.TypeString,
27-
Required: true,
28-
ForceNew: true,
27+
Type: schema.TypeString,
28+
Required: true,
29+
ForceNew: true,
30+
ValidateFunc: validation.StringInSlice([]string{
31+
"post-login",
32+
"credentials-exchange",
33+
"pre-user-registration",
34+
"post-user-registration",
35+
"post-change-password",
36+
"send-phone-message",
37+
"iga-approval",
38+
"iga-certification",
39+
"iga-fulfillment-assignment",
40+
"iga-fulfillment-execution",
41+
}, false),
2942
Description: "The id of the trigger to bind with",
3043
},
3144
"actions": {

0 commit comments

Comments
 (0)