Skip to content

hinagandhi/AWS-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

AWS-lambda

Summary:

Two files are written, the file upload-csv.go is to upload any CSV to s3 bucket which will trigger AWS lambda. Second file lambda-function.go is what AWS lambda will do: it will copy file to other s3 bucket. This was just a simple code that I wanted to wite to learn about AWS lambda and Go.

Steps taken to run AWS lambda:

  1. Add a trigger:

      a) Select s3 from drop down

      b) Add bucket name, event type(in this case put) and then after filling all details, click on add

  1. Handler name should be the file name. In this case, lambda-function

  2. GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o lambda-function lambda-functio.go -> building binary file

  3. zip the file zip lambda.zip lambda-function

  4. Upload the zip file

  5. Create permissions for function by going to:

      a) https://console.aws.amazon.com/iam/home#/roles and create a new role and attach policies: AmazonS3FullAccess and AWSLambdaBasicExecutionRole and other policy which will have policy to create log stream and put log events.

      b) Once role is created then select that role in execution role setion.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages