Build an upload form with 45 lines of Typescript

Introduction The AWS CDK is becoming day by day pretty easy to use. I use Typescript, and today I will talk about a common use case: a simple Upload Endpoint for your API Gateway than like a LEGO can be built with a few instructions and of course…without the need of any server. For the most curious, here you can find the core code. Scenario You want to provide an endpoint to upload object: where? S3, of course. How? With a pre-signed a URL! What is it? A pre-signed URL it’s a URL that gives someone access to the object identified in the URL, provided that the creator of the pre-signed URL has the permissions to access that object. That is, if you receive a pre-signed URL to upload an object, you can upload the object only if the creator of the pre-signed URL has the necessary permissions to upload that object. ...

May 29, 2019 · 6 min

How to deploy a serverless contact form with API Gateway, DynamoDB and SNS

Introduction Hi everybody, thanks for the claps, it was a great month - rain rain rain again - now I’m back. The only GOOD THING of this terrible May is that AWS CDK came to simplify our life and I started using it (just a little) bit - still, enough to say, sincerely: it’s awesome. I used the Typescript version, everything is broken 2 release out of 3 but the time you save exploring the interfaces instead of looking for Cloudformation documentation online worths the time spending in troubleshooting the ongoing changes. Today I’m here to write about a common use case, a simple stack, and that’s all I have to say. ...

May 23, 2019 · 6 min

From Cloudformation to CDK: the good, the bad and the evil

Prelude As you know might be aware of, AWS has quite recently delivered - but it’s still in beta - the AWS Cloud Development Kit (CDK). Indeed, you should also know that I more recently migrated my blog to AWS as part of my migration strategy to the clouds - where my head already sits since 1991. Since I was using a Cloudformation stack though together with one of my colleagues, and since I did some manual changes to it - breaking the rules, I know - I decided it was a good moment to give a chance to CDK. I was waiting for Golang implementation to come up, but in the end, Typescript is fair enough: it not only add Types, but the interfaces will let you be so much more effective in reading the docs and find out what is missing / what is wrong in your template. Sorry, in your code 😃. ...

March 25, 2019 · 14 min

A serverless blog using CodePipeline, s3 and CloudFront

Goodbye old blog 😭😭 I disapperead for a while because as you should notice, first of all - I have a new domain. HAHA. It’s not the first one I own, but to be honest it’s the first time I use a domain for myself. So as I was saying yes, this post is about a migration. Morever, since this is the very first cross platform cross domain blog post - I want to share with you what I learnt and what is still missing, how I did what I did but mainly how someelse did what I didn’t. ...

February 24, 2019 · 8 min

DRY, immutable, opinionated, agnostic

Prelude As far as I know there are many ways to create today in IT. What is becoming more difficult is doing it properly and taking the right decisions but (spoiler)… But… I’m starting feeling that my repository is on the right direction to be self.deployable and agnostic. Above the infrastructure, which is provisioned by terragrunt and terraform, one or more actor(s) is placed (i.e. Jenkins, but whoever it is), the actors will be redeployed, the pipelines restored and they will start redeploy applications (even pieces of infrastructure with dependencies) on their behalf to the various parts of the infrastructure. ...

October 21, 2018 · 9 min

HAL: AWS s3-sns based single-slack-command bot to handle your VPC

Introduction I recently build a Slack command to help me handle actions on my VPC. The only thing you need is an AWS account - Free Tier it’s ok. I recently wrote about how to maximize resources, with particular focus on the number of hours you have in Free Tier - using specific CloudWatch Rules. In this article, I want to describe how I extended my architecture to invoke actions - potentially, all the action provided by Amazon Web Services official SDK(s) - with a single Slack command. I decided to call this slack command HAL because I think it’s a really dangerous command 😜 ...

March 24, 2018 · 10 min

JarvisButton: how to invoke multiple AWS Lambda with one AWS IoT Button (not Enterprise ed.)

Introduction If you have an AWS account in Free Tier, bla bla bla ok stop: I am a AWS Lambda maniac. I only wrote about them (here, here). In this article, I want to talk about my new purchase that is - of course - related to AWS Lambda: the AWS IoT Button. It first made its appearance on the IoT scene in October of 2015 at AWS re:Invent with the introduction of the AWS IoT service. That year all re:Invent attendees received the AWS IoT Button providing them the opportunity to get hands-on with AWS IoT. So cute. Since that time, AWS IoT button has been made broadly available to anyone interested in the clickable IoT device. Here it is! 😎😎😎 ...

March 18, 2018 · 7 min

AWS Free Tier, Docker and Jenkins: smart resources handling with CloudWatch Events and Slack

Introduction If you have an AWS account in Free Tier, you have (updated: March, 13th 2018) 750 hours/month to run EC2 (small ones) in your VPC. You also have a lot of other resources, such as AWS Lambda functions (I wrote about them here and here) and CloudWatch Events. In this article, I talk about smart resources handling and some trick - actually, not so smart XD - I setup to take the best from the services. Attention!!! Picture Spoiler ...

March 11, 2018 · 10 min

Node.js, DynamoDB, and AWS Step Functions to collect <em>sentimented</em> movie reviews

Introduction Recently I worked with AWS Lambda and API Gateway to extend my set of personal APIs and collect information from several sources. I wrote an article on that (if you want to have a look). In this article I will talk about the AWS Step Functions service that enable create finite states machines to easy coordinate the components of distributed applications and microservices using visual workflows. Why AWS Step Functions? Because they let me create a tool to gather movie titles in teather, search for reviews about each of them and make a basic sentiment analysis over the review to help me decide what’s worth watching at teather and what’s worth waiting for on Netflix :D More in general, with AWS Step Functions, you can build applications made of individual components that each perform a discrete function: this lets you scale and change applications quickly. Step Functions is a reliable way to coordinate components and step through the functions of your application. They provides a graphical console to arrange and visualize the components of your application as a series of steps. This makes it simple to build and run multistep applications. Step Functions automatically triggers and tracks each step, and retries when there are errors, so your application executes in order and as expected. Step Functions logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly. ...

March 5, 2018 · 20 min

AWS Lambda, GoLang and Grafana to perform sentiment analysis for your company / business

Introduction In this article I will talk about my experience with AWS Lambda + API Gateway, GoLang (of course) and Grafana to build a sentiment analysis tool over customizable topics. Who should you read this post? Don’t know, maybe a CIO, a CTO, a CEO, a generic Chief or a MasterChef, for sure an AWS and GoLang fan like me. First of all: to better understand how to use Elasticsearch, read my previous post Elasticsearch over My home Network Attached Storage: it’s not so exciting as it seems, but you will have a general idea about what is Elasticsearch and how can you use it. Second: if you don’t know about AWS Lambda, study it. I personally believe that it represents one of the most interesting services currently offered by AWS: as they state, AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume and there is no charge when your code is not running. The amazing thing is that with a Free Tier trial you have 1 milions requests for free - O.O - to run code of any type of application or backend service - all with zero administration: you just upload your code - unfortunately the online editor for GoLang is not supported yet - and AWS Lambda1 takes care of everything required to run and scale your code with high availability. You can even set up your code to automatically trigger from other AWS services - as I have done with API Gateway - or call it directly from any web or mobile app. And…last but definetly not the least, why I’m writing this post!? Because starting from 15 January 2018, AWS Lambda support GoLang!!! ...

January 30, 2018 · 12 min