Alexa skill, written in Kotlin, to fetch TriMet arrivals for bus times in Portland, OR.
You can try out the live skill here.
In the Lambda's handler field, set the handler to:
com.merricklabs.portlandbus.PortlandBusStreamHandler
Set the following environment variables:
SKILL_ID
: Your Alexa skill's id.DYNAMODB_ENDPOINT
: Endpoint for DynamoDB. For example, in the Oregon region I'm using, it's https://dynamodb.us-west-2.amazonaws.com.DYNAMODB_REGION
: Region for DynamoDB. For example,us-west-2
.DYNAMODB_TABLE
: DynamoDB table.TRIMET_APP_ID
: API key for accessing TriMet. Get one here.INVOCATION_NAME
: Name used to invoke your skill. Mine isPortland Bus
.
- 512 MB of memory is plenty.
- Timeout of 10s seems to work well and eliminate any DynamoDB calls prematurely timing out. Sometimes those are slow initially.
This guide was very helpful in getting up to speed on writing an Alexa skill in Java. I subsequently rewrote it in Kotlin.
Use localstack to mock out the DynamoDB endpoints.