Read the Beforeitsnews.com story here. Advertise at Before It's News here.
Profile image
By Peadar Coyleas
Contributor profile | More stories
Story Views
Now:
Last hour:
Last 24 hours:
Total:

How to use AWS Lambda to build a tweetbot

% of readers think this story is Fact. Add your two cents.


Inspired by Vicki I decided to build a Tweetbot – the code is available here. You can follow the tweetbot online – the architecture that Vicki proposed is basically what I did, only I made a few changes in the code.

Time taken

It’s worth pointing out first that it took me approximately 32 hours of work to get this al to work. I think a big part of that is that I wasn’t familiar with AWS IAM. Like anything – I think the first time you build something it’s more tricky than normal.


“Paddle steamer Britannie – Bristol Quay” Eric Ravilious, 1938 #modernart #art

Technical goals of this project:

The technical goals of this project was to get my head around how to use AWS Lambdas – because before starting I didn’t know what they were. I also wanted to understand how to set up a CI system from scratch. I used Travis CI because of it’s integration with github.  The other reason for this project is that I wanted to stretch my software engineering skills. All in all I consider it a success.

Learnings from AWS:

  • Getting IAM to work, it’s quite tricky and I had to read lots of documentation and stackoverflow to get this to work.
  • Total time spent about 32 hours, about half of that was spent with errors – of connections between lambdas and S3 and all.
  • This is tricky and I still am not very good at all of this. The docs aren’t in my opinion super useful.
  • Don’t mix up lambda execution roles and IAM roles.
  • Make sure to configure your AWS CLI correctly – I got confused by different profiles.

Travis CI set up

TODO:

  • Still haven’t got SSM working – I’ve no idea about this.
  • It needs more tests like tests before CI runs, and more tests locally.

AWS Lambdas

AWS Lambdas are super useful. Here is a short list of what they can do(much more in the docs):

  • Run when a file is placed in an S3 bucket and move the file to another location
  • Process logs with Kinesis streams and store the logs in DynamoDB
  • Compile a static website based on a new code change and reload the site
  • Backup files and put them into cold storage

When you think about it – many business processes, fit into this sort of workflow. For example you may have someone uploading a pdf of a document to a server, an AWS Lambda could resize that document and then put it into cold storage after a certain period of time.

A good thing to keep in mind is the limitations of lambdas:

  • 512 MB disk space
  • Execution timeout after 5 minutes of activity
  • 128 to 1536 MB
  • Have boto included as a runtime library

I had some trouble uploading the AWS Lambda manually – see Vickis blog post for details of how to solve that.

Conclusion

All in all this was a successful side project. I learned a ton about AWS Lambdas and I probably need to spend more time getting my head around AWS IAM. Also investing in bash scripts and tools to get the zipping of AWS Lambda done is worth it.

I also want to add in more images, so there can be more varied tweets.

Something I need to get my head around is how to do this with Zappa.


Source: https://peadarcoyle.com/2018/09/24/how-to-use-aws-lambda-to-build-a-tweetbot/


Before It’s News® is a community of individuals who report on what’s going on around them, from all around the world.

Anyone can join.
Anyone can contribute.
Anyone can become informed about their world.

"United We Stand" Click Here To Create Your Personal Citizen Journalist Account Today, Be Sure To Invite Your Friends.

Please Help Support BeforeitsNews by trying our Natural Health Products below!


Order by Phone at 888-809-8385 or online at https://mitocopper.com M - F 9am to 5pm EST

Order by Phone at 866-388-7003 or online at https://www.herbanomic.com M - F 9am to 5pm EST

Order by Phone at 866-388-7003 or online at https://www.herbanomics.com M - F 9am to 5pm EST


Humic & Fulvic Trace Minerals Complex - Nature's most important supplement! Vivid Dreams again!

HNEX HydroNano EXtracellular Water - Improve immune system health and reduce inflammation.

Ultimate Clinical Potency Curcumin - Natural pain relief, reduce inflammation and so much more.

MitoCopper - Bioavailable Copper destroys pathogens and gives you more energy. (See Blood Video)

Oxy Powder - Natural Colon Cleanser!  Cleans out toxic buildup with oxygen!

Nascent Iodine - Promotes detoxification, mental focus and thyroid health.

Smart Meter Cover -  Reduces Smart Meter radiation by 96%! (See Video).

Report abuse

    Comments

    Your Comments
    Question   Razz  Sad   Evil  Exclaim  Smile  Redface  Biggrin  Surprised  Eek   Confused   Cool  LOL   Mad   Twisted  Rolleyes   Wink  Idea  Arrow  Neutral  Cry   Mr. Green

    MOST RECENT
    Load more ...

    SignUp

    Login

    Newsletter

    Email this story
    Email this story

    If you really want to ban this commenter, please write down the reason:

    If you really want to disable all recommended stories, click on OK button. After that, you will be redirect to your options page.