with private applications in mind, I'm struggling to understand the difference between CloudFormation stacks and Serverless Application published to a repository.
I have a SAM template with a couple of functions. I then build
, package
and deploy
it with SAM CLI.
At this point I have a CF stack and and I can call my functions using boto3
python lib.
lambda_client.invoke(
FunctionName="MyFunctionName",
Payload=bytes(json.dumps(test_event), encoding='utf8'),
Qualifier="live"
)
What us the purpose of publish
command (which publishes to Serverless Application Repository)?
If I published my application as private, how would I call my functions via that application. Seems to me that executing the functions would still be done the same way as without publishing it.
Publishing means your function could be find and used by other parties.
Example: Share applications across your teams and organizations to reduce duplicated development efforts and promote consistency and best practices.
If you use your function only without your account and you don't plan to share it is not required to publish it.