Open wayne-folkes opened 2 years ago
Note, a missing Runtime will fail the build but all other function globals are ignored too. Would be great if both issues can be fixed at the same time.
CFN Modules currently has the restriction that it can't access any values which are created by a Transform. So, no SAM Global values can be used as input to a Module. We are aware of this issue, but the work to fix it hasn't been scheduled yet. Upvotes to this issue would help my team get this prioritized.
(Note that Modules can be used alongside Transform as long as none of the "Transform values" are fed into Modules)
Name of the resource
Other
Resource Name
AWS::Serverless::Function
Issue Description
When using a CF module in a SAM template the Runtime value specified in the Globals section but not in the AWS::Serverless::Function resource the value appears to be ignored when attempting to deploy and will cause an error to be thrown.
Expected Behavior
The stack should deploy. To get around this issue I have to add the Runtime property to the Function.
If the module is removed from the template the function will deploy as expected when the Runtime value is only specified in the Globals section
Observed Behavior
Test Cases
A template like the following
Other Details
I opened this bug on the SAM project but that was the wrong place for it as this appears to be a Cloudformation issue
https://github.com/aws/serverless-application-model/issues/2318