gpt4 book ai didi

amazon-web-services - 如何更改自动生成的资源 SAM AWS 的设置

转载 作者:行者123 更新时间:2023-12-03 07:33:27 25 4
gpt4 key购买 nike

我使用 AWS::Serverless::Api 实现了 SAM 模板:

    Type: AWS::Serverless::Api
Properties:
Name:
Fn::Sub: ${AppName}-${ServiceName}
StageName: !Ref Stage
...

AWS 开发人员指南说:

"When an AWS::Serverless::Api is specified, AWS Serverless ApplicationModel (AWS SAM) always generates an AWS::ApiGateway::RestApi base AWSCloudFormation resource. In addition, it also always generates anAWS::ApiGateway::Stage and an AWS::ApiGateway::Deployment resource."

所以,我的问题是如何更改 SAM 模板自动生成的资源设置?例如,我想更改 ApiGateway.StageLoggingLevel。谢谢。

最佳答案

看看methodSettings:https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-methodsettings

示例:

    Type: AWS::Serverless::Api
Properties:
StageName: mine
MethodSettings:
- HttpMethod: ...
ResourcePath: ...
LoggingLevel: ERROR
...

关于amazon-web-services - 如何更改自动生成的资源 SAM AWS 的设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73193657/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com