Fork me on GitHub

what do you mean by clojure + aws? deploying a Clojure web app to AWS?


Yes, deploying a clojure web app to AWS.


I used to use GAE, and wrote Clojure apps as Jetty Servlets, but am now looking into AWS instead.


Don't have a Clojure tutorial but the java documentation is pretty similar. For a simple deploy I recommend using AWS Elastic Beanstalk. You can create an app, configure it, then push an uberjar to it. If you want to see logs, connect to the instance, change environnement variables from a shell, install the eb command. If you want your code to watch a git referential and be built, you can create an AWS CodeBuild build and configure it with a buildspec.yml file at the root of your project. To automate deployments AWS CodePipeline can watch your Git repo, trigger the build, then push your uberjar to ElasticBeanstalk. ElasticBeanstalk will take care of load balancing, blue-green deployments etc…


BTW if you find a Clojure tutorial for this, I'd like to read it too 🙂


@ggaillard : do you give up live nrepl ?


I dont use it, but you can open an SSH connection with $> eb ssh, and then I guess you can open a REPL. If you have special needs, you can create an Amazon Machine Image (AMI) with all the tools you need (lein, emacs, <you name it>) and make ElasticBeanstalk use it as a base. I didn't tried, but I guess you can create a tunnel from your machine to the instance with port forwarding and give that local port to your repl.

$> eb ssh --help
-e CUSTOM, --custom CUSTOM
                        Specify an SSH command to use instead of 'ssh -i
                        keyfile'. Do not include the remote user and hostname.