I've used sam package
to package my local file to s3
.
The resulting template looks like this:
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Metadata:
AWS::ServerlessRepo::Application:
Name: test_nested_stack
# ... other fields ...
Resources:
TmpApp:
Type: AWS::Serverless::Application
Properties:
Location: https://s3.eu-west-1.amazonaws.com/{{a-bucket-name}}/{{a-file-name}}.template
# ...
When I try to publish using sam publish
, I got this error:
Error: Invalid Serverless Application Specification document. Number of errors found: 1. Errors: Resource with id [TmpApp] is invalid. Location property must be an Application Location Object referencing a valid AWS Serverless Application Repository application. Please follow the instructions in https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-publishing-applications.html
The instruction link doesn't state anything about using an S3 url as nested application location.
And in my use case I can't just publish TmpApp
to the serverless repository before because it is split into multiple nested template files.