serverless-plugin-additional-stacks
serverless-plugin-additional-stacks copied to clipboard
Doesn't accept url of file as serverless resources does
serverless accepts:
resources:
- ${file(resources/s3-bucket.yml)}
This fails with ServerlessError: Template format error: Any Resources member must be an object.
Its unpractical to have all definitions in one file
Yes you can. The structure would be like this
custom:
additionalStacks:
Bucket: ${file(resources/s3-bucket.yml)}
and you can add DeployParameters within that template
Is there a way to include multiple files in this way?
i.e. this does not seem to work:
custom:
additionalStacks:
Datastores:
-${file(resources/s3.yml)}
-${file(resources/dynamodb.yml)}
This would be much better for composing templates.
As of today this issue is still not resolved.
In the full Serverless library, the resources and functions elements can be defined as arrays, allowing them to be defined in multiple separate files, like so:
resources:
- ${file(resources/s3.yml)}
- ${file(resources/dynamodb.yml)}
This functionality is powered by the following code:
https://github.com/serverless/serverless/blob/73107822945a878abbdebe2309e8e9d87cc2858a/lib/classes/Service.js#L157
I'm going to look into making a pull request possibly soon.
Sounds like a good idea to merge the arrays into one object in the same way as Serverless Core does.
@kennu I have implemented this feature into pull request #26. A review would be greatly appreciated.