Skip to content

Instantly share code, notes, and snippets.

@jeroenvandijk
Last active April 2, 2020 02:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeroenvandijk/e92cf7333f6bbfee981accde4c9ec66f to your computer and use it in GitHub Desktop.
Save jeroenvandijk/e92cf7333f6bbfee981accde4c9ec66f to your computer and use it in GitHub Desktop.
Example of Datomic Cloud setup via code
;; DISLAIMER: using this script will create AWS resources and will cost you money. Details are here https://docs.datomic.com/cloud/setting-up.html
;; Start repl or put below in a script
;; clj -Sdeps '{:deps {amazonica {:mvn/version "0.3.132"}}}'
;; Get credentials, see https://github.com/mcohen01/amazonica#authentication
(def my-creds ...)
;; Create a keypair in the ec2 console https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#KeyPairs:sort=keyName or use an existing one
(def ssh-key-pair-name "your-key-pair-name")
;; Fetch url from Cloudformation form after subscribing in AWS Marketplace (url below could be outdated!)
(def datomic-ions-template-url "https://awsmp-fulfillment-cf-templates-prod.s3-external-1.amazonaws.com/5e99c028-1707-4840-8e41-f70361e29600/bb81e938-7ba4-4cbe-8240-e91a21d3c6b7/44c2eed607ed460dbf282dd1658d1058.template")
(require '[amazonica.aws.cloudformation :as cfn])
(cfn/create-stack my-creds
{:stack-name "DatomicIonsHelloWorld"
:template-url datomic-ions-template-url
:Parameters [{:parameter-key "KeyName"
:parameter-value ssh-key-pair-name}]
:capabilities ["CAPABILITY_NAMED_IAM"]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment