package
0.0.0-20171129201522-e888a5ec6428
Repository: https://github.com/eawsy/aws-lambda-go-event.git
Documentation: pkg.go.dev

# README

AWS CodePipeline Events

Back to Home Go Doc AWS Doc

This package allows to write AWS Lambda functions and add them as action in your pipelines to customize the way they work.

Quick Hands-On

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
}