After upgrading to variablesResolutionMode: 20210326 in Serverless 2, or upgrading to Serverless 3, I'm now getting errors when trying to use native serverless variables such as ${aws:region}, ${aws:accountId}, ${ApiGatewayRestApi}, and ${sls:stage}, as well as custom variables such as ${self:custom.deletionPolicy}. These work correctly in the root serverless.yml but aren't resolved in the modularized templates.
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [aws:accountId, sls:stage, aws:region] in the Resources block of the template
The CloudFormation template is invalid: Template format error: Unrecognized DeletionPolicy ${self:custom.deletionPolicy} for resource CognitoUserPool