aws / serverless-application-model

The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
https://aws.amazon.com/serverless/sam
Apache License 2.0
9.33k stars 2.38k forks source link

Deploy lambda functions from AWS Serverless Repo via SAM #1380

Closed alexhall closed 4 years ago

alexhall commented 4 years ago

I would like to be able to deploy a third-party lambda function published to AWS Serverless Repo as part of a SAM template, e.g. to configure my application to use the Datadog Log Forwarder.

I've found documentation on publishing applications to Serverless Repo using SAM (https://docs.aws.amazon.com/serverlessrepo/latest/devguide/using-aws-sam.html) but consuming Serverless Repo applications with SAM doesn't appear to be supported. Is it possible to add support for this use-case?

timoschilling commented 4 years ago

Take a look on AWS::Serverless::Application

alexhall commented 4 years ago

Take a look on AWS::Serverless::Application

Ahh, thank you. I don't know how I missed that the first time around.

Is there a way of getting at the ARN of the lambda function associated with the AWS::Serverless::Application resource, so that we can reference it when creating additional resources in the SAM template?

timoschilling commented 4 years ago

The underlying Stack didn't defines a output, so I think it's not possible. But you can simply copy the function code and put it into your own stack or nested stack. You can find the source code here.

keetonian commented 4 years ago

Thank you @timoschilling for answering this! Yes, you can use an AWS::Serverless::Application to consume applications directly from the Serverless Application Repository.