首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Azure Terraform API管理图形API支持

Azure Terraform API管理图形API支持
EN

Stack Overflow用户
提问于 2022-04-17 22:58:50
回答 1查看 208关注 0票数 0

我正在用GraphQL在Azure上创建APIM。这仍处于预览阶段,因此到目前为止,我只能在门户中创建它们,或者通过PUT请求使用Azure API Rest。

我正在尝试将所有这些迁移到Terraform,但我没有找到任何关于是否有任何方法使用Terraform创建GraphQL API或甚至使用模块的信息的网站。

我想做的是这样的事情:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
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进口

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2022-04-20 09:45:04

  • 下面是使用terraform提供GraphQL API资源的插件。

此提供程序具有多个配置输入。在大多数情况下,只使用urlheaders

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
provider "graphql" {
  url = "https://your-graphql-server-url"
  headers = {
    "header1" = "header1-value"
    "header2" = "header2-value"
    ...
  }
}
  • 下面是带有terraform的GraphQl API的参数GraphQl。
  • 下面是用terraform创建GraphQL api的完整的GraphQL。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71908570

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文