hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

Support for Backend Circuit Breaker and Load-balanced Pool in APIM #24594

Open alexwiese opened 9 months ago

alexwiese commented 9 months ago

Is there an existing issue for this?

Community Note

Description

APIM now supports two new Backend features:

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

azurerm_api_management_backend

Potential Terraform Configuration

resource "azurerm_api_management_backend" "example" {
  name                = "example-backend"
  resource_group_name = azurerm_resource_group.example.name
  api_management_name = azurerm_api_management.example.name
  protocol            = "http"
  url                 = "https://backend"

  circuit_breaker {
      rules = [
        {
          failure_condition = {
            count = 3
            error_reasons = [
              'Server errors'
            ]
            interval = 'P1D'
            status_code_ranges = [
              {
                minimum  = 500
                maximum = 599
              }
            ]
          }
          name=  "myBreakerRule"
          trip_duration= "PT1H"
        }
      ]
    }    
}

resource "azurerm_api_management_backend" "pool" {
  name                = "example-pool-backend"
  resource_group_name = azurerm_resource_group.example.name
  api_management_name = azurerm_api_management.example.name
  protocol            = "http"
  url                 = "https://backend"

  type = "Pool"

  pool {
      services = [ "/backends/example-backend-1", "/backends/example-backend-2" ]
  }
}

References

https://learn.microsoft.com/en-gb/azure/api-management/backends?tabs=bicep#circuit-breaker-preview https://learn.microsoft.com/en-gb/azure/api-management/backends?tabs=bicep#load-balanced-pool-preview

dribblor commented 5 months ago

Now that circuit breaker and load balanced pool is in GA, it would be cool to see this in azurerm too.

rebla commented 1 month ago

Any updates here? Is it going to be implemented on the provider?

Gabe-Kelly01 commented 1 month ago

Bumping this thread because I'd love to see this feature supported in Terraform once it's out of GA. I recommend using the azapi provider in the meantime, I've had a lot of success using it for load balanced pools and custom metrics in my APIM applications.

savage-alex commented 2 weeks ago

Bumping please. Would be so much nicer to do it natively than using azapi. Thank you