aws-apigateway RestApi deployOptions失败

时间:2019-09-19 01:25:07

标签: aws-cdk

所以我有一个问题,我可以使用以下声明创建REST API

const restApi = new apigw.RestApi(this, 'Api_Name_Here', {
      description: 'API Description'
    });

我可以进行cdk部署,一切都很好。但是,当我添加deployOptions以指定阶段名称时,就像这样

const restApi = new apigw.RestApi(this, 'Api_Name_here', {
      description: 'API Description',
      deployOptions: {
        stageName: 'dev'
      }
    });

失败,出现以下错误

The final policy size (20806) is bigger than the limit (20480). (Service: AWSLambda; Status Code: 400; Error Code: PolicyLengthExceededException; Request ID: 4d13d438-93ab-441b-bf32-c7a0a442693e)
   Function.addPermission (D:\proj\testing\restApi\cdk\node_modules\@aws-cdk\aws-lambda\lib\function-base.ts:191:5)
   // snipped

我该怎么做才能缩短生成的任何策略,或者可以以某种方式将其分解?

0 个答案:

没有答案