Comments (18)
This is a bug in the transform, which fails when validating the structure of Variables property. We are working on fixing it.
from serverless-application-model.
No concrete ETA yet. It is in the order of a few days. Will reply back once it done
Sorry to keep you folks waiting
from serverless-application-model.
At the moment, quickest way to validate is to call aws cloudformation create-change-set
on the SAM template. This will trigger SAM -> CloudFormation translation that does syntactical validation. If you have a bug your resource definition, like a bad permission configuration, you have to deploy to get it validated.
I understand this isn't the easiest approach, but it is the quickest at the moment. I am planning on writing a DEBUGGING guide to share this knowledge
from serverless-application-model.
Yeah, early next week we should have this fixed
from serverless-application-model.
This should be fixed now. Can you verify it works?
from serverless-application-model.
I also experienced the same thing with above syntax.
from serverless-application-model.
This could be related to #19. It seems that the way Transform processes references for the API resource may be incorrect. Perhaps it doesn't expand all of them before trying to create the resource, or something along those lines.
from serverless-application-model.
Good to know. Any eta on when a fix will be available?
from serverless-application-model.
@sanathkr Hi, any news in there. Thank you for the extended example with swagger.
from serverless-application-model.
It no longer has the "Type of property 'Variables' is invalid." error, but now variables are not expanded at all, which I describe in #34 .
from serverless-application-model.
Yeah it works perfectly for me, thanks.
from serverless-application-model.
It works for me now, thanks.
from serverless-application-model.
@sanathkr this is still failing for me. Is there something special that I need to do in order to realize the fix? I'm currently using AWS::Serverless-2016-10-31
which looks like it's the latest.
Although, it may be possible that my issue is not the same as just multi environment variables, as I seem to be experiencing it even with just a single environment variable. When I attempt to do aws cloudformation validate-template --template-body ./sam.yaml
I get the following error:
An error occurred (ValidationError) when calling the ValidateTemplate operation: Template format error: unsupported structure.
But no clue what the unsupported structure may be
from serverless-application-model.
validate-template
API currently does NOT support SAM. Are you able to deploy using aws cloudformation deploy
?
from serverless-application-model.
Ah, I see. I came to that realization myself after going backwards in my changes quite a lot to a known good SAM template. It would be fantastic if I could validate more quickly than going through a full deploy.
I'm currently attempting to do this all through CodePipeline, which worked previously until my SAM template started getting more complex (added an AWS::Serverless::SimpleTable resource, then added an AWS::DynamoDB::Table resource for a more complex table, then added some environment variables to my functions to reference these table names). So, now I'm attempting to peel everything back one at a time since I can't seem to get an error message that can give me a hint at what may be the problem.
Thanks for the quick reply @sanathkr! Any other suggestions on debugging SAM templates?
from serverless-application-model.
Awesome, a debugging guide would be fantastic! And thanks for all the hard work on this, SAM coupled with CodePipeline and the new CodeBuild functionality fills a huge gap for me! It's great stuff!
Also, for what it's worth (and just in case anyone else runs into my same issue), I found what the issue was by small re-additions. It turns out I was thinking I could cleverly name the table in the AWS::Serverless::SimpleTable
resource like I can in the AWS::DynamoDB::Table
resource, however, removing the TableName
definition from the AWS::Serverless::SimpleTable
resource seems to have fixed my deployment issue and everything seems to be humming along now!
from serverless-application-model.
Hi,
I'm trying to set the stage from outside with a cli parameter:
--parameter-overrides DeployStage=prod
Doing this the deployment ends up with a transformation error (similar as dinvlad described) if the parameter is used in the scope of AWS::Serverless::Api:
AddonApi:
Type: AWS::Serverless::Api
Properties:
StageName: !Ref DeployStage
The deployment works if I enter the stage name directly (no by using !Ref).
Should this work now or is a fix in progress? Currently, I'm using the following versions for Cloudformation:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
from serverless-application-model.
This won't work now. #22 will fix the problem.
from serverless-application-model.
Related Issues (20)
- Can't reset BinaryMediaTypes to a default value for API Gateway REST API HOT 2
- AWS::Serverless::Api auto deploys API when a resource is being added HOT 4
- Environment variables not updated HOT 5
- Bug: Using a Ref in StageName is Not Working Properly - Template.yaml HOT 4
- !If not working on Serverless:Function handler HOT 5
- how to configure KMSVerifyPolicy and KMSSignPolicy HOT 1
- Feature request: Git sync HOT 4
- Security: default permission allow any service to invoke a lambda function HOT 3
- Several tests fail with Pydantic 1.10.15 (latest 1.x) HOT 6
- (New Connector Profile) AWS Batch HOT 1
- EventInvokeConfig does not appear in processed template when following the spec HOT 3
- (New Connector Profile) AWS::ApiGateway::RestApi > AWS::Serverless::StateMachine HOT 1
- Bug: Lambda function (with alias) doesn't create a new version after its layer is updated, even if `AutoPublishAliasAllProperties` is set to `true` HOT 7
- Several tests fail with Pydantic 1.10.17 (latest 1.x) HOT 5
- Bug: No new Lambda Versions are deployed with Lambda configurations changes HOT 6
- Event sources do not invoke versioned state machines by their alias HOT 4
- Lambda layer code not updated in Lambda function during `sam sync` HOT 1
- SQS:*Batch permissions aren't vaild permissions HOT 2
- Can't use ForEach intrinsic function to define resources HOT 6
- Set Pydantic 2.* as possible dependency HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-application-model.