# How to Automate Neo4j Deploys on AWS

**URL:** <https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226>\
**Category:** Aura & Cloud\
**Tags:** aws, cloud, cloudformation\
**Created:** [February 20, 2019, 8:24pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226 "2019-02-20T20:24:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [February 20, 2019, 8:24pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/1 "2019-02-20T20:24:10Z")

</div>

Hi everybody - after some requests I put together an article with some simple shell scripts that you can use to create Neo4j deployments of enterprise, community, and causal cluster on AWS.

If you have any questions or feedback to share, this thread is the right place!

> **[How to Automate Neo4j Deploys on AWS](https://medium.com/neo4j/how-to-automate-neo4j-deploys-on-aws-2f36b7386e4c)**
>
> Neo4j already provides some documentation on its site for how to do deployments of Neo4j to common clouds, including AWS. But in this…

---

<div class="post-metadata">

**Author:** ![mikhail](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mikhail/32/1145_2.png) [@mikhail](https://community.neo4j.com/u/mikhail)\
**Post date:** [February 28, 2019, 7:51am UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/2 "2019-02-28T07:51:52Z")

</div>

Hi, thank you for your great work!

We use one of templates that you provided in this blog post to deploy Neo4j Casual Cluster in AWS. We did copy-paste template that you provided from the s3 to our project.  
Today I found out that AMI which we used in eu-west-1 region not available. Instead there is a new AMI in a template which available by link ([http://neo4j-cloudformation.s3.amazonaws.com/neo4j-enterprise-stack-3.5.3.json](http://neo4j-cloudformation.s3.amazonaws.com/neo4j-enterprise-stack-3.5.3.json)).

So my question is did anything was changed in a template except AMI? Also is it possible to provide them in a GitHub or something with changes history?

Is there any reason not use new instance types r5 with Neo4j?

Thank you a lot!

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [February 28, 2019, 1:41pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/3 "2019-02-28T13:41:04Z")

</div>

Hi!

So as for that AMI change, I can explain it. I originally published 3.5.3 AMIs and then published that article. In the intervening 2 days, a colleague internally found a small bug in the AMI that affected customers who were launching the AMI in private VPCs with no external IP addresses, and so we fixed the bug and had to issue new AMIs to make sure that they captured the bugfix. Because we had published the cloudformation templates, the thought was that most people were not yet (by timing) coupled to the specific AMI IDs, rather they were coupled to the CloudFormation template URL.

In the CF template, the only things that changed were the AMI IDs, and also I slightly increased the "timeout". A separate problem we've had with our CloudFormation is that every once in a while (maybe 1 time in 20) the deploy fails because the timeout expires. This isn't due to an error in the CloudFormation, it happens when AWS takes too long to provision the EC2 instances! (This we can't control of course). Deploying Neo4j should take 10 minutes or less, but this is only true if AWS instantly gives you a VM when you ask. Sometimes the infinite cloud pool of resources isn't so infinite -- and in fact in some AZs it can fail because AWS doesn't have the space to allocate a new VM, or simply takes too long to get it done!

Typically what we do is build the AMIs, publish the CloudFormation templates, and then publish updates to the Amazon marketplace. The AWS marketplace takes some time to accept the publish and we're in that waiting period right now for 3.5.3 where we have released the software but it's not yet live on the marketplace. I typically wait until everything is live before announcing that a new version is available. Because we had some customers asking for guidance on automating cluster deploys, in this instance we made an exception and published the blog post -- but that in combination with a rapid turn-around bugfix caused the AMI change.

Once the marketplace stuff is published, I'll post an announcement here about the AMI IDs. When you see me post the AMI IDs publicly, that's the point where we're locking them in for a particular version and won't then subsequently pull those AMIs. If we temporarily publish something (i.e. for testing, but not announced) then it's not yet a guarantee. This particular patch level version has just been a bit more complicated than previous due to the interaction of the bugfix and the AWS publishing timeline.

Hope this helps

---

<div class="post-metadata">

**Author:** ![mikhail](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mikhail/32/1145_2.png) [@mikhail](https://community.neo4j.com/u/mikhail)\
**Post date:** [March 1, 2019, 1:01pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/4 "2019-03-01T13:01:29Z")

</div>

Thank you, I see.

btw when I try to deploy neo4j enterprise standalone using this template and use Volume type equals to "io1" I get an error in CloudFormation:

The parameter iops must be specified for io1 volumes. (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: ca7759be-a913-4d62-a01f-ddac10434032)

So I gues something is missing in a template.

I didn't try with Casual Cluster yet...

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [March 1, 2019, 1:30pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/5 "2019-03-01T13:30:36Z")

</div>

IO1 volumes are specialized kinds of volumes where extra configuration is required. This doesn't have much to do with Neo4j or the CloudFormation templates, it's an oddity of the way AWS has set things up.

> **[Amazon EBS volume types - Amazon Elastic Compute Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html)**
>
> Use General Purpose SSD, Provisioned IOPS SSD, Throughput Optimized HDD, Cold HDD, or Magnetic volumes to tailor your storage performance and costs to the needs of your applications.

If you want to use this particular type of volume, then in the CloudFormation template where the AWS::EC2::Volume is provisioned you need to specify an `Iops` key and give it a value. This key/value doesn't apply to some other types, so it isn't in the template by default.

---

<div class="post-metadata">

**Author:** ![mikhail](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mikhail/32/1145_2.png) [@mikhail](https://community.neo4j.com/u/mikhail)\
**Post date:** [March 1, 2019, 2:27pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/6 "2019-03-01T14:27:35Z")

</div>

thanks.

But io1 is available parameter and I can choose it during deploy, so from my point of view if it need extra configuration it shouldn't be there by default...

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [March 1, 2019, 3:01pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/7 "2019-03-01T15:01:03Z")

</div>

Uh -- I agree. Where do you see it by default? I checked the blog post and the default there is `ParameterKey=VolumeType,ParameterValue=gp2`

---

<div class="post-metadata">

**Author:** ![mikhail](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mikhail/32/1145_2.png) [@mikhail](https://community.neo4j.com/u/mikhail)\
**Post date:** [March 1, 2019, 4:25pm UTC](https://community.neo4j.com/t/how-to-automate-neo4j-deploys-on-aws/5226/8 "2019-03-01T16:25:50Z")

</div>

I mean that "io1" is in the list of allowed values for VolumeType parameter in a template.  
So if I deploy it using CloudFormation console or from AWS MarketPlace (which in turn will open CloudFormation console) then I can choose this type of volume from the list and then I will get an error..

P.S. not sure about case with AWS MarketPlace (coz this template not available there for now)
