我正在用GraphQL在Azure上创建APIM。这仍处于预览阶段,因此到目前为止,我只能在门户中创建它们,或者通过PUT请求使用Azure API Rest。
我正在尝试将所有这些迁移到Terraform,但我没有找到任何关于是否有任何方法使用Terraform创建GraphQL API或甚至使用模块的信息的网站。
我想做的是这样的事情:
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_api_management" "example" {
name = "example-apim"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
publisher_name = "My Company"
publisher_email = "company@terraform.io"
sku_name = "Developer_1"
}
resource "azurerm_api_management_api" "example" {
name = "example-api"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
revision = "1"
display_name = "Example API"
path = "example"
protocols = ["https"]
import {
content_format = "graphql-file"
content_value = "schema.graphql"
}
}
我是Terraform的新手,我有点迷路了,因为我在官方页面或任何地方都找不到关于这个问题的任何文档。
编辑:我想找到的是用Terraform自动化这个过程:GraphQL进口
谢谢。
发布于 2022-04-20 09:45:04
此提供程序具有多个配置输入。在大多数情况下,只使用url
和headers
,
provider "graphql" {
url = "https://your-graphql-server-url"
headers = {
"header1" = "header1-value"
"header2" = "header2-value"
...
}
}
https://stackoverflow.com/questions/71908570
复制相似问题