Fork me on GitHub
#aws
<
2017-05-20
>
lumengxi04:05:41

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

qqq04:05:13

Yes, deploying a clojure web app to AWS.

qqq04:05:31

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

ggaillard08:05:24

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… http://docs.aws.amazon.com/en_us/elasticbeanstalk/latest/dg/java-getstarted.html

ggaillard08:05:57

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

qqq08:05:27

@ggaillard : do you give up live nrepl ?

ggaillard08:05:41

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.