This package allows to write AWS Lambda functions and add them as action in your pipelines to customize the way they work.
For step by step instructions on how to author your AWS Lambda function code in Go, see eawsy/aws-lambda-go-shim.
go get -u -d github.com/eawsy/aws-lambda-go-event/...
package main
import (
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/codepipeline"
"github.com/eawsy/aws-lambda-go-core/service/lambda/runtime"
"github.com/eawsy/aws-lambda-go-event/service/lambda/runtime/event/codepipelineevt"
)
func Handle(evt *codepipelineevt.Event, ctx *runtime.Context) (interface{}, error) {
log.Println(evt)
sess, err := session.NewSession()
if err != nil {
return nil, err
}
svc := codepipeline.New(sess)
_, err = svc.PutJobSuccessResult(&codepipeline.PutJobSuccessResultInput{
JobId: aws.String(evt.Job.ID),
})
return nil, err
}