Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated verification_method from custom domain resource #143

Merged
merged 1 commit into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're removing this as it's been deprecated and no longer accepted by the API (checked the schemas and it's not there any more). This was forcing this resource to always recreate as ForceNew was set to true.

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