Turning a Compartment into a ORM Stack

Effective first, then efficient and then elegant …

Peter Laurie – mate and mentor.

I’ve been doing some collaboration with @stantanev around a project and part of the contribution that I was doing was getting some stuff setup / configured and deployed into Oracle Cloud Infrastructure. This wasn’t a standard copy-and-paste scenario. I was building it up as we went. And then I was done … But it felt unfinished because I didn’t want to just leave it there. I wanted to share what I have without me getting sucked into other work standing up new environments (noting in the last article – I am lazy). And in the first instance, I only had dev (where I was working) and I needed to create a new one so people can start experiencing what we delivered (quickly).

What I invested in was using Oracle Resource Manager “ORM” to help me take what I built in Oracle Cloud Infrastructure and turn that into something that I could hand-over. Let’s have a look.

Before, I get started on ORM, lets have a look at the OCI resources that I want to include. Here’s a quick snapshot from the Tenancy Explorer where I can have a look at what is provisioned. At the moment, I’ve got these four resources that make up the project (an autonomous database, a compute node, a virtual cloud network for the compute and then an object storage bucket).

From there, I head to ORM under “Solutions and Platforms” in the menu to create a Stack (which is the same as a Terraform root module).

By creating a stack, there are different options here in terms of the source of the stack however in this scenario, I’m selecting the option of “Existing Compartment” so I can introspect that compartment to create a stack. There’s a couple of additional options as to the region and compartment and maybe a set or subset of OCI resources to include in the stack. For what I did, I just said all.

Once that kicks off, a work request starts the magic and works behind the scenes. There is no need to shut stuff down – it just happens.

Eventually, the stack is created and formed. From here, there’s a few things to inspect.

I’ve downloaded the Terraform configuration which comes in a zip file. This is a collection of the modules in HCL format with different files for the different resources. There’s also a file for variables.

We are on the way to get this fully automated. As I said … on our way … there’s a few things that still needed to be done to have it fully automated. Here’s a couple of things that I experienced.

  • The resources are for infrastructure and doesn’t include any of the application configuration. For example the database schemas, the APIs, the docker configuration and the static content were not included. Also, sensitive data like passwords are excluded. These need to be added back in.
  • The resources are well-defined. What I mean by that is typically when we are doing configurations (from scratch) we tend to only include configuration that is required and not define the defaults. Because this is introspected, then defaults and optionally configurations are included.
  • The resources are specific. Some of the variables are specific to your compartment and region. ie. the source-image-id for the VM is unique for the version of the image as well as the region that it was deployed hence keep an eye out for these as well.

After a little bit of work to shape it, I was able to create a well-formed ORM Terraform project that I can know fully automate with the infrastructure, application and enough flexibility with the different variables that its easy enough to share with others.

You can check out the end result in a few different places. If you are interested in the final outcome of what I did either:

Maybe this might give you a glimpse of what the project is all about.

I acknowledge Mason Borda for their contribution in building this game.

If you need an Always Free Tier environment to try this out – head to the following link and sign-up. https://www.oracle.com/au/cloud/free/

To find more information about Oracle Resource Manager, have a look at the documentation – https://docs.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/landing.htm

Have fun learning.

Author: Jason Lowe

I am passionate about how organisations adopt IT quickly and sustainably to achieve a specific and measurable outcome. This thinking is supported through lean IT practices in operational support and project delivery, and adopting these practices with Oracle technologies by creating sustainable platforms. I'm also interested different perspectives and drivers - from enterprise to start-ups, academia to commercial to public sector, cost-sensitive (risk) to value-driven (reward) - all of which influences decisions that organisations make. I have a passion for community and have been called "a connector" - meeting new people that are trying to solve valuable and hard problems and connecting them with others that can validate and help realise their full potential. I've supported different organisations like TADHack and Hacking Health as a global organiser. I'm is a persistent blogger on medium.com and redthunder.blog and on LinkedIn - https://www.linkedin.com/in/lowe-jason #CommunityMatters #ItTakesAVillage

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s