> character 112
access permissions 106
ACL (access control list) 106
addButton method 132
addImage method 132
addQuickReplyLocation method 153
afterEach function 203
AI (artificial intelligence) 162
Alexa
skills
preparing 179
Alexa, skill
AlexaMessageBuilder 182, 183, 184
Alexa Skills Kit 180
ALICE (Artificial Linguistic Internet Computer Entity) 124
AmazonAPIGatewayAdministrator 285
AmazonAPIGatewayPushToCloudWatchLogs 286
AmazonDynamoDBFullAccess 285
Amazon Echo 176
ANY method 239
api.get function 28
api.put method 37
ApiResponse method 101
APIs (application program interfaces)
controlling access with Cognito 97–100
app.listen function 237
Express.js
migrating to AWS Lambda 236
Array.find method 141
Array.join function 128
artificial intelligence (AI) 162
Artificial Linguistic Internet Computer Entity (ALICE) 124
async communication, potential issues with 71–76
forgetting to return promises 72
not passing values from promises 73
not wrapping external services in promises 73–74
timeout issues with long async operations 74–76
asynchronous operations
rejection 49
retrieving orders from database 55–56
ata-amount attribute 229
attach-role-policy command 87
authentication, serverless 91–94
Authorization header 68
authorizer function, Lambda 94
automated testing 191, 192, 211–212
AWS_PROFILE variable 284
AWS (Amazon Web Services)
installing CLI 288
AWS CloudFormation 259
aws cognito-identity create-identity-pool command 95
aws cognito-identity set-identity-pool-roles command 96
aws cognito-idp create-user-pool-client command 95
aws cognito-idp create-user-pool command 94
aws dynamodb create-table command 44
aws iam put-role-policy command 152
AWS Lambda 85
migrating Express.js apps to 236
serving static content 240–242
running Express.js applications in 236–240
proxy integration 239
AWSLambdaFullAccess 285
aws logs filter-log-events command 88
aws-sdk module 148
awsServerlessExpress.createServer function 238
awsServerlessExpress.proxy function 238
aws-serverless-express module 237, 238, 238
AWSXRay.captureAWS command 88
aws-xray-sdk-core module 87
Azure Functions 11
BaaS (Backend as a Service) 6
Babel 272
beforeAll function 208
beforeEach function 203
botBuilder.fbTemplate.Generic class 132
botBuilder function 128, 130, 131, 135, 140, 159
Braintree 222
bucket flag 115
buckets 105
Bugsnag 265
business logic risks 213
Button class 142
button template 131
cache-api-config option 130
cachedDb.serverConfig.isConnected() function 244
callbackWaitsForEmptyEventLoop property 248
callOptions function 205
case studies
before serverless architecture 270–271
challenges 274
cost of infrastructure 273–274
migration to serverless architecture 271–273
before serverless architecture 275–277
cost of infrastructure 279–280
migration to serverless architecture 277–279
connecting to DynamoDB database 148–153
creating for Facebook Messenger 293–299
getting user location from 153–155
in Facebook Messenger 124–127–131, 133
integrating NLP libraries 161–163
making structure more scalable 145–148
child_process module 111
claudia allow-alexa-skill-trigger command 186
Claudia API Builder 288
claudia-api-builder module 22
Claudia Bot Builder
creating Facebook Messenger chatbots with 293–299
installing 288
claudia create command 23, 24, 34
claudia generate-serverless-express-proxy command 237
Claudia library
configuring prerequisites 284
Claudia API Builder 288
Claudia Bot Builder 288
claudia update command 28, 35, 40, 51, 70, 170
claudia update --configure-twilio-sms-bot command 168
claudia update function 55
CLI (command line interface) 288
CloudWatch 82
CodeBuild 259
CodeDeploy 259
before serverless architecture 270–271
challenges 274
additional scaling 274
cold starts 274
monitoring 274
security 274
cost of infrastructure 273–274
migration to serverless architecture 271–273
CodePipeline 259
cognitoAuthorizer key 97
cognito-identity-providers flag 95
collection.deleteOne function 249
Command pattern 273
competence of security 232
config flag 28
configuration risks 213
configure-fb-bot option 126, 294
configure function 204
configuring
Claudia prerequisites 284
creating Facebook apps 290–292
creating Facebook Messenger chatbots using Claudia Bot Builder 292–299
creating Facebook pages 290
enabling built-in NLP 300
creating account 313
creating Twilio accounts 301–302
getting Twilio numbers 303
setting up Twilio Programmable SMS service 303–305
connectToDatabase function 246
continuous integration 258–259
convert function 110, 110, 111, 111
coordinates as parameter 154
createCharge method 227
custom errors, returning 101
custom slot type 180
data-currency attribute 229
data-description attribute 229
data-image attribute 229
data-key attribute 229
data-locale attribute 229
data-name attribute 229
data-zip-code attribute 229
DCE (Distributed Computing Environment) 54
DDoS (distributed denial of service) attacks 264, 266
DDoW (distributed denial of wallet) attacks 266
debugging
deleteTable method 208
deliveryWebhook function 160, 161
deploying
describe-log-groups command 83
DialogFlow 161
Dialogue Builder 148
Distributed Computing Environment (DCE) 54
distributed denial of service (DDoS) attacks 264, 266
distributed denial of wallet (DDoW) attacks 266
docClient.put method 148
DocumentClient.scan method 154
DocumentClient.update method 154
DocumentClient class 46, 46, 55, 148, 203
done.fail() method 206
done() method 206
DynamoDB class 43, 44, 44, 208
E2E (end-to-end) tests 192
elastic network interfaces (ENIs) 262
endpoints 65
end-to-end (E2E) tests 192
ENIs (elastic network interfaces) 262
environments
error recovery 49
errors, returning 101
event emitters 6
event listeners 6
events 6
exec method 112
expectations 198
expect statements 198
exporters, MindMup 275
Express.js
migrating apps to AWS Lambda 236
serving static content 240–242
running applications in AWS Lambda 236–240
proxy integration 239
serverless apps
managed MongoDB database with 243–248
ExpressionAttributeValues 59
express-module option 237
external services
connecting to 63
async communication, potential issues with 71–76
connecting to delivery APIs 64–71
FaaS (Function as a Service) 6, 263
Facebook Messenger
creating Facebook apps 290–292
creating Facebook Messenger chatbots using Claudia Bot Builder 292–299
creating Facebook pages 290
enabling built-in NLP 300
fakeHttpRequest.install function 208
fake-http-request library 203, 206
Fanout pattern 254
fbTemplate.Generic class 132
fbTemplate.Text class 153
fbTemplate constant 133
federated identities 92
FileRepository 280
files, static
serving 256
storing in serverless applications 104–108
files, storing 105
filter variable 196
fs.writeFile command 112
fs module 111
fulfilled promises 48
Function as a Service (FaaS) 6, 263
bundled vs single-purpose 263
serverless
mocking 201
generic templates 131
getAllCharges method 233
get method 55
getObject method 111
getSignedUrl method 106, 107, 107
globally unique identifier (GUID) 54
Google Cloud Functions 11
GUI (graphical user interface) 32
GUID (globally unique identifier) 54
hacking payment services 231–232
security competence 232
handler flag 114
handler method 13
hash key 44
headless browsers 212
Hexagonal Architecture 214, 225
HoneyBadger 274
https.request.pipe method 205
IAM (Identity and Access Management) 35, 262
iam attach-role-policy command 86
IAMFullAccess 285
IBM Watson 162
ImageMagick 109
images, converting to thumbnails 113
infrastructure layer, vendor lock-in 267
installing
AWS CLI 288
configuring Claudia prerequisites 284–285
Claudia API Builder 288
Claudia Bot Builder 288
integration
proxy integration 239
risks 214
IntentRequest 183
intents 176
intent schema 180
interactivity of chatbots 139–144
iopipe function 257
IoT (Internet of Things) events 6
Jasmine framework 194
jasmine-spec-reporter package 196
Jenkins tool 259
JWT (JSON Web Token ) 274
keepSession method 184
Lambda functions
choosing memory size for 263–264
lambda update-function-configuration command 87
launch phrases, Alexa 177
LaunchRequest 183
listCharges method 232
list template 131
loadConfigFile method 196
locations of chatbot users 153–155
logs filter-log-events command 83
MemoryRepository 280
message.addButton method 132
message.get method 132
message attribute 140
Microsoft Azure Functions 11
migrating
existing applications to serverless architecture 252–254
Express.js app to AWS Lambda 236
running Express.js applications in 236–240
serving static content 240–242
to serverless architecture
analyzing serverless applications 252
continuous integration 258–259
optimizing applications 263–264
serving static files 256
VPC (Virtual Private Cloud) 262
mind maps 275
before serverless architecture 275–277
cost of infrastructure 279–280
migration to serverless architecture 277–279
minimal-request-promise module 67, 77
MMS (Multimedia Messaging Service) 169
mocking serverless functions 201
MongoClient.connect function 244
MONGODB_CONNECTION_STRING variable 247
MongoDB database
creating account 313
with serverless Express.js apps 243–248
mongodb module 243
monolithic application 8
Multimedia Messaging Service (MMS) 169
NAT (network address translation) 262
new mongodb.ObjectID function 249
NLP (natural language processing) 124, 138, 139, 177
nlp key 163
NLP libraries
built-in, enabling 300
node app.js command 237
no-optional-dependencies flag 116
npm install --production command 34
npm install -S stripe command 225
npm run update command 133, 155
npm test command 197
orderId attribute 44
orderRepository.updateOrderStatus method 227
originalRequest property 135
OSF (Open Software Foundation) 54
output attribute 45
PaaS (Platform as a Service) 4, 275
parallel execution, promises 49
path module 111
paymentRepository.createCharge function 227
paymentRepository.getAllCharges method 233
payments
payment services
security competence 232
PCI SSC (Payment Card Industry Security Standards Council) 231
pipe method 204
Platform as a Service (PaaS) 4, 275
platforms key 130
ports and adapters pattern 214
postback property 135
Postman application 32
prefix flag 115
presigned URL generation 107
pricing 14
production flag 259
production of environments 259–260
passing values from 73
returning 72
wrapping external services in 73–74
proxy integration 239
proxy router 36
put function 204
putObject method 106
put-role-policy command 52
PUT route 37
query attribute 45
query flag 95
RDS (Relational Database Service) 63
receipt template 131
registerAuthorizer method 97
rejected promises 48
Relational Database Service (RDS) 63
reply function 159
request.body attribute 31
request routing 36
Request URL text field 304
resize flag 112
resolved promises 48
return keyword 72
ReturnValues 59
reverse echo chatbot 136
role attribute 52
runner 195
S3_BUCKET variable 261
SAM (Serverless Application Model) 16
saveLocation function 155, 155
scalability of chatbot structure 145–148
security
competence 232
Semaphore CI 259
sender property 135
server.listen function 236
server-hosted applications 191
serverless APIs
pitfalls of 36
Serverless Application Model (SAM) 16
serverless apps
analyzing 252
Express.js
managed MongoDB database with 243–248
storing static files in 104–108
serverless architecture
benefits of 18
continuous integration 258–259
environments
migrating to
analyzing serverless applications 252
optimizing applications 263–264
overview of 6
serving static files 256
VPC (Virtual Private Cloud) 262
serverless-express module 239, 239
serverless testing pyramid 193
service layer
automated tests 192
vendor lock-in 267
SessionEndedRequest 183
sessions, Alexa 179
shared-nothing architecture 256, 256
Simple Notification Service (SNS) 254
Simple Queue Service (SQS) 63
Simple Storage Service (S3) 63, 254
skills, Alexa
preparing 179
slot types, built-in 180
SMS (short message service) 166
sending with Twilio 167
setting up Twilio Programmable SMS service 303–304
SNS (Simple Notification Service) 254
social identity providers 92
spawn method 112
SpecReporter library 196
specs 195
SQS (Simple Queue Service) 63
standards
static files
serving 256
storing in serverless applications 104–108
stderr stream 112
stdout stream 112
storing
static files in serverless applications 104–108
String.split function 142
stripe.charges.create method 227, 228
stripe.charges.list method 234
Stripe payment processing
success attribute 31
suites 195
switch statements 148
TABLE_NAME variable 260
tableExists status 209
tableNotExists status 210
technical workflow risks 213
testing
mocking serverless functions 201
server-hosted applications 191
serverless applications 191–193
writing testable serverless functions 212–216
testing framework, Jasmine 194
testing pyramid 192
text property 135
third-party logging 258
three-tier architecture 7
throttling 266
timeout issues
with asynchronous operations 74–76
timeout option 75
Travis CI 259
Twilio platform
getting numbers 303
sending SMS with 167
setting up Twilio Programmable SMS service 303–304
twilio-sms-chatbot command 171
type property 135
UI layer, automated tests 192
unfulfilled promises 48
unit layer, automated tests 192
universally unique identifier 54
update command 130
URL generation 107
userAuthentication 107
user identity 91
userId parameter 154
username-attributes option 94
uuid module 150
values, not passing from promise 73
VM (virtual machine ) 256
VPC (Virtual Private Cloud) 262
waitFor method 208
wake word, Alexa 176
warm starts 265
watchdog timer 264
webhookURL 68
Wit.ai library 161
wrapping external services 73–74
YOUR_ACCESS_KEY value 284
YOUR_ACCESS_SECRET value 284