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.34k stars 2.38k forks source link

Support CodePipeline Triggers #1368

Open tim-white87 opened 4 years ago

tim-white87 commented 4 years ago

Description: Feature request: I am trying to setup a SAM app and I would like my database microservice that runs migration and seeders to be triggered via CodePipeline. Right now, which CodePipeline supports the triggering of lambdas, SAM does not support a CodePipeline event source.

Steps to reproduce the issue:

  1. Setup template with an Event
  2. Add event type of "CodePipeline"

Observed result: Unsupported

Expected result: AWS::Serverless::Function templates would support all of the supported event types that lambda does.

Thanks!

praneetap commented 4 years ago

Thanks for the feature request! We have passed this along to our product team for possible prioritization. Please +1 on the feature to help with prioritization.

deleugpn commented 4 years ago

I have something similar to this working, but I fail to understand how SAM could make this. What I have is a CodePipeline with an action of "Invoke Lambda" that triggers a migration Lambda for me. The part I fail to understand is: How would a Lambda event have a CodePipeline as source without the Pipeline itself explicitly having a Invocation step?

keetonian commented 4 years ago

@deleugpn I believe the idea is to have a CodePipeline event on the Severless::Function that sets up the necessary permissions for CodePipeline to be able to call the Serverless::Function resource. The actual CodePipeline configuration would not be managed by SAM (the CodePipeline resource can be in the same template, SAM just will not modify it).

jeff1evesque commented 4 years ago

@praneetap, is there a timeline for this feature request?