aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

sam publish supports publishing applications recursively

Open honglu opened this issue 6 years ago • 2 comments

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.

honglu avatar Oct 03 '19 20:10 honglu

+1

dtelaroli avatar Aug 31 '20 17:08 dtelaroli

The new --signing-profiles option for sam package and sam deploy should ideally also have support for Nested Stacks when this feature is implemented

dontirun avatar Nov 27 '20 22:11 dontirun

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.

iamnotadamkr avatar Feb 07 '23 21:02 iamnotadamkr