1 of 96

<@your social handle>

Community Day Accelerator

October 8th, 2024

2 of 96

Build Your First Serverless Application on AWS

10.8.2024

3 of 96

What are we building today?

Build your first Serverless Application on AWS

Learn how to create a serverless application on AWS, an address book application! You will learn the essentials of AWS and how to:

  • Store and retrieve data stored in a serverless database (DynamoDB)
  • Write serverless functions to work between your visual application and the database (written in Python)
  • Build the front-end to interact with your serverless functions (written in ReactJS)
  • Using Bedrock AI with Amazon Q Developer

The final product is a fully functional website to manage your own address book.

4 of 96

Introduction

Topic

Presented By

Time

Introduction

10 Mins.

Crash course in AWS

Angelo

20 Mins.

Use Cases and Examples

Lena

20 Mins.

Develop backend services on AWS

Lambda, API and DynamoDB

Girish

50 Mins.

UI/Front End

React App CLI, reactjs, CSS component library

Lexius

25 Mins.

Using Bedrock AI with Amazon Q Developer

Brock

25 Mins.

Answer questions and assistance

50 Mins.

Scan for Slides!

5 of 96

Topic: AWS Crash Course

Why Cloud?

Why AWS?

6 of 96

Angelo Mandato

Personal life

  • Married, 2 children - they are awesome!
  • Passion for cars (Trans Am!)
  • Passion for tech (that’s what I do!)
  • Support local tech community
    • Organize Columbus AWS UG
    • Organize AWS Community Day
    • Supportive of all Ohio tech groups

Career

  • Entrepreneur / business owner

www.painlessanalytics.com

  • Software developer and architect
  • Certified Scrum Product Owner
  • Love C languages�(C++/JS/PHP/NodeJS)
  • AWS since 2007

7 of 96

The Cloud Way

Cattle vs Pets

CI / CD

Infrastructure as Code

High Availability

$$$

8 of 96

AWS Management Console

Web dashboard to manage everything AWS

9 of 96

Security and Policies

Limit access to resources

Access consistency between apps

Granting access without credentials

10 of 96

Example AWS Policy

Let’s take a look…

11 of 96

Infrastructure in many flavors

Windows, Linux, Ubuntu, Redhat, Amazon Linux

Instances (physical/virtual)

Containers / Docker

Serverless / Lambda Functions

12 of 96

Networks and Internet

Virtual Private Networks

Subnets and why they are important

Public IP addresses

13 of 96

Internet Traffic / Website Entry

Content Delivery Network (CloudFront)

API > ( Serverless or Servers or Database )

Load Balancers

Access Instances directly

14 of 96

Files and Storage

Endless Cloud Storage - S3

Server Drives - Volumes

Network File Systems - EFS

15 of 96

Databases

SQL

NoSQL

Big Data

16 of 96

Speciality

Cognito, QuickSight, OpenSearch, Glue

Elastic MapReduce, Kinesis Data Firehose

Data Warehouse (RedShift, Athena)

AI via API (Bedrock)

17 of 96

DevOps- Infrastructure as Code

CloudFormation - TerraForm - CDK

CodeDeploy - CodePipeline

CI/CD - GIT (GitHub, BitBucket, GitLab)

18 of 96

FinOps - Billing and Costs

Billing

Cost Explorer

Savings Plans / Reservations

AWS budgets

Pricing Calculator

Tags!!!

19 of 96

Security and Compliance

Security Hub

Trusted Advisor

Inspector

Network Firewall (WAF)

Macie

20 of 96

AWS Ninja!

21 of 96

AWS Certified Solutions Architect Study Guide for SAA-C03 exam

22 of 96

Thank You!

Angelo Mandato

https://angelo.mandato.com

linkedin.com/in/AngeloMandato

www.painlessanalytics.com

23 of 96

Cloud Architectures: Leveraging AWS Services by Use Case

24 of 96

Lena Taupier

  • Msc. Software Engineering
  • 9 years industry experience in AWS & Cloud architecture
  • AWS certified
  • Passionate about tech & education

25 of 96

Over 200 services!

26 of 96

Why the cloud?

  • Low barrier to entry (cost, time)
  • Robustness (scalability, resilience, availability, etc)
  • Get to the fun parts faster!

27 of 96

Easy vs. Customizable

Full-stack Web Application

LightSail

AWS Amplify

Serverless

Custom

28 of 96

Amazon LightSail

  • Setup in a few clicks
    • Database
    • Basic Networking & DNS
    • Load Balancer, CDN�
  • Complex concepts abstracted
    • VPC, Security Groups�
  • Great intro to cloud

29 of 96

AWS Amplify

  • Full fledged app in minutes
  • Integrated CI/CD pipeline
  • Support for popular web frameworks
  • Customizable + Extendable
  • Easily authenticate your users

30 of 96

Customized Architecture

31 of 96

Architecture by Use Case

Amazon Cognito

    • Identity Provider logins (Google, Facebook, Apple, etc)
    • OAuth2
    • Managed credentials
    • Hosted login pages

Authentication

32 of 96

Architecture by Use Case

Amazon QuickSight

    • Integration with your datasets in AWS
    • Easy & customizable charts
    • AI integration

Data Analytics Dashboard

33 of 96

Architecture by Use Case

Amazon CloudSearch

    • Highlighting & Autocomplete
    • Fast setup
    • Fast, scalable
    • Multi-language support

Search

34 of 96

Architecture by Use Case

    • Amazon Comprehend
    • Amazon Transcribe/Polly
    • Amazon Rekognition
    • Amazon Textract
    • Amazon Translate
    • Amazon Bedrock, Amazon Q

AI/ML

35 of 96

  • Leverage existing services
  • No need to reinvent the wheel
  • Get to the good parts faster, cheaper
  • Customize and adapt as needed

Our superpower is problem solving!

36 of 96

Resources

37 of 96

Resources

38 of 96

Thank You!

Happy Tinkering

39 of 96

Topic: Develop backend services on AWS

Lambda, API and DynamoDB

40 of 96

About Girish Bhatia

I am an AWS Cloud Technology Enthusiast & Technical Program Delivery Leader. I love to deliver cloud-based software solution in alignment with strategic goals for business & technology modernization.

Qualifications:

  • Master of Science in Computer Information Systems
  • AWS Certified Developer Associate | Amazon Web Services
  • AWS Certified Solution Architect Associate | Amazon Web Services
  • AWS Certified Cloud Practitioner | Amazon Web Services
  • AWS Certified AI Practitioner Early Adopter | Amazon Web Services
  • AWS Certified AI Practitioner Foundational | Amazon Web Services
  • AWS Badges : Serverless, Solution Architecture
  • Microsoft Certified: Azure Fundamental
  • Microsoft Certified professional: Solution Architecture
  • Microsoft Certified .NET Solution Developer
  • Project Management Professional (PMP)
  • Certified Scrum Master (Scrum Alliance)

IT Experience:

  • 20+ years in IT
  • Tech Program Delivery - Tech Mod/Cloud Transformation
  • Software Development Python, Java, .NET, Oracle, APIs, BI tools
  • in telecom, public/state system, banking/finance domain.
  • Onshore/offshore software delivery
  • Tech Program/Project Management
  • Journey to Cloud, Tech Modernization
  • On Prim to Cloud Migration
  • Cloud/API Integration B2B
  • Data Center planning/Mainframe relocation/upgrades

https://cloudwithgirish.com

41 of 96

Build your first application on AWS

Let’s review our Use Case:

  • Develop backend services on AWS using serverless technology to establish APIs for seamless integration with the UI in a contact/address book application. Employ AWS Lambda functions to facilitate API integration, ensuring efficient and scalable processing. Utilize an AWS DynamoDB table for secure and reliable data storage, optimizing the overall performance of the application within the AWS cloud environment.

  • Multiple API endpoints will be developed to provide functions such as creating a contact, retrieving all contacts, fetching a contact by phone number, updating a contact, and deleting a contact. This comprehensive set of endpoints ensures the versatility and robustness of the contact/address book application, catering to various user interactions and data management scenarios.

42 of 96

Build your first application on AWS

  • Part 1 - Build an address/contacts app using AWS API, Lambda and DynamoDB

  • Part 2 - Secure API using API Key or AWS Cognito User Pool

  • Part 3 - Create address/contacts app using AWS SAM/CloudFormation

43 of 96

Architecture

44 of 96

Know your budget and watch your cost!

  • Setup Budget

  • Familiarize yourself with cost explorer

45 of 96

Services

AWS Budget

AWS Cost Explorer

46 of 96

Build your first application on AWS

  • API Gateway - What it is?
  • Lambda - What it is?
  • DynamoDB - What it is?
  • Build a DynamoDB Table
  • Build Lambda Functions
  • Build Rest API
    • Get All Contacts
    • Get a contact by phone
    • Create contact
    • Update contact
    • Delete contact
  • Invoke API using browser or Postman
  • Review Cloud watch log

Tools & Services: VS Code, AWS Tool Kit, Python, API Gateway, AWS Lambda, DynamoDB, SAM CLI

47 of 96

API Gateway - What it is?

    • Fully managed AWS Service, to create, publish, maintain, monitor and secure APIs.
    • Refer to the link for info on AWS API Gateway

Lambda - What it is?

    • Serverless function, run code without provisioning or managing infrastructure
    • Refer to the link for info on AWS Lambda
      • https://aws.amazon.com/lambda/

DynamoDB - What it is?

    • Serverless, fully managed, NoSQL database
    • Refer to the link for info on AWS DynamoDB

48 of 96

Create IAM Role and assign Policies

Click on Create Role to create a new role

Selected Trusted Entity and use case from the drop down. I will select Lambda since I need to add policies for lambda execution use case.

49 of 96

Provide a name for the role, review and create:

In the next screen, select below permissions policies:

AWSLambdaBasicExecutionRole

AmazonDynamoDBFullAccess

You now have a role 'contactLambdaRole' created.

50 of 96

Build DynamoDB table

Select DynamoDB & click on Create Table

51 of 96

Select Customize Settings and on-demand capacity mode

Capacity Mode

  • On-Demand
  • Provisioned
    • Review RCU (read capacity unit) and WCU (write capacity unit )

52 of 96

These settings can be updated later on as well.

53 of 96

DynamoDB Table

54 of 96

  • phone is the partition key/primary key

Add/Edit Record – Dummy Data

55 of 96

AWS Console - Build Lambda Function

  • Select Author from scratch
  • Function Name as contactGBHandler
  • Runtime as Python 3.12

56 of 96

Assign permission to the Lambda function

  • You can create a new role with basic Lambda permissions

OR

  • Select an existing role from the dropdown

  • I will select an existing role that I created previously.

57 of 96

Replace Default function code with contacts function code

Partial code!

Full src code in git repo

58 of 96

Configure a test event and invoke Lambda function to validate that function Is returning records from DynamoDB.

59 of 96

Create API endpoints

Select Rest API & click on Build

API Gateway – Rest API

60 of 96

Create API endpoints

API Gateway – Rest API

Select API Name

Create Resource, Method and Integration

HTTP Method: GET

Path: /contact

61 of 96

Create stage and deploy the API

API Gateway – Rest API

Once API is deployed, you will get invoke URL.

62 of 96

API Gateway – Rest API

Once API is deployed, you will get invoke URL.

63 of 96

API Gateway – Rest API

�Invoke API via Browser ( not my preferred way to invoke API )

Invoke API via Browser

 https://yu6d9uk9kk.execute-api.us-east-2.amazonaws.com/dev/contact?phone=6140001234

Response:

Message:

  {"message": "Not Found"}

      • Review that:
                  • End point is correct
                  • Route is correct
                  • Stage is correct
                  • QueryStringParameter is correct

64 of 96

API Gateway – Rest API

�Invoke API via Postman (my preferred way to invoke API)

Review request and response!

 

Request

Response

65 of 96

API Gateway – Rest API

Add remaining API endpoints

HTTP Method: GET

Path: /allContacts

Path: /createContact

HTTP Method: Post

HTTP Method: DELETE

Path: /deleteContact

Path: /updateContact

HTTP Method: PUT

66 of 96

Few points about Lambda

  • Serverless, no server to manage
  • 15 mins execution limit per execution
    • 15 min → 900 seconds → 90,000 milliseconds
  • Limit of 1000 concurrent execution
    • can be increased via a support ticket

Pricing Example:

5 Million Requests/Month

100ms per execution

128 MB memory

512 MB storage

Lambda costs - With Free Tier (monthly): 0.80 USD

AWS Lambda Pricing Calculator

67 of 96

AWS Services used:

  • AWS Budget
  • AWS Cost Explorer
  • DynamoDB
  • AWS Lambda
  • AWS API Gateway
  • AWS S3
  • AWS SAM
  • AWS CloudFormation
  • AWS IAM

  • VS Code
  • AWS Toolkit
  • GitHub
  • Docker

Backend Lambda Function Code/slide available: GitHub:

https://github.com/bhatiagirish/AWSAccelerator/

68 of 96

What’s Next?

  • Part 2 - Secure API using API Key or AWS Cognito User Pool

  • Part 3 - Create address/contacts app using AWS SAM/CloudFormation

69 of 96

👋 Lexius Waltar

QA Engineer @ Appfolio Inc.

4 yrs as a Frontend Engineer ❤️

Hi I’m Assata! Your resident Beardie!

Bootcamp Grad!

70 of 96

YAY! I have an API!

🙌

You might be thinking…

71 of 96

Yay I have an API!

🙌

You might be thinking…

Now What ⁉️

72 of 96

Create a User Interface!

Scan to demo app!

73 of 96

Frontend Technologies

React js

Bootstrap

Axios

Javascript Library

Component Library

Javascript Library

Styled Components using HTML & JS

XMLHttpRequests, HTTP requests

Beautiful Web UI

74 of 96

React Js - The Javascript

75 of 96

Bootstrap - Component Library

76 of 96

Axios - Send Requests to Endpoints

77 of 96

The 5 Parts of the Axios Request

  1. HTTP Method
  2. Endpoint URL
  3. Data
  4. Try
  5. Catch - Catch any errors

78 of 96

5 Parts of the Axios Request - HTTP Method

HTTP Method

79 of 96

5 Parts of the Axios Request - Endpoint URL

API Endpoint URL

80 of 96

5 Parts of the Axios Request - Data

Data

{

firstName: "Test",

lastName: "Testerson",

email: "test@email.com",

phone: "2348954378",

notes: "I love to code"

}

81 of 96

5 Parts of the Axios Request - Try Block

Try Block

82 of 96

5 Parts of the Axios Request - Catch

Catch

83 of 96

Now you’re End to End!

Scan to view github repo!

84 of 96

Using Bedrock AI with Amazon Q Developer

85 of 96

86 of 96

87 of 96

88 of 96

89 of 96

90 of 96

91 of 96

92 of 96

93 of 96

94 of 96

Questions

95 of 96

MORE??

AWS Midwest Community Day

Full day conference, 2025 TBD

www.midwestcommunityday.com

Columbus Data & Analytics Wednesdays

Previously known as the Web Analytics Wednesdays user group

https://cbusdaw.com/

96 of 96

Please take our survey!

www.awscolumbus.com/cda-survey/

Thank you!