SlideShare uma empresa Scribd logo
1 de 27
AWS Lambda in Golang
HOW TO START
Wojciech Barczyński - wb@
wbarczynski.pro@gmail.com
Hypatos.ai
WOJCIECH BARCZYŃSKI
= Hypatos.ai
Lead So ware Engineer
Golang Warsaw
Organizer
Hobby:
Kubernetes/CloudNative
evangelist;
teacher/trainer
SMACC.io
WHY SERVERLESS
1. Cut costs
2. Simplify
3. Generate/Prepare and cache
experience in LykeHQ
SMACC / Hypatos
1. Kubernetes/CloudNative
Agility. We own it. Observability.
SMACC.io / Hypatos.ia
1. Kubernetes/CloudNative
2. XaaS
3. Looking into Serverless
WHY GO?
Readibility
Performance [1][2]
Cheap Concurrency [3]
[1] [2] [3]go vs nodejs acloud benchmark Cost reduced
DISADVANTAGES
Binary size
Complied no way to edit
Might have slower start [1]
[1] Some users report slow start times
HOW TO START
It is easy:
go dep
serverless framework
amazon sam CLI
HOW TO START
$ npm install -g serverless
$ go get github.com/tools/godep
$ brew tap aws/tap; brew install aws-sam-cli
DEMO - GENERATE CODE
Definicja binary per handler
$ serverless create -t aws-go-dep
DEMO - DEPLOY
$ make build
$ make deploy
DEMO - RUNNING LOCALLY
1. Prepare: template.yaml for sam
2. Execute:
$ sam local start-api
$ sam local start-api --env-vars env.json
DEMO - RUNNING LOCALLY
$ curl http://127.0.0.1:3000/hello
$ curl http://127.0.0.1:3000/hello/natalia
$ curl http://127.0.0.1:3000/hello?name=natalia
DEMO - GENERATE EVENTS
$ sam local generate-event
$ sam local generate-event s3 put > put_s3.json
$ sam local invoke "HelloWorldFunction" -e put_s3.sjon
DEMO - HANDLERS
func ()
func () error
func (TIn), error
func () (TOut, error)
func (context.Context) error
func (context.Context, TIn) error
func (context.Context) (TOut, error)
func (context.Context, TIn) (TOut, error)
AWS docs on valid handlers
DEMO - CONTEXT
see
ctx context.Context
# from ctx to lambdacontext
lc, _ := lambdacontext.FromContext(ctx)
implementation
TESTING
units
integration locally, e.g., with
in the cloud
dynamodb-local
localstack.cloud
GUIDE
time is $$
Golang:
Pass by value small data types
Pointers for large ones
Goroutines for, e.g., init
UNKNOWN
how to asses the resources [1]
how to integrate with our prometheus stack
Can we take the lesson to onPrem?
[1] aws-lambda-power-tuning
SUMMARY
Golang is a fast and simple to read language
Easy to use, give it a try :)
Later check more complex examples
github.com/wojciech12/talk_serverless_in_golang
Next talk: kubeless?
THANK YOU. QUESTIONS?
We are hiring.
BACKUP SLIDES
INTERESTING
Golang on Kubeless
Golang Plugins and Lambda Layers
golang and GraalVM
AWS Fargate

Mais conteúdo relacionado

Mais procurados

Improve Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With GruntImprove Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With Grunt
Den Odell
 

Mais procurados (20)

WordCamp IL 2016 - WordPress Scale on AWS
WordCamp IL 2016 - WordPress Scale on AWSWordCamp IL 2016 - WordPress Scale on AWS
WordCamp IL 2016 - WordPress Scale on AWS
 
Whizlabs webinar - Deploying Portfolio Site with AWS Serverless
Whizlabs webinar - Deploying Portfolio Site with AWS ServerlessWhizlabs webinar - Deploying Portfolio Site with AWS Serverless
Whizlabs webinar - Deploying Portfolio Site with AWS Serverless
 
Communication tool & Environment for Remote Worker
Communication tool & Environment for Remote WorkerCommunication tool & Environment for Remote Worker
Communication tool & Environment for Remote Worker
 
Amazingly Simple Serverless Go
Amazingly Simple Serverless GoAmazingly Simple Serverless Go
Amazingly Simple Serverless Go
 
Serverless computing con Azure Functions
Serverless computing con Azure FunctionsServerless computing con Azure Functions
Serverless computing con Azure Functions
 
Desktop server presentation
Desktop server presentationDesktop server presentation
Desktop server presentation
 
DEVOPS AND IT AUTOMATION, THE WAY OF THE EFFICIENT DEVELOPER - Wolves Summit ...
DEVOPS AND IT AUTOMATION, THE WAY OF THE EFFICIENT DEVELOPER - Wolves Summit ...DEVOPS AND IT AUTOMATION, THE WAY OF THE EFFICIENT DEVELOPER - Wolves Summit ...
DEVOPS AND IT AUTOMATION, THE WAY OF THE EFFICIENT DEVELOPER - Wolves Summit ...
 
Scaling WordPress - WP on AWS
Scaling WordPress - WP on AWSScaling WordPress - WP on AWS
Scaling WordPress - WP on AWS
 
EXPERTALKS: Jul 2012 - Build using Gradle
EXPERTALKS: Jul 2012 - Build using GradleEXPERTALKS: Jul 2012 - Build using Gradle
EXPERTALKS: Jul 2012 - Build using Gradle
 
Building solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - introductionBuilding solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - introduction
 
Creating autocomplete with elastic search on google cloud
Creating autocomplete with elastic search on google cloudCreating autocomplete with elastic search on google cloud
Creating autocomplete with elastic search on google cloud
 
Bringing swift to cloud
Bringing swift to cloudBringing swift to cloud
Bringing swift to cloud
 
Kubernetes and elixir
Kubernetes and elixirKubernetes and elixir
Kubernetes and elixir
 
A Lap around ASP.NET 5 - VConf
A Lap around ASP.NET 5 - VConfA Lap around ASP.NET 5 - VConf
A Lap around ASP.NET 5 - VConf
 
Apache OpenWhisk
Apache OpenWhiskApache OpenWhisk
Apache OpenWhisk
 
10 difference between aws and google cloud by Zareef Ahmed
10 difference between aws and google cloud by Zareef Ahmed10 difference between aws and google cloud by Zareef Ahmed
10 difference between aws and google cloud by Zareef Ahmed
 
Improve Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With GruntImprove Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With Grunt
 
SWIFTly, Go Cloud!! - Swift@IBM
SWIFTly, Go Cloud!! - Swift@IBMSWIFTly, Go Cloud!! - Swift@IBM
SWIFTly, Go Cloud!! - Swift@IBM
 
Website building exercise
Website building exerciseWebsite building exercise
Website building exercise
 
Serverless preview environments to the rescue
Serverless preview environments to the rescueServerless preview environments to the rescue
Serverless preview environments to the rescue
 

Semelhante a Aws Lambda in Golang | Wojciech Barczynski | #4 Serverless UG Warsaw

Semelhante a Aws Lambda in Golang | Wojciech Barczynski | #4 Serverless UG Warsaw (20)

Going Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGoing Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAM
 
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and BostonAdopting Java for the Serverless world at Serverless Meetup New York and Boston
Adopting Java for the Serverless world at Serverless Meetup New York and Boston
 
.Net Development on AWS
.Net Development on AWS.Net Development on AWS
.Net Development on AWS
 
Adapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG BarcelonaAdapting Java for the Serverless World at JUG Barcelona
Adapting Java for the Serverless World at JUG Barcelona
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Serverless
ServerlessServerless
Serverless
 
Adopting Java for the Serverless world at JUG Hamburg
Adopting Java for the Serverless world at  JUG HamburgAdopting Java for the Serverless world at  JUG Hamburg
Adopting Java for the Serverless world at JUG Hamburg
 
Adopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT TageAdopting Java for the Serverless world at IT Tage
Adopting Java for the Serverless world at IT Tage
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 
Adopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup ItalyAdopting Java for the Serverless world at Serverless Meetup Italy
Adopting Java for the Serverless world at Serverless Meetup Italy
 
Serverless cecilia.cho
Serverless   cecilia.choServerless   cecilia.cho
Serverless cecilia.cho
 
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
How to reduce cold starts for Java Serverless applications in AWS at InfoShar...
 
Developing Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/KubernetesDeveloping Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/Kubernetes
 
Cdk 101
Cdk 101Cdk 101
Cdk 101
 
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
Revolutionize DevOps with ML capabilities. Introduction to Amazon CodeGuru an...
 
AWS Serverless Workshop
AWS Serverless WorkshopAWS Serverless Workshop
AWS Serverless Workshop
 
Cloud PaaS with Java
Cloud PaaS with JavaCloud PaaS with Java
Cloud PaaS with Java
 
Dockerizing apps for the Deployment Platform of the Month with OSGi - David B...
Dockerizing apps for the Deployment Platform of the Month with OSGi - David B...Dockerizing apps for the Deployment Platform of the Month with OSGi - David B...
Dockerizing apps for the Deployment Platform of the Month with OSGi - David B...
 
Adopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup SingaporeAdopting Java for the Serverless world at Serverless Meetup Singapore
Adopting Java for the Serverless world at Serverless Meetup Singapore
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
 

Mais de Serverless User Group Poland

Mais de Serverless User Group Poland (8)

Jak AWS Cloud Adoption Framework wspiera migrację do chmury?
Jak AWS Cloud Adoption Framework wspiera migrację do chmury?Jak AWS Cloud Adoption Framework wspiera migrację do chmury?
Jak AWS Cloud Adoption Framework wspiera migrację do chmury?
 
Czym jest AWS Well-Architected?
Czym jest AWS Well-Architected?Czym jest AWS Well-Architected?
Czym jest AWS Well-Architected?
 
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
 
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Hillel Solow's presentation
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Hillel Solow's presentationAWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Hillel Solow's presentation
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Hillel Solow's presentation
 
Nawigacja pomiędzy serwerami, czyli dlaczego serverless to nie lambda albo fu...
Nawigacja pomiędzy serwerami, czyli dlaczego serverless to nie lambda albo fu...Nawigacja pomiędzy serwerami, czyli dlaczego serverless to nie lambda albo fu...
Nawigacja pomiędzy serwerami, czyli dlaczego serverless to nie lambda albo fu...
 
Serverless na swoim | Maciej Sawicki | #4 Serverless UG Warsaw
Serverless na swoim | Maciej Sawicki | #4 Serverless UG WarsawServerless na swoim | Maciej Sawicki | #4 Serverless UG Warsaw
Serverless na swoim | Maciej Sawicki | #4 Serverless UG Warsaw
 
The future is Serveless | Filip Knapik | #4 Serverless UG Warsaw
The future is Serveless | Filip Knapik | #4 Serverless UG WarsawThe future is Serveless | Filip Knapik | #4 Serverless UG Warsaw
The future is Serveless | Filip Knapik | #4 Serverless UG Warsaw
 
Functional Programming in Serverless World (Serveless UG Poland)
Functional Programming in Serverless World (Serveless UG Poland)Functional Programming in Serverless World (Serveless UG Poland)
Functional Programming in Serverless World (Serveless UG Poland)
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Aws Lambda in Golang | Wojciech Barczynski | #4 Serverless UG Warsaw