【发布时间】:2019-07-12 01:08:58
【问题描述】:
我有以下 Swagger 定义文件,我可以通过 AWS 控制台中的“导入 API”选项将其导入现有的 AWS API Gateway。现在,我想使用 CloudFormation 模板做同样的事情。我想知道是否可以通过 CloudFormation 模板使用“PATHS”更新现有的 AWS API Gateway。我已阅读 AWS 中的文档,但找不到任何信息。 AWS::ApiGateway::RestApi 资源无法引用现有的 AWS API Gateway。现有 API Gateway 是从 AWS 控制台手动创建的(即,不是通过 CloudFormation 模板创建的)
{
"openapi": "3.0.1",
"info": {
"title": "Common API",
"description": "defaultDescription",
"version": "0.3"
},
"servers": [
{
"url": "http://localhost:32780"
}
],
"paths": {
"/catalogs": {
"get": {
"description": "Auto generated using Swagger Inspector",
"parameters": [
{
"name": "language",
"in": "query",
"required": false,
"style": "form",
"explode": true,
"example": "en"
},
{
"name": "category",
"in": "query",
"required": false,
"style": "form",
"explode": true,
"example": "region"
},
{
"name": "subcategory",
"in": "query",
"required": false,
"style": "form",
"explode": true,
"example": "group"
}
],
"responses": {
"200": {
"description": "Auto generated using Swagger Inspector",
"content": {
"application/json;charset=UTF-8": {
"schema": {
"type": "string"
},
"examples": {}
}
}
}
},
"servers": [
{
"url": "http://localhost:32780"
}
]
},
"servers": [
{
"url": "http://localhost:32780"
}
]
}
}
}
【问题讨论】:
标签: aws-api-gateway