© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Deploy Golang WebApp
dengan AWS App Runner
Rio Astamal
Developer Advocate, Indonesia
Amazon Web Services
© 2022, Amazon Web Services, Inc. or its affiliates.
Agenda
• Mengenal AWS App Runner
• Deployment menggunakan App Runner
• Autoscaling pada App Runner
• Demo
§ Deploy WebApp sederhana ditulis dengan Go
§ Menggunakan custom domain
3
© 2022, Amazon Web Services, Inc. or its affiliates.
Tentang Demo
Sebuah web based 2FA token generator
sederhana yang dibuat menggunakan
HTML/CSS/Javascript sebagai Frontend
dan Go sebagai Backend.
Untuk menyimpan konfigurasi token dari
setiap prodivider digunakan Amazon
DynamoDB.
Aplikasi akan dibuild sebagai container
image dan dideploy menggunakan AWS
App Runner.
Gombok Authenticator
4
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
AWS App Runner
5
© 2022, Amazon Web Services, Inc. or its affiliates.
AWS App Runner adalah layanan untuk
memudahkan developer dalam menjalankan
web app (dan API) berbasis container
App Runner
© 2022, Amazon Web Services, Inc. or its affiliates.
Fitur
7
Autoscaling
Load Balancing
Logs & Metrics
Deploy Otomatis
Certificate
Manajemen Biaya
© 2022, Amazon Web Services, Inc. or its affiliates.
Tipe App untuk App Runner
Frontend dan backend
Web App
Backend untuk
Mobile Apps
Microservices
dan API
© 2022, Amazon Web Services, Inc. or its affiliates.
Deployment
Development
Teams
Source code
GitHub
Container Image
ECR
Create
Connection
Create
IAM Role
Create
Service
Clients
Authorize AWS
to access
source code
Permissions to
pull image
Build & Runtime config,
CPU & memory size,
Health check config,
Autoscaling config,
Deployment config
Secure
Service URL
HTTP Requests
© 2022, Amazon Web Services, Inc. or its affiliates.
Langkah Deployment untuk Go
10
© 2022, Amazon Web Services, Inc. or its affiliates.
Idle
Active
Contoh Autoscaling
concurrency = 30; min=3; max=5
20
Idle Idle
Application
Instances
Min Provisioned Instances
Load: 20 concurrent requests
© 2022, Amazon Web Services, Inc. or its affiliates.
25
Idle
Idle
Active
Contoh Autoscaling
concurrency = 30; min=3; max=5
Min Provisioned Instances
Application
Instances
Active Active
25 25
Launching
Load: concurrent requests
75
© 2022, Amazon Web Services, Inc. or its affiliates.
30 30 30 30
Idle
Idle
Active
Contoh Autoscaling
concurrency = 30; min=3; max=5
Min Provisioned Instances
Application
Instances
Active Active
Load: 200 concurrent requests
Active Active
30
50 queued/dropped
Max Instances
© 2022, Amazon Web Services, Inc. or its affiliates.
© 2022, Amazon Web Services, Inc. or its affiliates.
Demo
14
https://github.com/rioastamal-examples/golang-app-runner-demo
© 2022, Amazon Web Services, Inc. or its affiliates.
Arsitektur Demo
15
AWS Cloud
Client
HTTPS
AWS App Runner Amazon Dynamodb
© 2022, Amazon Web Services, Inc. or its affiliates.
Apa yang telah dipelajari?
• AWS App Runner cocok digunakan untuk membangun web app
atau API. Dengan hanya fokus pada kode developer dapat lebih agile
dalam melakukan pengembangan.
• Automatic deployments memudahkan update versi dan rollback jika
diperlukan.
16
© 2022, Amazon Web Services, Inc. or its affiliates.
Sumber Rujukan
https://aws.amazon.com/apprunner/
AWS App Runner
17
Official Developer Guide
https://docs.aws.amazon.com/apprunner/latest/dg/what-is-apprunner.html
Blue/Green Deployment
https://docs.aws.amazon.com/whitepapers/latest/overview-deployment-options/bluegreen-deployments.html
https://nathanpeck.com/concurrency-compared-lambda-fargate-app-runner/
Concurrency Compared: AWS Lambda, AWS App Runner, and AWS Fargate
© 2022, Amazon Web Services, Inc. or its affiliates.
Sumber Rujukan
Demo bagaimana melakukan deployment
Golang web app dengan AWS App
Runner.
https://github.com/rioastamal-examples/golang-
app-runner-demo
golang-app-runner-demo
18
© 2022, Amazon Web Services, Inc. or its affiliates.
Komunitas
https://t.me/AWSUserGroupID
Telegram
19
Facebook
https://www.facebook.com/groups/awsindonesia/
Youtube
https://www.youtube.com/channel/UCQDEwvZ5zSVMavHX0Aw9ElQ
Mari bergabung ke komunitas AWS User Group Indonesia.
© 2022, Amazon Web Services, Inc. or its affiliates.
Thank you!
© 2022, Amazon Web Services, Inc. or its affiliates. 20
Rio Astamal
Developer Advocate, Indonesia
Amazon Web Services
rioastamal rioastamal
https://rioastamal.net/

Deploy Golang WebApp dengan AWS App Runner

  • 1.
    © 2022, AmazonWeb Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Deploy Golang WebApp dengan AWS App Runner Rio Astamal Developer Advocate, Indonesia Amazon Web Services
  • 2.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Agenda • Mengenal AWS App Runner • Deployment menggunakan App Runner • Autoscaling pada App Runner • Demo § Deploy WebApp sederhana ditulis dengan Go § Menggunakan custom domain 3
  • 3.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Tentang Demo Sebuah web based 2FA token generator sederhana yang dibuat menggunakan HTML/CSS/Javascript sebagai Frontend dan Go sebagai Backend. Untuk menyimpan konfigurasi token dari setiap prodivider digunakan Amazon DynamoDB. Aplikasi akan dibuild sebagai container image dan dideploy menggunakan AWS App Runner. Gombok Authenticator 4
  • 4.
    © 2022, AmazonWeb Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. AWS App Runner 5
  • 5.
    © 2022, AmazonWeb Services, Inc. or its affiliates. AWS App Runner adalah layanan untuk memudahkan developer dalam menjalankan web app (dan API) berbasis container App Runner
  • 6.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Fitur 7 Autoscaling Load Balancing Logs & Metrics Deploy Otomatis Certificate Manajemen Biaya
  • 7.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Tipe App untuk App Runner Frontend dan backend Web App Backend untuk Mobile Apps Microservices dan API
  • 8.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Deployment Development Teams Source code GitHub Container Image ECR Create Connection Create IAM Role Create Service Clients Authorize AWS to access source code Permissions to pull image Build & Runtime config, CPU & memory size, Health check config, Autoscaling config, Deployment config Secure Service URL HTTP Requests
  • 9.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Langkah Deployment untuk Go 10
  • 10.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Idle Active Contoh Autoscaling concurrency = 30; min=3; max=5 20 Idle Idle Application Instances Min Provisioned Instances Load: 20 concurrent requests
  • 11.
    © 2022, AmazonWeb Services, Inc. or its affiliates. 25 Idle Idle Active Contoh Autoscaling concurrency = 30; min=3; max=5 Min Provisioned Instances Application Instances Active Active 25 25 Launching Load: concurrent requests 75
  • 12.
    © 2022, AmazonWeb Services, Inc. or its affiliates. 30 30 30 30 Idle Idle Active Contoh Autoscaling concurrency = 30; min=3; max=5 Min Provisioned Instances Application Instances Active Active Load: 200 concurrent requests Active Active 30 50 queued/dropped Max Instances
  • 13.
    © 2022, AmazonWeb Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. Demo 14 https://github.com/rioastamal-examples/golang-app-runner-demo
  • 14.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Arsitektur Demo 15 AWS Cloud Client HTTPS AWS App Runner Amazon Dynamodb
  • 15.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Apa yang telah dipelajari? • AWS App Runner cocok digunakan untuk membangun web app atau API. Dengan hanya fokus pada kode developer dapat lebih agile dalam melakukan pengembangan. • Automatic deployments memudahkan update versi dan rollback jika diperlukan. 16
  • 16.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Sumber Rujukan https://aws.amazon.com/apprunner/ AWS App Runner 17 Official Developer Guide https://docs.aws.amazon.com/apprunner/latest/dg/what-is-apprunner.html Blue/Green Deployment https://docs.aws.amazon.com/whitepapers/latest/overview-deployment-options/bluegreen-deployments.html https://nathanpeck.com/concurrency-compared-lambda-fargate-app-runner/ Concurrency Compared: AWS Lambda, AWS App Runner, and AWS Fargate
  • 17.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Sumber Rujukan Demo bagaimana melakukan deployment Golang web app dengan AWS App Runner. https://github.com/rioastamal-examples/golang- app-runner-demo golang-app-runner-demo 18
  • 18.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Komunitas https://t.me/AWSUserGroupID Telegram 19 Facebook https://www.facebook.com/groups/awsindonesia/ Youtube https://www.youtube.com/channel/UCQDEwvZ5zSVMavHX0Aw9ElQ Mari bergabung ke komunitas AWS User Group Indonesia.
  • 19.
    © 2022, AmazonWeb Services, Inc. or its affiliates. Thank you! © 2022, Amazon Web Services, Inc. or its affiliates. 20 Rio Astamal Developer Advocate, Indonesia Amazon Web Services rioastamal rioastamal https://rioastamal.net/