This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BUCKET="YOUR_BUCKET_NAME" # bucket name | |
FILENAME="deployment-package.zip" # upload key | |
TMP_FOLDER="/tmp/lambda-env-tmp/" # will be cleaned | |
OUTPUT_FOLDER="/tmp/lambda-env/" # will be cleaned | |
HERE=${BASH_SOURCE%/*} # relative path to this file's folder | |
LAMBDA_FOLDER="$HERE/lambda/" # relative path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion : '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Parameters: | |
Subnets: | |
Type: List<AWS::EC2::Subnet::Id> | |
VpcId: | |
Type: AWS::EC2::VPC::Id | |
Resources: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from lex_utils import elicit_slot, delegate, close, ElicitAction, DelegateAction | |
from utils import validate_dialog, init_or_load_session, finalize_session, actually_book_the_hotel | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
def lambda_handler(event, context): | |
logger.debug('event.bot.name=%s', event['bot']['name']) | |
logger.debug('userId=%s, intentName=%s', event['userId'], event['currentIntent']['name']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const zlib = require('zlib'); | |
exports.decode = async (data) => { | |
const compressedPayload = Buffer.from(data, 'base64'); | |
const jsonPayload = zlib.gunzipSync(compressedPayload).toString('utf8'); | |
return JSON.parse(jsonPayload); | |
} |
This demo was presented at the AWS Summit @ Cape Town on Jul 12th.
You can find the slides here.
- index.js: The node.js code used for AWS Lambda
- sam_template.yaml: The AWS SAM template in YAML format (i.e. CloudFormation)
NewerOlder