Difference between CloudFormation stack and Serverless application (published to a repository)

216 Views Asked by At

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.

1

There are 1 best solutions below

0
On

Publishing means your function could be find and used by other parties.

You can use the AWS SAM CLI to publish your application to the AWS Serverless Application Repository to make it available for others to find and deploy.

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.