auth0 / terraform-provider-auth0

The Auth0 Terraform Provider is the official plugin for managing Auth0 tenant configuration through the Terraform tool.
https://registry.terraform.io/providers/auth0/auth0/latest/docs
Mozilla Public License 2.0
164 stars 79 forks source link

Action Triggers #934

Open stephenbawks opened 6 months ago

stephenbawks commented 6 months ago

Checklist

Describe the problem you'd like to have solved

I was creating an internal module for the the actions triggers (https://registry.terraform.io/providers/auth0/auth0/latest/docs/resources/trigger_actions)

I noticed that you have the id of the action. I would like to be able to specify the name of the action instead of the actual id. The main reason I bring this up is that the id is pretty useless to a human AND there is no way to actually see the action id in the console. I have to drop to the CLI or do an export to see the action id.

What I am proposing is that I want to be able to specify the name of the action that was used when it was created and be able to do a deployment with that instead of the id. Or at least I think it could be an either or situation. Where name OR id has to be specified when doing the deployment.

Describe the ideal solution

Ideally when I am specifying the Terraform I would like to be able to do something like this:

Terraform

resource "auth0_trigger_actions" "login_flow" {
  trigger = var.trigger_type

  dynamic "actions" {
    for_each = var.actions
    content {
      name         = actions.value.name
      display_name = actions.value.display_name
    }
  }
}

TFVars

trigger_type = "post-login"

  actions = [
    {
      name = "SuperAwesomeAction",
      display_name = "Create a new session",
    }
  ]

Whereas today I have to specify this instead.

trigger_type = "post-login"

  actions = [
    {
      id = "aa06a9ed-0b3c-4b7c-9bad-94b190c8389b",
      display_name = "Create a new session",
    }
  ]

Alternatives and current workarounds

Not sure if adding a data resource to look up an action via its name to pull back its id might be something that would work as well, but that might be an alternative.

Additional context

No response