sam publish supports publishing applications recursively
Describe your idea/feature/enhancement
sam publish command currently only publish the template to SAR. But if the template has nested applications in it that is referenced to local templates, it does not publish the nested applications.
For example, I have the following two templates:
parent.template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Metadata:
AWS::ServerlessRepo::Application:
Name: parent-application
Description: >-
This is my parent application.
Author: luhong
SpdxLicenseId: Apache-2.0
SemanticVersion: 0.1.1
LicenseUrl: LICENSE
ReadmeUrl: README.md
Resources:
NestedApp:
Type: 'AWS::Serverless::Application'
Properties:
Location: 'nested.template.yaml'
nested.template.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
queue:
Type: 'AWS::SQS::Queue'
When I run sam publish -t parent.template.yaml, it should publish both parent.template.yaml and nested.template.yaml to SAR. In parent.template.yaml, the location should be changed to the applicationId and semanticVersion of nested.template.yaml app in SAR.
+1
The new --signing-profiles option for sam package and sam deploy should ideally also have support for Nested Stacks when this feature is implemented
I don't think that implicit deployments are a good idea in this scenario. If nested app deserves deployment, it should be done explicitly. IMO it just should be allowed for an app to have multiple nested local templates, that would be packed and published and once application is deployed it would create nested stacks, the same it happens when we directly deploy such apps.