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.51k stars 4.6k forks source link

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

Open alexwiese opened 7 months ago

alexwiese commented 7 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 3 months ago

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