Skip to content

Commit

Permalink
Remove deprecated verification_method from custom domain resource
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Apr 19, 2022
1 parent b9ac671 commit 27a033c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
16 changes: 4 additions & 12 deletions auth0/resource_auth0_custom_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ func newCustomDomain() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"verification_method": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: "The method is chosen according to the type of the custom domain. CNAME for auth0_managed_certs, TXT for self_managed_certs",
ValidateFunc: validation.StringInSlice([]string{"txt"}, true),
},
"verification": {
Type: schema.TypeList,
Computed: true,
Expand All @@ -72,7 +65,7 @@ func newCustomDomain() *schema.Resource {
}

func createCustomDomain(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
customDomain := buildCustomDomain(d)
customDomain := expandCustomDomain(d)
api := m.(*management.Management)
if err := api.CustomDomain.Create(customDomain); err != nil {
return diag.FromErr(err)
Expand Down Expand Up @@ -127,10 +120,9 @@ func deleteCustomDomain(ctx context.Context, d *schema.ResourceData, m interface
return nil
}

func buildCustomDomain(d *schema.ResourceData) *management.CustomDomain {
func expandCustomDomain(d *schema.ResourceData) *management.CustomDomain {
return &management.CustomDomain{
Domain: String(d, "domain"),
Type: String(d, "type"),
VerificationMethod: String(d, "verification_method"),
Domain: String(d, "domain"),
Type: String(d, "type"),
}
}
3 changes: 1 addition & 2 deletions docs/resources/custom_domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ Arguments accepted by this resource include:

* `domain` - (Required) String. Name of the custom domain.
* `type` - (Required) String. Provisioning type for the custom domain. Options include `auth0_managed_certs` and `self_managed_certs`.
* `verification_method` - (Deprecated) String. Domain verification method. The method is chosen according to the type of
the custom domain. `CNAME` for `auth0_managed_certs`, `TXT` for `self_managed_certs`.


## Attribute Reference

Expand Down

0 comments on commit 27a033c

Please sign in to comment.