Search code examples
amazon-web-servicesamazon-ec2clojuredatomic

Is there any way to use t2.small EC2 instance when deploying Datomic Transactor to AWS?


I'm able to deploy Datomic Transactor using Datomic Auto Deploy Scripts to EC2(c3.large) instance and it works really well but I would like to use t2.small because it's cheaper.

When I try to change instance type from c3.large to t2.small from CF template file I get mapping error.

Any ideas?


Solution

  • I found the solution, it turned out in CloudFormation.json file did not have t2.small instance type:

    ...
    "Mappings":
     {"AWSInstanceType2Arch":
     {"m3.large":{"Arch":"64h"},
      "c3.large":{"Arch":"64h"},
      "hs1.8xlarge":{"Arch":"64h"},
      "i2.xlarge":{"Arch":"64h"},
      "t2.small":{"Arch":"64h"},
    ...
    

    And I added t2.small in there.Then changed the following part:

    ...
     "Parameters":
     {"InstanceType":
      {"Description":"Type of EC2 instance to launch",
       "Type":"String",
       "Default":"t2.small"},
    ...
    

    Also I needed to change JVM heap size parameters like this(1.5GB):

    ...
      "Xmx":
      {"Description":"Xmx setting for the JVM",
       "Type":"String",
       "AllowedPattern":"\\d+[GgMm]",
       "Default":"1500m"},
    ...
    

    Since t2.small has 2GB RAM it's okay to set to 1500M.

    So everything worked as expected...