Closed debttestbot closed 5 years ago
I am having the same issue, it would be great to see a full working serverless.yml example!
The plugin is looking for options.vpc, rather than options.network in the documentation. Your config should hopefully work just by changing network to vpc under custom, fargate.
That said, if the documentation is what is desired I took the liberty of making a pull request to make the plugin match it:
Changing to vpc in serverless.yml does not resolve the issue. The same error occurs.
@ptrhck It's trying to get properties for IamRoleLambdaExecution but that doesn't exist. This could be because you don't have a Lambda function declared in your serverless.yml. I've resolved this by declaring a lambda function.
@ptrhck @mrcai is correct, Fargate needs an iam role to function. This plugin re-uses the one created by the serverless framework. Unfortunately, this also means there needs to be at least 1 lambda function present, because Serverless framework doesn't create the IAM role when no function is present (which is understandable, but perhaps a bit odd).
I'll close this issue, the solution is to add at least 1 lambda function (it can be empty of course).
My use case was to not create any IAM role with Serverless because of company policy.
I got around this issue by using the override
option documented here (Advanced usage) and specifying the ARN of the existing IAM role I wanted Fargate to use.
Thanks @thomas-bc that's a perfect solution!
I just tried using this plugin from the examples in the README:
serverless-fargate-tasks version: 0.1.0
serverless.yml
:Error:
I'm fairly new to working with the serverless framework, so I'm hoping that I'm just missing a config option somewhere?