Skip to content

Commit

Permalink
Enabling import
Browse files Browse the repository at this point in the history
  • Loading branch information
fformica committed Jun 6, 2024
1 parent e7403a2 commit 01b1b2b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
20 changes: 11 additions & 9 deletions ns1/resource_redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ func redirectConfigResource() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
},
},
Create: RedirectConfigCreate,
Read: RedirectConfigRead,
Update: RedirectConfigUpdate,
Delete: RedirectConfigDelete,
Create: RedirectConfigCreate,
Read: RedirectConfigRead,
Update: RedirectConfigUpdate,
Delete: RedirectConfigDelete,
Importer: &schema.ResourceImporter{},
}
}

Expand Down Expand Up @@ -144,10 +145,11 @@ func redirectCertificateResource() *schema.Resource {
Computed: true,
},
},
Create: RedirectCertCreate,
Read: RedirectCertRead,
Update: RedirectCertUpdate,
Delete: RedirectCertDelete,
Create: RedirectCertCreate,
Read: RedirectCertRead,
Update: RedirectCertUpdate,
Delete: RedirectCertDelete,
Importer: &schema.ResourceImporter{},
}
}

Expand Down Expand Up @@ -304,7 +306,7 @@ func validateDomain(val interface{}, key string) (warns []string, errs []error)
return warns, errs
}

// validatePath verifies that the pstringath matches a valid URL path.
// validatePath verifies that the path matches a valid URL path.
func validatePath(val interface{}, key string) (warns []string, errs []error) {
v := val.(string)

Expand Down
10 changes: 10 additions & 0 deletions ns1/resource_redirect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ func TestAccRedirectConfig_basic(t *testing.T) {
testAccCheckRedirectConfigTags(&redirect, []string{}),
),
},
{
ResourceName: "ns1_redirect.it",
ImportState: true,
ImportStateVerify: true,
},
{
ResourceName: "ns1_redirect_certificate.example",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down

0 comments on commit 01b1b2b

Please sign in to comment.