This repository contains the Alexa skill to find out how long something or someone has been alive for.
How to configure your Alexa Skill
Please Configure the Makefile with your own available S3 bucket
-
Create a new Alexa skill with a name of your choice
-
Set Alexa skill invocation method as 'how old is x'
-
Set built-in invent invocations to their relevant phrases i.e. 'help', 'stop', 'cancel', etc.
-
Set a random phrase for the built-in fallback intent, i.e. 'bumbaclart'
-
Create new Intent named 'AgeIntent'
-
Create new intent slot named 'name', with SLOT TYPE 'AMAZON.FirstName'
-
Add invocation phrase for the 'AgeIntent' intent with phrase 'how old is {name}'
-
Configure slot values for the 'AMAZON.FirstName' SLOT TYPE i.e. 'Bob'
-
Edit the 'internal/dom/age.go' file to feature your name and DoB in RFC3339 format
-
Package and deploy how-old-is lambda
-
Configure Alexa skill endpoint lambda ARN:
Once the 'how-old-is' lambda has been deployed,
retrieve the generated lambda ARN using the AWS console or
one of the describe stack methods found above.
input the lambda ARN as the default endpoint of your Alexa skill,
within your Alexa development console! -
Begin testing your Alexa skill by querying for 'how old is x'
-
Query Alexa 'how old is Bob'
-
Query Alexa 'bumbaclart' or your fallback invocation phrase!
-
Tell Alexa to 'stop'
-
Testing complete!
To develop how-old-is
or interact with its source code in any meaningful way, be
sure you have the following installed:
by setting the
GO111MODULE=on
environment variable set
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin latest
Make sure you configure the AWS CLI
- AWS Access Key ID
- AWS Secret Access Key
- Default region 'us-east-1'
aws configure
How to build the Alexa skill lambda
Note*:- Executables are placed in 'dist/handlers/*/main'
make build
OR
- Lint the project FIRST
Note*:-This may throw build errors, which may not break anything!
golangci-lint run
- Build the lambda
GOARCH=amd64 GOOS=linux go build -gcflags='-N -l' -o dist/how-old-is/main ./lambda/handlers/how-old-is/main.go
This section describes how to validate, compile and deploy the latest Alexa skill.
Validate the template.yml before packaging!
make validate
OR
sam validate
How to compile template.yml after updating the back-end stack definition.
make package
- runs clean
- runs build
- runs sam validate
- runs sam package
OR
sam package --template-file template.yml --s3-bucket {{bucket-name}} --output-template-file packaged.yml
OR
aws cloudformation package --template-file template.yml --output-template-file packaged.yml --s3-bucket {{bucket-name}}
How to deploy the complied packaged.yml to update the serverless stack.
make deploy
OR
sam deploy --template-file ./packaged.yaml --stack-name how-old-is --capabilities CAPABILITY_IAM
OR
aws cloudformation deploy --template-file ./packaged.yml --stack-name how-old-is --capabilities CAPABILITY_IAM
Get information about the back-end infrastructure
make describe
OR
aws cloudformation describe-stacks --region us-east-1 --stack-name how-old-is
This project exists thanks to all the people who contribute.
All donations are appreciated!