You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Internal transform failure for StageName defined by reference in a SAM template #19
Hi, I'm trying to create a simple stack for SAM that references a Swagger file using this configuration:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
APIStage:
Default: dev
Description: Name of the API stage to use for deployment
Type: String
AllowedPattern: '[A-Za-z0-9-]*'
Resources:
Api:
Type: AWS::Serverless::Api
Properties:
StageName: !Ref APIStage
DefinitionUri: models.yaml
Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Internal transform failure.
When I remove the Parameters section and set StageName: dev explicitly, the stack is created successfully. So it seems like Transform fails because of the APIStage reference, even though the template is validated successfully before CloudFormation calls Transform.
Update: I got a bit confused but now it seems clear that this issue is specific to how Transform processes referenced StageName for AWS::Serverless::Api rather than being a generic issue with processing referenced variables. For example, the following template was adopted from the HelloWorld example and appears to work correctly:
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Parameters:
APIStage:
Default: dev
Description: Name of the API stage to use for deployment
Type: String
AllowedPattern: '[A-Za-z0-9-]*'
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs4.3
Environment:
Variables:
APIStage: !Ref APIStage
changed the title [-]Internal transform failure for parameters referenced in a SAM template[/-][+]Internal transform failure for StageName defined by reference in a SAM template[/+]on Nov 23, 2016
Activity
dinvlad commentedon Nov 23, 2016
Update: I got a bit confused but now it seems clear that this issue is specific to how Transform processes referenced
StageNameforAWS::Serverless::Apirather than being a generic issue with processing referenced variables. For example, the following template was adopted from the HelloWorld example and appears to work correctly:[-]Internal transform failure for parameters referenced in a SAM template[/-][+]Internal transform failure for StageName defined by reference in a SAM template[/+]sanathkr commentedon Nov 23, 2016
See #22. We don't support !Ref on the StageName parameter yet.
sanathkr commentedon Nov 23, 2016
I am closing this issue in favor of tracking the problems thru #22 and #20