-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid CloudFormation Template on initial deploy #66
Comments
I don't know which template I could take a look into, I guess it is generated? Thank you for your help! |
Can you give me more information about your service configuration? The alias plugin moves the APIG deployment to a separate stack (the alias stack). Can you check if there is a reference to the APIG deployment in the This might be missing support for a specific feature of Serverless you use (e.g. API keys are not yet supported). Maybe you can post your serverless.yml here, so that I can try to reproduce and fix the issue. |
Additionally you can use the |
Hi, your instincts are right, I am using api keys. Serverless: Stack update finished... Serverless Error --------------------------------------- [/Resources/UserGetLambdaPermissionApiGateway/DependsOn/0] 'null' values are not allowed in templates Stack Trace -------------------------------------------- ServerlessError: [/Resources/UserGetLambdaPermissionApiGateway/DependsOn/0] 'null' values are not allowed in templates Get Support -------------------------------------------- Your Environment Information ----------------------------- I checked the file cloudformation-template-update-alias-stack.json for the resource UserGetLambdaPermissionApiGateway and the DependsOn looks like this (also all the others look like this):
If needed I could send you my serverless.yml per mail. Thank you! |
That looks indeed strange. The dependency array should never ever contain null values. You could try to configure the API within there step by step to the configuration you're actually using. There must be one step where the issue happens. If that does not help, I'll have a look at your service definition and try to reproduce it. |
Thank you @HyperBrain I stripped down my serverless.yml but I can not figure out what is wrong. cloudformation-resources.json.txt |
@oleschaper Thank you for the files 👍 . I'll have a look and try to figure out, what exactly is missing in the plugin and if there's some edge case triggered here. |
It seems the error is located here:
The permissions object is not created correctly in your case. Additionally to the null dependencies, there is also an issue with the FunctionName property which is set to an empty object here. Honestly, I did not try the plugin with Java based code, only JavaScript/Node code. Maybe the SLS compile plugin generates something differently for Java packages. I'll try to setup a system where I can reproduce it. In the mean-time I'll add the help-wanted tag. Maybe someone using Java can comment on the issue. |
Thank you @HyperBrain |
Sorry that we did not have any feedback here since now 😢 . I'm not sure how many people use Java and the plugin or tried it. Just let's keep it some more time open. |
I'm getting the same error on a set of python 3.6 lambdas. I'm also using Gateway w/ keys. I'll try digging into this a bit more and see what I can find. |
Oh. it's the APIKeys. I did not add support for them yet 🤔 . Maybe I should push that and do an update release soon. |
That would be awesome - I'd be happy to test it out for you! |
I'll come back to you as soon as there is anything to test 😄 |
@killthrush Can you provide me with a simple test project that uses API keys? I want to go for an implementation within the next days and it would be better to have something at hand that reflects reality. |
@HyperBrain - here you go: https://github.com/killthrush/serverless-sample I was able to reproduce the reported error using this project. Thanks! |
@killthrush Thank you. I'll have some time over the weekend to take care of it and if it works well, also provide an implementation. |
API Key support is handled with #25 . |
I am also getting the same issue with Java Runtime for Lambda function. I am using the ApiKeys. Removing ApiKeys, it works. |
Sorry for the very late reply. I was quite overloaded with my work and maintaining the webpack plugin and Serverless. The alias plugin somehow fell off the table .... I will take care of the remaining issues now, especially API keys, DynamoDB triggers and SNS manual arns. |
Thanks! Still happy to test this out whenever there's something new to look at.
|
Thanks @HyperBrain. |
This is what I have noticed, hopefully, it'll be useful to fix the issue. I have noticed API-key creation and trying to associate with an HTTP endpoint can reproduce the issue. (API Key and usage plan creation and the association was working fine before enabling the aws-alias plugin) How I define the apiKey and usage plan
Associate with,
|
Thanks for the quick response @HyperBrain, I would really like to contribute, let me get familiar with the implementation little bit more and see how it goes. |
Any update on this? I am having the same problem with python3.6 Lambdas and API Gateway but without API Keys. |
Same problem from .Net lambda's also wihout API Keys Any update ? |
I just tried to deploy my project with the plugin enabled but it fails with this error message:
Serverless: Packaging service...
Serverless: Preparing alias ...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading CloudFormation alias file to S3...
Serverless: Validating template...
Error --------------------------------------------------
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayDeployment1499436937655] in the Resources block of the template
Stack Trace --------------------------------------------
Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayDeployment1499436937655] in the Resources block of the template
at provider.request.catch (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:25:13)
From previous event:
at AwsDeploy.validateTemplate (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:20:12)
From previous event:
at Object.aws:deploy:deploy:validateTemplate [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:102:10)
at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:233:55)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:233:22)
at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:245:17)
at AwsDeploy.BbPromise.bind.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:88:48)
From previous event:
at Object.deploy:deploy [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:84:10)
at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:233:55)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:233:22)
at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:252:17)
at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:104:33)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:91:74)
at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:23:50)
at
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: darwin
Node Version: 8.1.2
Serverless Version: 1.14.0
The text was updated successfully, but these errors were encountered: