AWS Serverless Computing Example: Wild Rydes Part Deux

WildRydes Admin Interface

In my last blog post, I mentioned how I was working my way through @jpignata‘s excellent tutorial on GitHub on how to work with AWS Lambda Services, API Gateway, etc.  I work through the tutorial when I have a few minutes to spare and am finding it quite enjoyable.  AWS Lambda Services and the API Gateway are pretty fun and interesting to work with.

In Lab 3 of the tutorial we create an Admin Interface to allow authenticated users the ability to view the email addresses that have been added to the DynamoDB database.  Admin Users are authenticated by the Admin Interface against a Cognito User Pool.  This lab was pretty straight-forward as I did not fat-finger as any mistakes this time.  However, I did take note of the following:

API Gateway URL Notes:

  • Make sure to ‘Deploy API’ after you make changes to your API Gateway.  Many times I thought my configuration updates simply weren’t correct, when in fact I had simply forgotten to deploy the updates to ‘prod’.
  • Simply adding ‘Authorizers’ on your API Gateway is not sufficient for protecting the URL endpoint.  You have to also add the Authorizer to the Method Request ‘Authorization’ of the URL endpoint.  I found that my API endpoints were not protected until I remembered to do this step:

Lambda CI/CD Pipelines

As I am slowly working up to doing something more substantial with Lambda Services, I am curious how one might integrate Lambda Serverless Code into a CI/CD Pipeline.  It seems you can use Gulp/Grunt with the gulp-awslambda plugin (https://www.npmjs.com/package/gulp-awslambda) to accomplish this.  I need to to try this out.

My Admin screen is available on CloudFront, but you can’t log in.

My API Gateway Endpoint is publicly available as well, but it should be protected against unauthenticated users: https://wlqmlbphqc.execute-api.us-east-1.amazonaws.com/prod/emails

What a great tutorial!!  One more Lab to finish and I’ll hopefully be off building something real…

Some Randomness : ‘The Black Bear’

My girlfriend and I have been watching ‘Black Mirror’ on Netflix occasionally.  Last night, we watched the ‘White Bear’ episode, which freaked me out, as most episodes do.  But, it also made me think of one of my favorite Bagpipe Tunes, ‘The Black Bear’.  Hear some renditions to make your cubicle-bound blood start pumping:

Paaaaaaaassssssss. In. Revieeeeeeeeeewwwwwwwwwwwwwwwwww!!!!!

AWS Serveless Computing Example: Wild Rydes Part I

I’ve been working through a tutorial I started in a session I took at AWS re:Invent 2016.  I did not finish the tutorial in class so I started working on it again after getting home from the conference.  The tutorial is on GitHub if you care to follow along.

Admittedly, I’m not the sharpest knife in the drawer(but I am made of the hardest, most persistent steel…they call me, ‘Blue Steel’ – said in my best Ben Stiller voice).  It took me a while to figure out why I could not get the AWS Javascript SDK to allow unauthorized users, vis-a-vis AWS Cognito, to access my DynamoDB Email Table.  Here are some errors and things I learned troubleshooting this:

The latest Firefox browser seems to give better clues about why things are not working in the Developer Console than Google Chrome.  Using Google Chrome, I kept seeing an error like, “Missing Credentials In Config”, and was really confused what exactly that meant.  I was following the tutorial exactly, as far as I could tell, so I could not discern whether this error was from a code change I made or an AWS configuration problem?  Then I looked at my website in Firefox, using the Firefox Developer Console, and could see a little bit better what was going on.

Here’s my main error as seen in the Google Chrome Developer Console:

And here’s the same error as reported by Firefox Developer Console:

Ahh!  So a ‘ResourceNotFoundException’ is being thrown.  Now I could see that my Javascript code probably wasn’t the problem and that my Cognito/IAM Role Configuration might be the culprit.

After further investigation..a day (or so) later…I discovered a simple typo in my DynamoDB Table Name:

The table name should have been ‘Wildrydes_Emails’.  Seriously?!?!  Yes, I’m an idiot (but one made of ‘Blue Steel’…).  Once that was corrected, I was finally able to get my unauthenticated Cognito Role to access my DynamoDB Table.

There is still work to be done in this tutorial, and I’ll blog about any issues I overcome as I encounter them.  My work is being hosted in my AWS account on Cloudfront, so feel free to check it out and submit your email to my DynamoDB database.  Let’s get this startup rolling!

http://d39nkefhhvszkn.cloudfront.net/

'Out of the Box' Rubik

Infrastructure As Code

I recently read this article and listened to the 2015 AWS re:Invent session on the same.  This discussion really resonated with me.  I’m excited to try to automate everything, including infrastructure deployments, in my future development projects.  I like the idea of using automated testing frameworks, such as serverspec, for testing infrastructure deployments.

My three big take-aways from the video:

  1. If it’s not automated, it’s not done.
  2. If it moves, measure it.
  3. if its’ not monitored, it doesn’t exist.

My Path to AWS Certified Solution Architect – Associate

On December 1st, 2016, I took and passed the AWS Certified Solutions Architect – Associate Exam.  I took the exam at the AWS re:Invent Conference in Las Vegas, and by ‘passed’, I mean by the skin of my teeth!  But to me, passing is all that matters and I achieved that objective.  Here are some notes on how I prepared for this certification exam:

  • I tried to use AWS Services as much as possible.  I signed up for a free for one year account and started deploying some small applications I had written to EC2.  Initially, I ran MySQL on one of my EC2 instances, but when I discovered RDS, I learned that RDS is an easier and more cost effective approach to using an RDBMS in the cloud.  Aurora and DynamoDB are some other excellent options for cloud-based databases.
  • I bought the Official Study Guide for this certification and started studying it and working through the exercises in the book about two months prior to my exam.  As I am now done with this book, I am happy to mail it the first request for free as long as you agree to pay for shipping.  I have marked my copy up pretty good, however, and I’ve circled all of the answers to the practice test questions in ink.
  • I paid $20 to take the AWS Practice Exam.  I failed it with a 50% score and almost ended up re-scheduling the real exam.  I decided, however, to double-down on my studying and to stick my original plan.  This is one gamble of mine that actually paid off.
  • I attended the 2016 AWS re:Invent Conference in Las Vegas and participated in the Monday Night Hackathon.  Here I quickly learned how to deploy REST services on AWS Lambda using the API Gateway service.  I also learned a bit more about DynamoDB in the process.  The Hackathon helped to focus my understanding of some services, and the re:Invent Conference helped to broaden my understanding of many others.
  • I took my certification exam on Wednesday Night of the conference at 8pm in the Venetian Hotel.  I thought I would be the only one taking an exam at that time of night, but there were at least 15 other folks in the examination room with me.

Here are some of my associated exam expenses along the way:

  • The Official Study Guide on Amazon.com: $57
  • Scheduling the Certification Exam: $150
  • Practice Exam: $20
  • AWS re:Invent 2016 Conference: $1600
  • Travel and Lodging at Las Vegas (me, girlfriend and kids): $750
  • Estimated Exam Focused Time Investment: 2 months
  • Estimated Total Investment: $2,577

AWS re:Invent Conference

So was my investment in this certification worth it?  One thing I learned at the re:Invent conference in Vegas is that if you want to win big, you have to bet big.  I think this investmAWS Solutions Architect Associate Certification Study Guideent was a pretty big bet as far as certifications and technical focus are concerned.  I don’t think attending the re:Invent conference was necessary in passing the certification exam, however, but I do think it was necessary in trying to accurately gauge the viability of the AWS Cloud Platform in the coming years.  Participating in the Hackathon was a great way to get focused on approaches to deploying solutions to the AWS Cloud in a team environment.  AWS re:InventAttending the AWS re:Invent conference helped me to broaden my perception of the sheer breadth of AWS Cloud offerings, not to mention the insight I received in learning about some of the innovative ways companies are using AWS Cloud now.  I witnessed over 30,000 conference participants, from all over the world, attending sessions from 8am to 8pm non-stop, learning as much as they could about the AWS platform.  I, too, drank the cool-aid and truly believe AWS Cloud is a secure, cost effective, highly elastic, high performance platform for all types of software applications.  And I don’t see any other cloud company as a close competitor to Amazon right now, nor may we ever.  Amazon has built their Cloud Platform from lessons learned being the largest E-Commerce Platform in the world.  I feel like I’ve made a safe bet.

AWS re:Play Party

Financial costs aside, the re:Play Party at the end of the AWS conference was truly amazing!  There were drinks (lots of drinks), t-shirts, amazing, amazing food, retro video games, mechanical bull riding, foosball, etc. etc. Time to re:Play I’m sure there was even more stuff, I just couldn’t take it all in.  Then there was the headline performance by DJ Martin Garrix, which was radical.  I took my girlfriend to the party and we had an amazing time.  It was an amazing week in Las Vegas, which ended with a quick family jaunt to the Grand Canyon, but I’ll save that for another blog post.

Foosball

EL Galeon in Alexandria, VA

Today I stood in line with throngs of people along the Alexandria water front awaiting an opportunity to step aboard a 16th Century Spanish Galleon replica.  The vessel (pictured below) is quite stunning.  I tried to imagine how such a magnificent machine could be fashioned by humans in the 1500’s and 1600’s.  Can you imagine how it must have felt to see one of these vessels coming into your home port back in the 16th Century?

image1 image2 image31 image20 image19 image17

Interest Rates And ‘Stacking Benjamins’

A lender contacted me last weekend about refinancing my home.  It seems interest rates have fallen roughly half a point since I first acquired the liability I call home.  But half a point isn’t quite enough for me to go through the pain of refinancing a mortgage, so I told the lender I’d sit tight for a while.  In response, the lender tried to educate me about impending interest rate hikes in December and that I’d be throwing lots of ‘Benjamins’ away if I failed to take advantage of this opportunity.  Ultimately, I think I’ll wait to refinance until a little while later, and here’s my rationale for doing so…

I’m not an economist.  I am simply a middle-aged guy doing his level best to save and prepare for a retirement…of sorts…sometime in the fairly distant future.  And I struggle to understand the intricacies of macroeconomics much less how to save for my own retirement at the microeconomics level.  The differences between microeconomics and macroeconomics seem closely akin to the differences between physics and quantum physics, except in reverse.  Ok, what?  Like, I am trying to understand how the decisions made by ‘Big Whigs’ at the macroeconomic level affect how well I can manage the money I am personally in charge of (microeconomics).  I am pretty sure macroeconomic decisions impact me directly, like in the case of my home refinance opportunity, but how exactly those decisions impact me and even how and why those decisions are made are not quite so clear.  So I am very interested in the ‘big picture’ and how Federal Reserve decisions, with regard to interest rates, impact my life, your life, and our present and future.

Today, the Federal Open Market Committee (FOMC), chaired by Janet Yellen, met to discuss the possibility of rising interest rates before year’s end.   The FOMC seem to say roughly the same nebulous things at each meeting, which makes me wonder about what is truly driving their decisions.  I don’t think the Federal Reserve cares much about people with microeconomic concerns (i.e., concerns such as paying for milk and gas each month much less the mortgage).  Why would they?  They are not elected officials of the people of the United States.  So here’s how I think interest rates are going to play out…

Take a look at the following chart of interest rates in the US since interest rate data have been collected:

Federal Interest RatesThe chart shows, as Grant Cardone has so eloquently pointed out to his listeners, a significant trend…to ZERO!!  In fact, interest rates have pretty nearly done bottomed-out already.  So maybe we get another tiny bump on interest rates in December, but past that, I think we are headed into negative interest rate territory.  I agree with Grant Cardone’s analysis that there is no way interest rates can go up.

I believe the key to understanding the Federal Reserve’s guidance on interest rates is driven not by the strength of the US Economy and Inflation, but instead by the National Debt.  Whoever holds cash benefits the most from rising interest rates.  Right now, many countries hold alot of cash, in the form of notes or I.O.U’s, sold by the United States to pay for things like Wars, seeking-out Weapons of Mass Destruction in Iraq, and then Reconstruction and keeping the Government open for business.  The result is a mountainous debt (thanks to former President Bush (Republican) and current President Obama (Democrat)).  If interest rates do go up, these foreign note holders get more and more leverage as their notes become more valuable.  Simple math says you stand to collect more money if someone is willing to pay you 5% for the dollars you hold over 1%, for example, when your note becomes due.  If interest rates go down, cash and I.O.U’s become less and less valuable.  In fact, if interest rates go down enough, say into negative territory, people and entities holding cash may have to pay someone else for the privilege of holding cash.  Think about that!  The bank could conceivably charge you money to keep your cash in their bank!  You know, kind of like 401k programs do now…sort of.

So, rates may go up some in December, although I’m not sure why they would.  If the real drivers of Federal Interest Rate Policy is the minimization of National Debt obligations, then interest rates cannot go up until the US National Debt is greatly reduced.  Therefore, I think the FOMC is going to lower interest rates even more, and I think they may even go into negative territory soon.  The upside of interest rates going negative is that you might get paid to have a mortgage?!?!

I think there is still some time to consider mortgage refinancing.

 

Commitment to the Cloud

I made the decision to attend the AWS re:Invent conference in Las Vegas this year in November.   I’ve thrown my hat in the ring for Monday’s Hackathon at re:Invent, and am hoping to come away with new insights into ways to employ AWS infrastructure for faster and more cost-effective software deployments.  There is also 5k run on Wednesday morning that I signed up for.  I figured it was a good way to get in some exercise after sitting all week, and I’m working on some solid fitness goals for next year…

I also made a commitment to myself to study for, and take, the Amazon Certified Solutions Associate Architect Exam while I’m at re:Invent.  My primary study guide is the ‘AWS Certified Solutions Architect Official Study Guide’, AWS Certified Solutions Architect Official Study Guide.

While at the conference, I am particularly interested in hearing anecdotes from startups in how they are using Cloud-based infrastructure to start, grow and scale a technology/software businesses.  It would seem that Cloud Technologies could be a great leveler in this regard.  And of course, hearing from Werner Vogels about what new technologies are on the horizon for the AWS Platform should be very interesting as well.

 

The Greatest Generation

This past Tuesday I chaperoned a group of High School kids in my daughter’s Geography Class. Our mission was to spend all day at the World War II Memorial in Washington DC surveying visitors about the memorials the respondents were visiting, how far they traveled to get to DC, etc. I was glad to spend time with my daughter, but I thought staying all day at one memorial was going to be really boring. I was wrong.


World War II Memorial
As I sat at the entrance of the World War II Memorial listening to the High School kids survey random people coming and going, I watched and listened to the people milling about. I reflected on what the memorial really stood for and became quite moved by the overall experience. I heard accents and languages from Japan, Germany, Australia, Canada, Great Britain and from all over the United States. I witnessed World War II vets visiting from all over the country as provided for by the Honor Flight Network Program, a non-profit organization that helps US Veterans find closure by bringing them to the memorial of the war they participated in.


Honor Flight Veterans
I watched several cohorts of Honor Flight supported Veterans come through the memorial. One veteran, in a wheelchair and with tears in his eyes, shook my daughter’s hand and thanked her for coming. My daughter said she felt bad because the only reason she was there was because of her High School Project. 🙂 I watched these veterans take in the memorial and get transported back in time to the mid 1940’s when life seemed both simpler and much harder because of the war. These men and women cried as they looked and touched parts of the memorial recalling times past as they fought one of the most significant wars in history.


World War II Memorial
While at the memorial, I also thought about my Granddad, Jim Dupler. He was in the Army Air Corps (which became the US Air Force) during the War and flew B-26 bombers over Tunisia fighting General Rommel. He told me a few stories about his time in the war. He recounted to me how he could see flack from the enemy guns exploding below and around his aircraft. He told me he never really thought about dying through all of that. In fact, he only suffered some shrapnel through the bottom of his foot during one of his flights. He survived the war, retired as a Lt. Colonel, and was able to spend alot of time with his kids and grandkids. In fact, my Granddad survived all of my Grandparents and even my parents! He just passed away this October 2nd, 2016.  He was 96!

My Granddad was never able to visit the World War II Memorial, but I took him there that day in my mind and heart and we remembered with those who sacrificed and fought with him.

 

Claire

Lincoln Memorial

Monument

 

Book Review: ‘The One Thing’

The ONE Thing

I just finished reading ‘The ONE Thing’ by Gary Keller and Jay Papasan. This book was recommended by several people on many of the different podcasts I listen to, so I thought I’d give it a read. This book both bothered me and inspired me…but it mostly inspired me.

 

  • The interview question, ‘How do you eat an elephant?’, came to mind while I read this. The answer is one small bite at a time, and focus while you’re doing it.
  • The domino metaphor is a powerful one. Setup up a *HUGE* domino and try to knock it over by setting up increasingly smaller ones until the initial domino can be knocked over with a simple flick of the finger. In other words, big goals can be broken down into increasingly smaller ones, which when lined up in succession, can lead to an amazing chain of successes. ‘Overnight Successes’ are actually not a thing, but a long succession of ever increasing successes leading up to a big one.
  • FOCUS. Focus on ONE thing. Focus on ONE thing that will knock over the next domino. That’s the trick, now, isn’t it?
  • The first 4-5 hours in the morning are the most productive of the day. Don’t let anyone hijack that time. No Scrum. No meetings. No phone calls. Just productivity. Save the rest for the less productive hours of the day…in the afternoon. Easier said than done. Usually, our professional time is not our own. Perhaps, not yet anyway.
  • Keep your ‘One Thing’ in the fore front of your mind and activities always. Constantly ask yourself if what you are doing is helping you knock over that next domino.

Focusing on one thing is hard for me. I suspect it’s hard for most people. If it weren’t difficult to focus on just ONE thing at a time, I imagine there would be a whole lot more wildly successful people in the world. Focus has to be one of the secret ingredients to amazing success in life. My mind seems to always be wandering out to sea…


Somewhere on the North Atlantic Ocean...
Somewhere on the North Atlantic Ocean…

Summarizing books like this just doesn’t seem to do them justice, so I apologize in advance. These summaries are mostly for me and for solidifying key concepts in my own brain. This ONE book is definitely worth a read, however, so pick it up at amazon:

 



Getting MEAN: A Java Developer’s Perspective

I intimidate many people because I’m so pretty. Others might say I’m pretty ugly. But when I had the chance to get MEAN too, I jumped at it. In this context, MEAN is an acronym for the technology stack consisting of: MongoDB, Express, AngularJS and NodeJS. I wanted to briefly document some of my recent experiences and take-aways in working with this technology stack, so here are my thoughts.

For most of my programming career now, I’ve been working with mostly Enterprise Java. I started teaching myself Java in the mid-nineties from an O’Reilly book and from the start found the language very intuitive to understand (then). For a number of years now, however, I’ve been thinking that full-stack JavaScript is the way to go for Enterprise Software Development (and other applications as well). So when I had the opportunity to work on a short project using MEAN I was quite glad to get some hands-on experience with it.

First of all, when working with MEAN, you are essentially using the JavaScript language at all layers of application development, from the front-end to the middle-tier to the back-end data store. Theoretically, this should make the learning curve considerably smaller when working across layers, and should also make JavaScript Developers equally interchangeable across layers. The reality, however, is not quite that, but it’s close.

‘M’ Is For MongoDB

MongoDB is a NoSQL database used for storing JSON Documents. MongoDB is very easy to install and run, especially on Linux-based systems. You can run JavaScript in the database; you can even write MapReduce programs in JavaScript and run them on the database. But the main advantage of using MongoDB in this technology stack is the ability to easily store and retrieve JSON documents without have to apply JSON structure to your data after pulling it out of the database. This makes it easier to ship JSON formatted data directly to your front-end without having to mess with RDBMS tables and SQL… and even DBA’s for that matter (‘…can you PLEASE create a table for me!’). Wait, I don’t say ‘please’ anymore because I’m MEAN.

‘E’ Is For Express

Express is a dream to work with. It’s very simple and intuitive to use and takes no time at all to go from knowing nothing to creating fairly complex JSON REST Web Services. We connected Express to our MongoDB instance using Mongoose, which is so simple even I could configure it. Simple is good, right?

‘A’ Is For AngularJS

I found working in Angular 1.x fairly difficult to understand. The associated documentation is not all that well written and generally not very helpful. I feel like the framework is a bit over-engineered. I have not worked with Angular 2.x yet, so perhaps things have improved. Nevertheless, many, many organizations have invested heavily in Angular, so I’m sure I must be missing something, and without a doubt AngularJS is better than working with Java Server Faces (JSF) or Struts. Nevertheless, I might actually try ReactJS as the front-end framework next time as several co-workers have strongly recommended it.

‘N’ Is For NodeJS

NodeJS is the server-side JavaScript middleware that ran our Express JSON REST Services. Working with NodeJS requires that you get used to writing asynchronous code, but once you get the hang of that it’s quite fun and easy to use. From a Java Developer’s perspective, working with NodeJS is so much more efficient than having to compile and package Java Code into a WAR or EAR before deploying it to a JEE Container, like Tomcat or JBoss or Websphere or Weblogic. In Java land, that process seems to take years sometimes. When using NodeJS and a code monitor like nodemon, you simply forget about about the code deploy process and start to take for granted that your code changes are instantly available for testing on your local server. What?!?!

The Node Package Manager (npm) makes installing and managing modules very easy as well.

Fast Development, Fast Deployment

As mentioned, using code watch tools like nodemon, or even grunt or gulp serve-up local code changes in real-time. That speeds up development time significantly. Moreover, your mocha, chai, karma, etc. test scripts are invoked automatically each time you make a code change, so feedback on whether your build is broken or not is instant and continuous. Once integrated with an efficient Continuous Integration/Continuous Delivery (CI/CD) Pipeline, code commits to Git can be automatically built, tested and pushed-out to a running server in your environment of choice. Of course you can do the same in Java, but I bet that MEAN Developers can develop twice the functionality, if not more, than Java Developers in the same amount of time.

In business, speed kills when your MEAN (and pretty).