我正在使用terraform设置Azure API管理,并希望将架构添加到不同的终结点(用于请求)。我正在使用“ azurerm_api_management_api_schema”和“ azurerm_api_management_api_operation”,但似乎未创建架构。
如果我在门户中创建架构/定义并查找其ID,然后使用terraform附加它,那么它将起作用。
有人能使用terraform吗?
resource "azurerm_api_management_api_schema" "cdm_schema" {
api_name = "${azurerm_api_management_api.api.name}"
resource_group_name = "${data.azurerm_resource_group.rg.name}"
api_management_name = "${azurerm_api_management.api_management.name}"
schema_id = "123"
content_type = "application/json"
value = "${file("${path.module}/schemas/cdm.json")}"
}
resource "azurerm_api_management_api_operation" "post_new_profile" {
representation = [{
content_type = "application/json"
type_name = "cdm"
schema_id = "1564397568975"
}]
}