With this resource, you can bind an action to a trigger. Once an action is created and deployed, it can be attached (i.e. bound) to a trigger so that it will be executed as part of a flow.
Ordering of an action within a specific flow is not currently supported when using this resource; the action will get appended to the end of the flow. To precisely manage ordering, it is advised to either do so with the dashboard UI or with the auth0_trigger_bindings
resource.
resource "auth0_action" "login_alert" {
name = "Alert after login"
code = <<-EOT
exports.onContinuePostLogin = async (event, api) => {
console.log("foo");
};"
EOT
deploy = true
supported_triggers {
id = "post-login"
version = "v3"
}
}
resource "auth0_trigger_action" "post_login_alert_action" {
trigger = "post-login"
action_id = auth0_action.login_alert.id
}
action_id
(String) The ID of the action to bind to the trigger.trigger
(String) The ID of the trigger to bind with. Available options: post-login
, credentials-exchange
, pre-user-registration
, post-user-registration
, post-change-password
, send-phone-message
, password-reset-post-challenge
, iga-approval
, iga-certification
, iga-fulfillment-assignment
, iga-fulfillment-execution
.display_name
(String) The name for this action within the trigger. This can be useful for distinguishing between multiple instances of the same action bound to a trigger. Defaults to action name when not provided.id
(String) The ID of this resource.Import is supported using the following syntax:
# This resource can be imported by specifying the
# trigger and action ID separated by "::" (note the double colon)
# <trigger>::<actionID>
#
# Example:
terraform import auth0_trigger_action.post_login_action "post-login::28b5c8fa-d371-5734-acf6-d0cf80ead918"