diff --git a/docs/resources/hook.md b/docs/resources/hook.md index 18df2cd0b..edec91454 100644 --- a/docs/resources/hook.md +++ b/docs/resources/hook.md @@ -8,6 +8,9 @@ description: |- Hooks are secure, self-contained functions that allow you to customize the behavior of Auth0 when executed for selected extensibility points of the Auth0 platform. Auth0 invokes Hooks during runtime to execute your custom Node.js code. Depending on the extensibility point, you can use Hooks with Database Connections and/or Passwordless Connections. +!> This resource is deprecated. Refer to the [guide on how to migrate from rules to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions) +and manage your actions using the `auth0_action` resource. + ## Example Usage ```terraform diff --git a/docs/resources/rule.md b/docs/resources/rule.md index bee787a79..6a5a718c7 100644 --- a/docs/resources/rule.md +++ b/docs/resources/rule.md @@ -8,6 +8,9 @@ description: |- With Auth0, you can create custom Javascript snippets that run in a secure, isolated sandbox as part of your authentication pipeline, which are otherwise known as rules. This resource allows you to create and manage rules. You can create global variable for use with rules by using the `auth0_rule_config` resource. +!> This resource is deprecated. Refer to the [guide on how to migrate from hooks to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-hooks-to-actions) +and manage your actions using the `auth0_action` resource. + ## Example Usage ```terraform diff --git a/internal/auth0/hook/resource.go b/internal/auth0/hook/resource.go index 8869d85b6..d50f52a3f 100644 --- a/internal/auth0/hook/resource.go +++ b/internal/auth0/hook/resource.go @@ -17,6 +17,8 @@ import ( // NewResource will return a new auth0_hook resource. func NewResource() *schema.Resource { return &schema.Resource{ + DeprecationMessage: "This resource is deprecated. Refer to the [guide on how to migrate from hooks to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-hooks-to-actions) " + + "and manage your actions using the `auth0_action` resource.", CreateContext: createHook, ReadContext: readHook, UpdateContext: updateHook, diff --git a/internal/auth0/rule/resource.go b/internal/auth0/rule/resource.go index 1864958cd..6caf3bdb1 100644 --- a/internal/auth0/rule/resource.go +++ b/internal/auth0/rule/resource.go @@ -20,6 +20,8 @@ var ruleNameRegexp = regexp.MustCompile(`^[^\s-][\w -]+[^\s-]$`) // NewResource will return a new auth0_rule resource. func NewResource() *schema.Resource { return &schema.Resource{ + DeprecationMessage: "This resource is deprecated. Refer to the [guide on how to migrate from rules to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions) " + + "and manage your actions using the `auth0_action` resource.", CreateContext: createRule, ReadContext: readRule, UpdateContext: updateRule, diff --git a/templates/resources/hook.md.tmpl b/templates/resources/hook.md.tmpl new file mode 100644 index 000000000..0cd07ed01 --- /dev/null +++ b/templates/resources/hook.md.tmpl @@ -0,0 +1,32 @@ +--- +page_title: "{{.Type}}: {{.Name}}" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Type}}: {{.Name}} + +{{ .Description | trimspace }} + +!> This resource is deprecated. Refer to the [guide on how to migrate from rules to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions) +and manage your actions using the `auth0_action` resource. + +{{ if .HasExample -}} + +## Example Usage + +{{ tffile .ExampleFile }} + +{{- end }} + +{{ .SchemaMarkdown | trimspace }} + +{{ if .HasImport -}} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }} diff --git a/templates/resources/rule.md.tmpl b/templates/resources/rule.md.tmpl new file mode 100644 index 000000000..2a1835d12 --- /dev/null +++ b/templates/resources/rule.md.tmpl @@ -0,0 +1,32 @@ +--- +page_title: "{{.Type}}: {{.Name}}" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Type}}: {{.Name}} + +{{ .Description | trimspace }} + +!> This resource is deprecated. Refer to the [guide on how to migrate from hooks to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-hooks-to-actions) +and manage your actions using the `auth0_action` resource. + +{{ if .HasExample -}} + +## Example Usage + +{{ tffile .ExampleFile }} + +{{- end }} + +{{ .SchemaMarkdown | trimspace }} + +{{ if .HasImport -}} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" .ImportFile }} + +{{- end }}