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

azurerm_container_app_job allow replica_retry_limit to be equal to 0 #25983

Closed
1 task done
nathan-mittelette opened this issue May 15, 2024 · 3 comments · Fixed by #25984
Closed
1 task done

azurerm_container_app_job allow replica_retry_limit to be equal to 0 #25983

nathan-mittelette opened this issue May 15, 2024 · 3 comments · Fixed by #25984

Comments

@nathan-mittelette
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.8.3

AzureRM Provider Version

3.103.1

Affected Resource(s)/Data Source(s)

azurerm_container_app_job

Terraform Configuration Files

resource "azurerm_container_app_job" "acaj" {
  name                         = "${local.application_name_full}-acaj"
  container_app_environment_id = var.container_app_env_id
  location                     = var.location
  resource_group_name          = var.rg_name
  tags                         = var.tags

  replica_timeout_in_seconds = var.replica_timeout_in_seconds
  replica_retry_limit        = 0 // HERE
  schedule_trigger_config {
      cron_expression          = schedule_trigger_config.value.cron_expression
      parallelism              = schedule_trigger_config.value.parallelism
      replica_completion_count = schedule_trigger_config.value.replica_completion_count
  }

  // Configure the container
  template {
    container {
      // Setting the container image and resources
      name    = var.container_name
      image   = "${var.container_image}:${var.container_tag}"
      args    = var.container_args
      command = var.container_command
      cpu     = var.container_cpu
      memory  = var.container_memory
    }
  }
}

Debug Output/Panic Output

╷
│ Error: expected replica_retry_limit to be at least (1), got 0
│

Expected Behaviour

Actually, it's not possible to provide the value 0 to the attribute replica_retry_limit in the resource azurerm_container_app_job.

In the Azure Documentation, it's write that is possible to provide the value 0 for the configuration. We can also provide the value directly from the website.

Link from the documentation : here

Capture d’écran 2024-05-15 à 19 01 25

Actual Behaviour

When we provide the value 0 to the attribute replica_retry_limit we've got an validating error : Error: expected replica_retry_limit to be at least (1), got 0

Steps to Reproduce

  1. terraform apply

Important Factoids

No response

References

No response

@Chambras
Copy link
Contributor

@nathan-mittelette nice finding! I think I know where the issue is. I will try to submit a PR soon.

@nathan-mittelette
Copy link
Contributor Author

@Chambras, I've already started a pull request with this small update. I hope this saves you some time. Please take a look when you have a moment. #25984

@Chambras
Copy link
Contributor

yeah, that looks good. I think the reason it was not caught it was because there isn't a test case for that scenario...

@rcskosir rcskosir added the bug label May 15, 2024
@github-actions github-actions bot added this to the v3.104.0 milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants