-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1947 from yan12125/issue1937
resource/cloudflare_email_routing_catch_all: switch to a dedicated scheme
- Loading branch information
Showing
5 changed files
with
87 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
resource/cloudflare_email_routing_catch_all: switch to a dedicated scheme to allow type = "drop" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
internal/provider/schema_cloudflare_email_routing_catch_all.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package provider | ||
|
||
import ( | ||
"fmt" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" | ||
) | ||
|
||
func resourceCloudflareEmailRoutingCatchAllSchema() map[string]*schema.Schema { | ||
return map[string]*schema.Schema{ | ||
"zone_id": { | ||
Description: "The zone identifier to target for the resource.", | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
"tag": { | ||
Description: "Routing rule identifier.", | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"name": { | ||
Description: "Routing rule name.", | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
"enabled": { | ||
Description: "Routing rule status.", | ||
Type: schema.TypeBool, | ||
Optional: true, | ||
}, | ||
"matcher": { | ||
Description: "Matching patterns to forward to your actions.", | ||
Type: schema.TypeSet, | ||
Required: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"type": { | ||
Description: fmt.Sprintf("Type of matcher. %s", renderAvailableDocumentationValuesStringSlice([]string{"all"})), | ||
Type: schema.TypeString, | ||
Required: true, | ||
ValidateFunc: validation.StringInSlice([]string{"all"}, true), | ||
}, | ||
}, | ||
}, | ||
}, | ||
"action": { | ||
Description: "List actions patterns.", | ||
Type: schema.TypeSet, | ||
Required: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"type": { | ||
Description: fmt.Sprintf("Type of supported action. %s", renderAvailableDocumentationValuesStringSlice([]string{"drop", "forward", "worker"})), | ||
Type: schema.TypeString, | ||
Required: true, | ||
ValidateFunc: validation.StringInSlice([]string{"drop", "forward", "worker"}, true), | ||
}, | ||
"value": { | ||
Description: "A list with items in the following form.", | ||
Type: schema.TypeList, | ||
Required: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
ValidateFunc: validation.StringLenBetween(0, 90), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |