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

Support for triggering a azurerm_container_app_job with new resource type azurerm_container_app_job_schedule_run_now #26885

Open
1 task done
jaredfholgate opened this issue Jul 31, 2024 · 0 comments

Comments

@jaredfholgate
Copy link
Contributor

jaredfholgate commented Jul 31, 2024

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 comments along the lines of "+1", "me too" or "any updates", 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.

Description

I would like to be able to immediately trigger a container app job after it's creation. Currently there is no way to achieve this with Terraform.

At the moment the only fudge is to create a scheduled job and schedule for a few minutes ahead of time.

New or Affected Resource(s)/Data Source(s)

azurerm_container_app_job_schedule_run_now

Potential Terraform Configuration

Taking the same pattern as azurerm_container_registry_task_schedule_run_now, create a new resource called azurerm_container_app_job_schedule_run_now.

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_log_analytics_workspace" "example" {
  name                = "example-log-analytics-workspace"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "PerGB2018"
  retention_in_days   = 30
}

resource "azurerm_container_app_environment" "example" {
  name                       = "example-container-app-environment"
  location                   = azurerm_resource_group.example.location
  resource_group_name        = azurerm_resource_group.example.name
  log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id
}

resource "azurerm_container_app_job" "example" {
  name                         = "example-container-app-job"
  location                     = azurerm_resource_group.example.location
  resource_group_name          = azurerm_resource_group.example.name
  container_app_environment_id = azurerm_container_app_environment.example.id

  replica_timeout_in_seconds = 10
  replica_retry_limit        = 10
  manual_trigger_config {
    parallelism              = 4
    replica_completion_count = 1
  }

  template {
    container {
      image = "repo/testcontainerAppsJob0:v1"
      name  = "testcontainerappsjob0"
      cpu    = 0.5
      memory = "1Gi"
    }
  }
}

resource "azurerm_container_app_job_schedule_run_now" "example" {
  container_app_job_id = azurerm_container_app_job.example.id
}

References

This API should be able to trigger it:

@jaredfholgate jaredfholgate changed the title Support for triggering a azurerm_container_app_job with new resource type Support for triggering a azurerm_container_app_job with new resource type azurerm_container_app_job_schedule_run_now Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants