How to Deploy Action Modules and Use the Latest Version of the Module in Actions Atomically Within Auth0

Overview

When using the Auth0 Deploy CLI or the Auth0 Terraform Provider within Continuous Integration (CI) and Continuous Deployment (CD) pipelines, atomically updating an Action Module and having the corresponding Action immediately reference the latest version fails. This occurs because the underlying Management API lacks support for configuring an Action to automatically use the latest version of an Action Module. Resolve this by updating Action Modules directly via the Management API within the CI/CD pipeline and passing the new version into the deployment tool as a variable.

Applies To

  • Auth0 Deploy CLI
  • Auth0 Terraform Provider

Cause

The underlying Management API does not support configuring an Action to automatically use the latest version of an Action Module. Consequently, atomically updating an Action Module and having the corresponding Action immediately reference the latest version fails through the standard Deploy CLI or Terraform Provider workflows alone.

 

Solution

The recommended workaround involves updating Action Modules directly via the Management API within the CI/CD pipeline while continuing to manage all other settings with the Auth0 Deploy CLI or Auth0 Terraform Provider. Pass the new Action Module version into the deployment tool as a variable, ensuring the Action references it atomically in the same pipeline execution.

 

 

How is the Auth0 Deploy CLI configured to use the latest Action Module version?

 

Configure the Auth0 Deploy CLI to exclude Action Modules, update them via the Management API, and inject the new version into the Action configuration by executing the following steps.

  1. Exclude Action Modules from Deploy CLI management by using AUTH0_EXCLUDED for actionModules so the Deploy CLI ignores them. Review the Exclude Resources from Management documentation for more details.
  2. Call the Management API in the pipeline to create or update the Action Module and capture the new version identifier returned in the response.
  3. Inject the new version into the Action configuration when the Deploy CLI runs by using AUTH0_KEYWORD_REPLACE_MAPPINGS. Review the Keyword Replacement documentation for more details. This ensures the Action references the newly deployed Action Module version in the same pipeline execution.

 

 

How is the Auth0 Terraform Provider configured to use the latest Action Module version?

 

Configure the Auth0 Terraform Provider to exclude Action Modules, update them via the Management API, and inject the new version into Terraform as a variable by executing the following steps.

  1. Exclude Action Modules from Terraform management by omitting them as auth0_* resources in Terraform. If they already exist, use lifecycle.ignore_changes on the version-related attributes, or remove them from the state with terraform state rm so the Management API manages them exclusively.
  2. Call the Management API in the pipeline before terraform apply to create or update the Action Module and capture the resulting version identifier.
  3. Inject the version into Terraform using a TF_VAR_<name> environment variable, a -var flag on the CLI, or a generated *.auto.tfvars file that an earlier pipeline step writes.

 

 

 

 

Recommended content

No recommended content found...