Skip to content

Using parameters in SAM file in DefinitionUri #101

@ghost

Description

Hi, FYI in my SAM file this works:
StageName: !Ref "Env"
DefinitionUri: "swagger-dev.yml"

But this doesn't work:
StageName: !Ref "Env"
DefinitionUri: !Sub "swagger-${Env}.yml"

And this also doesn't work:
StageName: !Ref "Env"
DefinitionUri:
Fn::Join:
- ''
- - "swagger-"
- !Ref: "Env"
- ".yml"

The error I get is:
"FAILED - Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [Api] is invalid. 'DefinitionUri' requires Bucket and Key properties to be specified"

My parameter is defined as:

Parameters:
Env:
Description: The environment id.
Type: String
ConstraintDescription: Can contain only one of the supported environment ids.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions