How to Use the Cloud Foundation Library

Getting started

The Cloud Foundation Library is designed to be used as a template for any to build their own library. It should be copied, as a whole, into your own environment. The easiest way to do this is to clone the github repository.

For complete deployment solutions, copy the relevant solution to your deployment environment and amend as necessary. You will probably have to change the module URLs to your specific environment. If the solution is perfect for you, then just change the terraform.tfvars file. If you need to customize, the just edit the files in situ.

To use the modules within your custom code, just add the module reference to your Terraform scripts, supplying the relevant parameters.

Creating your own library

If you intend to develop your own module library for use across your organization, then we would recommend that you switch from simple file directories to a Git repository to hold your modules.

Each module should become a Git repo that can be directly referenced from a Terraform module call. You can find more information on how to set this up on in the Terraform Module Sources docs.

When sharing more broadly, then version control and being able to specify a specific version of module becomes essential.

Here’s an example of how to call a module in Git with a version number:

# a Git reference with a version number
module "ATP" {
  source = "git::https://git.myorg.com/atp.git?ref=v1.3.2"
}

We cover more detail on how to set up your OCI environment in our Infrastucture as Code section.

Getting involved

The Cloud Foundation Library is a free-to-use resource for anyone to pick up and use as-is or to tailor for their own requirements. We hope that it will help you get started with Infrastructure-as-code on OCI.

If you like what you see, and you would like to contribute to the Cloud Foundation, we would love to hear your ideas and improvements. please get in touch via the Github.