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

Provider throw 400 error when we attempt to create actions with triggers "post-user-registration" or "post-change-password" #329

Closed
6 tasks done
bt-shoprunner opened this issue Sep 22, 2022 · 4 comments
Labels
🪲 bug Something isn't working resource/auth0_action

Comments

@bt-shoprunner
Copy link

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of this provider and the issue still persists.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

My team is attempting to implement Auth0 actions via the terraform provider, and we seem to have found a bug involving the supported triggers.

Here is the snippet of terraform that we are trying to execute:

resource "auth0_action" "my_email_template" {
  depends_on = [auth0_email.my_email_provider]
  name       = format("Send Welcome Email %s", timestamp())
  runtime    = "node16"
  code       = file("${path.module}/auth0/welcome_mail.js")
  deploy     = true

  supported_triggers {
    id      = "post-user-registration"
    version = "v3"
  }
}

When attempting to execute this via terraform apply, we get the following error:

│ Error: 400 Bad Request: trigger is not supported
│ 
│   with auth0_action.my_email_template,
│   on auth0.tf line 40, in resource "auth0_action" "my_email_template":
│   40: resource "auth0_action" "my_email_template" {
│ 

This also fails for the trigger "post-change-password." The trigger "post-login" works perfectly fine, but other's just don't.

I've been using the trigger names defined here.

The issue presents with versions 0.36.0, 0.37.0, and 0.37.1 when we test this out.

Expectation

I would assume that when my terraform runs, the trigger would be applied along with the correct action.

Reproduction

Given the terraform

resource "auth0_action" "my_email_template" {
  depends_on = [auth0_email.my_email_provider]
  name       = format("Send Welcome Email %s", timestamp())
  runtime    = "node16"
  code       = file("${path.module}/auth0/welcome_mail.js")
  deploy     = true

  supported_triggers {
    id      = "post-user-registration"
    version = "v3"
  }
}```

When it is executed against an Auth0 tenant, 

Then the action is created with the correct trigger.



### Auth0 Terraform Provider version

0.37.1

### Terraform version

1.2.8
@bt-shoprunner bt-shoprunner added the 🪲 bug Something isn't working label Sep 22, 2022
@john-tipper
Copy link

I have the same issue with post-user-registration - I also don't know what the list of acceptable versions is for a given trigger. I blindly put v3 and got the same error. When I put v2 as the version, it worked.

@mparz111
Copy link

mparz111 commented Oct 7, 2022

Also having the same issue. Would be great if the documentation could be updated with all the supported triggers

@sergiught
Copy link
Contributor

Hey folks, we're trying to improve this by adding a guide on how to fetch an always up to date list of available action triggers and their versions in #370. Once that's merged and released the terraform registry docs will render the guide in a nicer format. Stay tuned!

@sergiught
Copy link
Contributor

Hey folks, we just released https://registry.terraform.io/providers/auth0/auth0/0.39.0 with a fix for this. We'll close the issue down now. Have a look at the new guide https://registry.terraform.io/providers/auth0/auth0/latest/docs/guides/action_triggers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working resource/auth0_action
Projects
None yet
Development

No branches or pull requests

4 participants