# 'Error: 409 Conflict: That action name has already been taken' when trying to use terraform to modify a custom action

**URL:** <https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986>\
**Category:** Get Help\
**Tags:** actions-management-api, management-api\
**Created:** [April 15, 2026, 3:23pm UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986 "2026-04-15T15:23:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayan.bhattacharya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shayan.bhattacharya/32/72644_2.png) [@shayan.bhattacharya](https://community.auth0.com/u/shayan.bhattacharya)\
**Post date:** [April 15, 2026, 3:23pm UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986/1 "2026-04-15T15:23:05Z")

</div>

I am in the process of making it so that my team uses Terraform to carry out Auth0 changes instead of doing so in the browser. I made modules for email templates and custom\_text\_prompts and successfully tested, meaning I can now edit these resources through vs code and terraform apply and the changes show up in the dashboard. However,my module for custom actions has not been so successful: I tried to do a terraform apply for various custom actions and get ‘│ Error: 409 Conflict: That action name has already been taken.  
│  
│ with module.test\_action.auth0\_action.this,  
│ on modules\custom\_actions\main.tf line 11, in resource “auth0\_action” “this”:  
│ 11: resource “auth0\_action” “this” {  
│‘. The block in the main.tf where it is invoked is ‘module “test\_action” {  
source = “./modules/custom\_actions”  
name = “test”  
code = file(“scripts/test\_action.js”)  
runtime = “node18”  
trigger\_id = “pre-user-registration”  
trigger\_version = “v2”

}‘, my main.tf file in the ‘custom actions’ folder is ‘terraform {  
required\_version = “\>= 1.5.0”  
required\_providers {  
auth0 = {  
source = “auth0/auth0”  
version = “\>= 1.0.0”  
}  
}  
}

resource “auth0\_action” “this” {  
name = var.name  
code = var.code  
runtime = var.runtime  
deploy = var.deploy

supported\_triggers {  
id = var.trigger\_id  
version = var.trigger\_version  
}

# Use for\_each with list of objects

dynamic “dependencies” {  
for\_each = var.dependencies  
content {  
name = dependencies.value.name  
version = dependencies.value.version  
}  
}

```auto
# Similarly for secrets

```

dynamic “secrets” {  
for\_each = var.secrets  
content {  
name = secrets.value.name  
value = secrets.value.value  
}  
}  
}‘ and my variables.tf file for it is ‘variable “name” {  
type = string  
description = “Name of the custom action”  
}

variable “code” {  
type = string  
description = “The code of the custom action”  
}

variable “runtime” {  
type = string  
default = “node18”  
description = “Node runtime (node12, node16, node18, node22)”  
}

variable “deploy” {  
type = bool  
default = true  
}

variable “trigger\_id” {  
type = string  
description = “ID of the trigger, e.g., ‘post-login’”  
}

variable “trigger\_version” {  
type = string  
default = “v3”  
description = “Version of the trigger, e.g., ‘v3’”  
}

variable “dependencies” {  
description = “List of dependencies”  
type = list(object({  
name = string  
version = string  
}))  
default =   
}

variable “secrets” {  
description = “List of secrets”  
type = list(object({  
name = string  
value = string  
}))  
default =   
}‘

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [April 15, 2026, 7:56pm UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986/3 "2026-04-15T19:56:20Z")

</div>

Hi @shayan.bhattacharya,

Welcome to the Auth0 Community!

Thank you for reaching out. The error `Error: 409 Conflict: That action name has already been taken` indicates that an Action with the name “test” already exists in your Auth0 tenant. This is a common Terraform state management issue that happens when a resource is already created outside of your current Terraform workspace, causing a mismatch between what Terraform expects and what actually exists in your tenant.

This happens because Terraform keeps a record of the resources it manages (its “state file”). While performing a `resource "auth0_action" "this"`, since there isn’t an existing “test” action in its records, Terraform’s behavior is to try and create it, which causes the conflict.

The solution for actions that can be deleted from the dashboard ( unlike “custom phone provider” actions ) is to simply delete it from the Actions Library and retry.

I hope this helps, and if you have further questions please let me know!  
Kind regards,  
Remus

---

<div class="post-metadata">

**Author:** ![shayan.bhattacharya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shayan.bhattacharya/32/72644_2.png) [@shayan.bhattacharya](https://community.auth0.com/u/shayan.bhattacharya)\
**Post date:** [April 16, 2026, 7:50am UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986/4 "2026-04-16T07:50:12Z")

</div>

Thanks for replying so soon. I am a tad confused though because when I did my modules for the email templates and custom text prompts, these resources were already created for me via the dashboard and so when I applied these modules, I ended up updating them rather than terraform thinking I wanted to create new ones. Not sure why this hasn’t been the case for custom actions. Could I use terraform import maybe?

---

<div class="post-metadata">

**Author:** ![shayan.bhattacharya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shayan.bhattacharya/32/72644_2.png) [@shayan.bhattacharya](https://community.auth0.com/u/shayan.bhattacharya)\
**Post date:** [April 16, 2026, 8:49am UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986/5 "2026-04-16T08:49:34Z")

</div>

UPDATE: I fixed it with terraform import

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [April 16, 2026, 4:47pm UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986/6 "2026-04-16T16:47:48Z")

</div>

Hi @shayan.bhattacharya,

That is great to hear!

When managing existing resources from your existing environment the `terraform import` method is overall considered best practice, as it’s non-destructive, while deleting and recreating a specific action would generally just be the quickest fix.

Thank you for your response.  
Best regards,  
Remus

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 26, 2026, 3:03pm UTC](https://community.auth0.com/t/error-409-conflict-that-action-name-has-already-been-taken-when-trying-to-use-terraform-to-modify-a-custom-action/198986/7 "2026-05-26T15:03:24Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
