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.
resource "auth0_rule" "my_rule" {
name = "empty-rule"
script = <<EOF
function (user, context, callback) {
callback(null, user, context);
}
EOF
enabled = true
}
function (user, context, callback) {
callback(null, user, context);
}
EOF
enabled = true
}
name
(String) Name of the rule. May only contain alphanumeric characters, spaces, and hyphens. May neither start nor end with hyphens or spaces.script
(String) Code to be executed when the rule runs.enabled
(Boolean) Indicates whether the rule is enabled.order
(Number) Order in which the rule executes relative to other rules. Lower-valued rules execute first.id
(String) The ID of this resource.Import is supported using the following syntax:
# Existing rules can be imported using their ID.
#
# Example:
terraform import auth0_rule.my_rule "rul_XXXXXXXXXXXXX"