How I Developed My FizzBuzzBongo Alexa Skill (And Bagged a Free AWS Hoodie)

DZone 's Guide to

How I Developed My FizzBuzzBongo Alexa Skill (And Bagged a Free AWS Hoodie)

Here's a story of a man and his Echo. More importantly, here's a story about how a many created an Alexa skill and got some neat swag for it.

· IoT Zone ·
Free Resource

Yep — the most important outcome of releasing my skill so far has been receiving a free Alexa developer hoodie in the post from Amazon. That's right — they give you freebies in exhange for releasing skills (well, in the UK anyway — check out the current offers here). I guess they have to offer some incentive as the methods to monetize skills haven't really matured yet. The goodies change each month. You need to submit your application through the website, but free gear is always a good incentive to get cheapskate developers like myself on board. You can even earn free Echos if you get enough users in the first month (which I haven't managed, unfortunately). Nevermind though — I'm more than happy with my hoodie.

Image title

I released my first Alex skill in March this year, along with all the source code and a number of blog posts detailing the process. The skill is called 'FizzBuzzBongo' — it's just a simple variant on the well known 'fizzbuzz' developer test. I've extended it slightly so as well as having to substitute 'fizz' for multiples of 3 and 'buzz' for multiples of 5, you also have to substitute 'bongo' for multiples of 8. This leads to new combinations like 'fizzbongo', 'buzzbongo' and 'fizzbuzzbongo'

It was really just designed to be a bit of fun — nothing serious. I just wanted to test out the whole process end-to-end before diving into developing anything more serious. Although it is purposefully simple, it does exercise interactivity with Alexa. This requires maintaining some of state between requests, which I've done using DynamoDB. I've also included provisioning of the AWS stack using Terraform (though it doesn't technically provision a 'stack' as understood in the CloudFormation world). I will add a Cloudformation provisioning option in the future also.

The core functionality is contained in a Java Lambda — and full source code is available over on GitHub. I chose Java because that's the language I'm most proficient with. I've got more complicated Alex Skills coming up and I definitely want to develop those in Java, so thought I'd start with that. Python would have been my next choice (and I may rewrite this in Python in a future article to compare and contrast the two languages). I definitely want to investigate the relationship between Lambda memory sizes and Java cold start times (there's a sweet spot where lambda execution time reduces so much with a higher memory lambda that it becomes more cost effective than running with the lower memory allocations).

I've written up the process in detail in 3 main articles:

The first covers creating the core Java lambda code, and interacting with DynamoDB. The second article takes this forward and explains how you can push it to the cloud using Terraform. You should never really deploy anything just by clicking around the AWS console - automate it with Cloudformation, Terraform or similar. It's worth spending some time up front getting familiar with one of these technologies if you're not already. You have a self-documented infrastructure which you can spin up again with exactly the same configuration in a heartbeat if you need to. Gives you peace of mind and a warm fuzzy feeling inside. Defintely worth it. The last article then explains how to configure the Alexa skill in the Amazon developer console, and get the skill published to the store.

I've also recently added a follow-up article looking at how the skill has been performing once month in — you can check that out here. In brief, usage has been low to non-existent following an initial spurt (and by spurt I mean just over 20 users). On the back of that, I've reduced my DynamoDB read and write capacity, which saves most of the few dollars a month I was spending on that (I'm nowhere near close to exceeding the free lambda capacity).

Image title

In conclusion then — it's been a fun process developing the skill and I've also got free swag from Amazon for it. Skill takeup is very light (compared to say, releasing an Android app) — but that's just because the technology is so new. It's only going to get more widespread, and skill discovery and monetization will no doubt improve in leaps and bounds in the coming years. I've learned a lot going through this process — and have a few more articles and investigations to follow up on from this first simple skill. I'm also really excited to start writing more complicated skills.

Please check out my source code and articles if you fancy having a go yourself. The best way to learn is by doing!

iot ,alexa skill development ,java ,aws lambda ,dynamodb ,terraform

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}