Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Hands-On Serverless Applications with Go

You're reading from   Hands-On Serverless Applications with Go Build real-world, production-ready applications with AWS Lambda

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789134612
Length 416 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Mohamed Labouardy Mohamed Labouardy
Author Profile Icon Mohamed Labouardy
Mohamed Labouardy
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Go Serverless FREE CHAPTER 2. Getting Started with AWS Lambda 3. Developing a Serverless Function with Lambda 4. Setting up API Endpoints with API Gateway 5. Managing Data Persistence with DynamoDB 6. Deploying Your Serverless Application 7. Implementing a CI/CD Pipeline 8. Scaling Up Your Application 9. Building the Frontend with S3 10. Testing Your Serverless Application 11. Monitoring and Troubleshooting 12. Securing Your Serverless Application 13. Designing Cost-Effective Applications 14. Infrastructure as Code 1. Assessments 2. Other Books You May Enjoy Index

Chapter 3: Developing a Serverless Function with Lambda


  1. What's the command-line command to create an IAM role for an AWS Lambda function?

Answer: Create an IAM role with the below command; it allows Lambda function to call AWS services under your account:

aws iam create-role ROLE_NAME --assume-role-policy-document file://assume-role-lambda.json

 

 

 

 

 

 

The assume-role-lambda.json file contains the following:

{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"AWS":"*"
},
"Action":"sts:AssumeRole"
}
]
}
  1. What's the command-line command to create a new S3 bucket in the Virginia region (us-east-1) and upload a Lambda deployment package to it?

Answer: The following command can be used to create an S3 bucket:

aws s3 mb s3://BUCKET_NAME --region us-east-1

To upload the deployment package to the bucket, issue the following command:

aws s3 cp deployment.zip s3://BUCKET_NAME --region us-east-1
  1. What are the Lambda package size limits?
    • 10 MB
    • 50 MB
    • 250 MB

Answer: AWS Lambda deployment package has a total maximum of 50MB zipped and 250MB uncompressed.

  1. AWS Lambda Console supports editing Go source code.
    • True
    • False

Answer: False; Go is a recently added language, and the developers behind it haven't added the capability for an inline editor yet. Hence, you must provide an executable binary in a ZIP file format or reference an S3 bucket and object key where you have uploaded the deployment package.

 

  1. What's the underlying AWS Lambda execution environment?
    • Amazon Linux Image
    • Microsoft Windows Server

Answer: AWS Lambda execution environment is based on Amazon Linux AMI.

  1. How are events represented in AWS Lambda?

Answer: Events in AWS Lambda are represented in a JSON format.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images