Ions Tutorial: Comments


Edit 1: I’ve deleted my initial post since the problem had to do with the fact that my aws profile had been somehow messed up. I’m now able to follow the ions tutorial just fine. Sorry about my premature post.

Edit 2: I’ve just completed the tutorial and am quite impressed with the power of ions. I knew in theory what it does, but this exercise made me understand how easy it is now to deploy clojure code. I highly recommend everyone to just try the tutorial.

There was one gotcha in the tutorial. When I tried to access API gateway by calling

curl https://$(obfuscated-name) -d :hat

as the tutorial suggests, the response was

{"message":"Missing Authentication Token"}.

After a bit of research on Google, I found that I can call the API on any path but the root path, so calling

curl https://$(obfuscated-name) -d :hat

gave me a successful response. I figured this out after reading the following paragraph found on this aws document.

The Invoke URL link points to the root resource of the API in its beta stage. Navigating to the URL by choosing the link calls the beta stage GET method on the root resource. If methods are defined on child resources and not on the root resource itself, choosing the Invoke URL link will return a {"message":"Missing Authentication Token"} error response. In this case, you must append the name of a specific child resource to the Invoke URL link.

Aside from this gotcha, the tutorial was easy to follow. One thing I find missing in the tutorial is how to clean up the resources created during this tutorial without impairing the main functionality of Datomic Cloud.

If I understand it correctly, the following resources were created during the tutorial.

  • the S3 bucket that starts with “datomic-code”
  • the CodeDeploy application with the system name
  • 2 web service ions in AWS Lambda (namely ${GROUP)-items-by-type-web and ${GROUP)-get-tutorial-schema)
  • 8 lambda functions in AWS Lambda that start with the system name
  • the API gateway

Since I did the first upgrade just before the tutorial, I’m not so sure if the CodeDeploy application was created during the tutorial or as a result of the upgrade. Also, I believe all the lambda functions were created during the tutorial, but I’m not entirely sure about this, because I had never opened the AWS Lambda console before.