Over a million developers have joined DZone.

Bio4j + AWS CloudFormation = your own fresh baked DB in less than a minute!

DZone's Guide to

Bio4j + AWS CloudFormation = your own fresh baked DB in less than a minute!

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.


So this week it was time to finally start using CloudFormation together with Bio4j. For those not familiar with this AWS service, quoting from their site:

AWS CloudFormation gives developers and systems administrators an easy way to create and manage a collection of related AWS resources, provisioning and updating them in an orderly and predictable fashion.

This is really useful because thanks to CloudFormation templates, you don’t have to worry about manually launching an instance, create a volume, attach it, do some stuff, and then free the resources … You can encapsulate all this tasks in a template reducing all the tasks to just two:

  1. create the stack
  2. delete the satck whenever you are done with it

This template is available in the following address:

So, let’s see how easy it actually is to create your stack:
First you should go to the ‘CloudFormation’ tab in the amazon console and click the button: ‘Create New Stack’

You will see this new window now where you should choose the option Provide a template URL’ and paste there the URL I just provided before. You should also give your stack a name filling the field ‘Stack name’. Then click ‘Continue’.

Ok, now you should be seeing this:

Provide then your key-pair name, left unchanged the snapshot-id field if you want to use the last version and finally enter the type of instance you want to launch.
Once you clicked continue you’ll see a review of all the parameters you entered so far like:

Check everything is as you wish and click continue.
You should be seeing then something like this:

Now you just have to wait for about 30 seconds until after refreshing the stack state changes to green color and says “CREATE_COMPLETE”.
Click on the output tab and you will see the IP address you need to connect with SSH to your new instance.

So now you just have to connect to your instance and you should have your fresh backed Bio4j DB under the folder /mnt/bio4j_volume/bio4jdb ;)

Whenever you are done, just select delete stack in the amazon console and don’t worry about terminating your instance, deleting your volume and all that, they will do it for you!

(Right now the use of this template is restricted to the region eu-west-1a but I plan to extend it to other regions as soon as possible)


Source: http://blog.bio4j.com/2011/12/bio4j-aws-cloudformation-your-own-fresh-baked-db-in-less-than-a-minute/

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}