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.65k forks source link

Support for Azure API Center #26200

Open nnstt1 opened 5 months ago

nnstt1 commented 5 months ago

Is there an existing issue for this?

Community Note

Description

Azure API Center became generally available. I would like to configure API Center using Terraform.

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

azurerm_api_center_service/azurerm_api_center_workspace/azurerm_api_center_api

Potential Terraform Configuration

resource "azurerm_api_center_service" "example" {
  name                = "apicenter-example"
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_api_center_workspace" "example" {
  name                = "default"
  resource_group_name = azurerm_resource_group.example.name
  service_name        = azurerm_api_center_service.example.name
  title               = "Default workspace"
  description         = "Default workspace"
}

resource "azurerm_api_center_api" "example" {
  name                = "first-api"
  resource_group_name = azurerm_resource_group.example.name
  workspace_name      = azurerm_api_center_workspace.example.name

  kind        = "rest"
  title       = "first-api"
  summary     = "This is a test API, deployed using a template!"
  description = "This is a test API, deployed using a template!"

  contacts {
    email = "apideveloper@contoso.com"
    name  = "API Developer"
    url   = "https://learn.microsoft.com/azure/api-center/overview"
  }

  external_documentation {
    title       = "API Center documentation"
    description = "API Center documentation"
    url         = "https://learn.microsoft.com/azure/api-center/overview"
  }
}

References

nnstt1 commented 5 months ago

I'm implementing azurerm_api_center_service resource, but when updating the API Center resource, I encounter an error saying "The Sku property on the given model is null. A valid Sku is required to create or update an API Catalog." The API doesn't have an SKU parameter, and there is no process to set the SKU within the go-azure-sdk.

nnstt1 commented 4 months ago

Related issue https://github.com/Azure/azure-rest-api-specs/issues/29502