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

Terraform plan fails when a manually deleted route is not found - Error retrieving route; Route not found #49

Open
codrinh opened this issue Nov 29, 2023 · 0 comments

Comments

@codrinh
Copy link

codrinh commented Nov 29, 2023

Terraform Version

1.5.7

Affected Resource(s)

  • mailgun_route

Expected Behavior

recreate missing resource

Actual Behavior

Throws an error:

Error retrieving route: UnexpectedResponseError URL=https://api.mailgun.net/v3/routes/6565de540d1867150b837193 ExpectedOneOf=[]int{200, 202, 204} Got=404 Error: {"message":"Route not found"}

Steps to Reproduce

  • create a new route using mailgun_route ( in my case I used for_each, might occur on a single route )
locals{

environments = toset([
    "ab",
    "bc",
    "cd"
  ])
} 

resource "mailgun_route" "environments_catch_all" {
  for_each    = local.environments
  region      = "us"
  priority    = "999"
  description = ".*@${each.key}.mywebsite.io - terraform"
  expression  = "match_recipient('.*@${each.key}\\.mywebsite\\.io')"
  actions = [
    "forward('https://${each.key}.mywebsite.io')",
    "stop()"
  ]
}
  • delete one route from the UI
  • run terraform plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant