Cloudformation giving error “Requires capabilities : [CAPABILITY_AUTO_EXPAND]”

喜夏-厌秋 提交于 2021-01-29 07:30:52

问题


I am trying to implement Continuous Deployment for my .net core app. When lambda function is invoked, I'am trying to create a cloudformation to spin up the resources. But getting error:

Creating Cloud Formation stack: gateway-api-uat-stack Failed to create stack: gateway-api-uat-stack. Reason: Detailed Message: Requires capabilities : [CAPABILITY_AUTO_EXPAND] (Service: AmazonCloudFormation; Status Code: 400; Error Code: InsufficientCapabilitiesException; Request ID: 4779587c-2a17-11e9-a093-c1704a1bf953) Status Code: 400 Error Code: InsufficientCapabilitiesException

Deleting Cloud Formation stack: gateway-api-uat-stack Cloud Formation stack: gateway-api-uat-stack deleted successfully Finished: FAILURE

This is my serverless.template file

"AspNetCoreFunction" : {
  "Type" : "AWS::Serverless::Function",
  "Properties": {
    "Handler": "Handler-name",
    "Runtime": "dotnetcore2.0",
    "CodeUri": "",
    "MemorySize": 512,
    "Timeout": 300,
    "Role": null,
    "Policies": [ "AWSLambdaFullAccess" ],
    "Environment" : {
      "Variables" : {
      }
    },
    "Events": {
      "ProxyResource": {
        "Type": "Api",
        "Properties": {
          "Path": "/{proxy+}",
          "Method": "ANY"
        }
      },
          "RootResource": {
        "Type": "Api",
        "Properties": {
          "Path": "/",
          "Method": "ANY"
        }
      }
    }
  }

}

}


回答1:


When using the Transform: AWS::Serverless-2016-10-31, Cloudformation requires the CAPABILITY_AUTO_EXPAND.

If you're deploying from the command line, add --capabilities CAPABILITY_AUTO_EXPAND to your create / deploy command.



来源:https://stackoverflow.com/questions/54555691/cloudformation-giving-error-requires-capabilities-capability-auto-expand

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!