amazon-web-services - AWS API Gateway REST API 是否没有设置来禁用 CloudFormation 模板中的执行 api 端点?

标签 amazon-web-services rest aws-cloudformation aws-api-gateway serverless-framework

我已使用 CloudFormation 模板设置 API 网关(v1,而不是 v2)REST API 资源。最近我注意到还创建了默认的execute-api端点,我可以在设置中禁用它。

enter image description here 此 API 的类型为 AWS::ApiGateway::RestApi

当然,我希望通过模板来完成此操作,所以问题是:是否可以在 CloudFormation 模板中定义此设置,而不是在 AWS 控制台中手动单击?此选项适用于 APIGateway V2 API 资源 (AWS::ApiGatewayV2::Api),但不适用于 APIGateway V1 REST API 资源 (AWS::ApiGateway: :RestApi) 在 CloudFormation 模板中,尽管可以在控制台中为 APIGateway V1 REST API 手动更改它。

还有一个CLI way of doing this对于 AWS::ApiGateway::RestApi

以下是我用来搜索此设置的一些链接:
AWS::ApiGatewayV2::API
AWS::ApiGateway::RestApi
Disabling default api-execute endpoint via CLI

最佳答案

AWS::ApiGateway::RestApi cloudformation 最近添加了对禁用默认执行 api 端点的支持:DisableExecuteApiEndpoint

MyRestApi:
  Type: 'AWS::ApiGateway::RestApi'
  Properties:
    DisableExecuteApiEndpoint: true

关于amazon-web-services - AWS API Gateway REST API 是否没有设置来禁用 CloudFormation 模板中的执行 api 端点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65628599/

相关文章:

python - 尝试上传已散列到AWS S3存储桶的文件名

python - 让 Python 脚本作为 TCP 套接字服务器在 AWS 计算机上运行

amazon-web-services - Lambda 返回有效负载 botocore.response.StreamingBody 对象打印但随后在变量中为空

RESTful 网络请求和用户事件跟踪网站

aws-cloudformation - 通过 CDK 创建 ElastiCache 参数组时如何设置(或获取)名称?

amazon-web-services - CloudFormation 模板中待纠正的错误

amazon-web-services - `AWS::RDS::DBProxy AuthFormat` 的 secret 必须包含什么

rest - 公共(public)API架构

java - 检查子页面与父页面融合的可用性的最佳方法?

amazon-ec2 - 如何使用 CloudWatch 从 Cloudformation 查看 EC2 实例的详细监控?