Is it possible to import the contents of an external file as a value in serverless.yml. My usecase is for creating an AWS CloudWatch Dashboard, the DashboardBody
element takes a string of JSON configuration. I could just write this into the yaml file, but it would be way nicer if I could do the following:
resources:
DashboardIntegrationMonitor:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardName: "${self:provider.stage}Importer"
DashboardBody: "${file(./dashboard.json)}"
But serverless will read the json file and insert it as the content of DashboardBody:
"DashboardIntegrationMonitor": {
"Type": "AWS::CloudWatch::Dashboard",
"Properties": {
"DashboardName": "stagingImporter",
"DashboardBody": {
"widgets": [
...
]
instead of
"DashboardIntegrationMonitor": {
"Type": "AWS::CloudWatch::Dashboard",
"Properties": {
"DashboardName": "stagingImporter",
"DashboardBody": "{\"widgets\": [...]}"
Is this possible?