Think It Through
Managing permissions in AWS is a large and complex topic that’s outside the scope of this post. See Amazon’s AWS Identity and Access Management Documentation to get a better understanding of how to manage AWS resource access and security.
The Code: Faking An RSS Feed In A Flash Briefing Skill
Imagine a Flash Briefing skill whose content comes from a hard-coded array rather than an RSS feed. For a ‘compliment of the day’ or ‘this day in history’ type of skill, a hard-coded array could actually provide a more reliable and stable solution than an RSS feed. However, Flash Briefing skills expect to access their data in the form of an RSS feed so even when your data is hard-coded, you’ve got to trick Alexa into thinking it’s an RSS feed.
My use case here is pretty specific, but I figured it might be a tip others can use too. You can see where I pull an entry from my array, provide the rest of the required fields for the RSS feed .json file, then write that file to my S3 bucket. Every time the skill runs, it overwrites the existing S3 file with new content that’s pulled from a hard-coded array in the script.
This script mimics the output of an RSS feed, but the same code can be adapted to write any type of file to S3. The putObjectToS3 function is the one to pay attention to here. All it requires is a bucket name, a key (aka file name), and a data package to write to that file. You could use this same code to write audio, image, text and other types of files to S3 on the fly.
Click here to view a .txt version of the code snippet above, which you can copy and paste.