问题
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