How to setup Oracle Develop Cloud Service for Terraform

Dev CS support execution of Terraform. You can create build jobs in Dev CS where you first deploy the platform (IaaS and PaaS). Then you use the jobs in the pipeline. It means that you can have full deployment pipeline in Dev CS that both have platform setup as part of the pipeline together with your application.

Oracle Develop Cloud Service is a lot more than only Terraform. https://docs.oracle.com/en/cloud/paas/developer-cloud/csdcs/oracle-developer-cloud-service.html#GUID-010F5CE7-87DC-4870-BA7E-DE0760B8DC40

The Benefits
By using Dev CS you get a some nice benefits
– Versioning of you Terraform file
– Roll back possibility
– Track changes
– Markdown
– Documentation
– Integration options

Prerequisites

You need to have some stuff in place before you can get Terraform to work on Dev CS

Develop Cloud Service
We need an instance of Dev CS.

Guide:
– Sign in  – https://cloud.oracle.com/sign-in
– Find Develop CS on your Dashboard, can be you have to ‘Customize Dashboard’ to see it
– Click the Sandwich and choose ‘Open Service Console’
– Here you can create a new instance of Dev CS

Project
In Dev CS we need a Project. Project is a collection of Git repositories, branch merge requests, wikis, issues, deployment configurations, and builds.

Guide: https://docs.oracle.com/en/cloud/paas/developer-cloud/csdcs/working-projects.html#GUID-7B30C8EC-6CDA-4F14-9791-8AE3BB3E8343

 

Configure Object Storage
In Dev CS you have a feature called Artifact. Here you can store data and re-use it later in the process. The Artifact need to be stored and Object storage is a fine place to do that, because if the structure of Object storage.

Guide: https://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/developer/config_compute_storage/devcs_config_storage.html

Configure Build VM
When you run you build job. The job will be executed on a Build VM.

Guide:  https://docs.oracle.com/en/cloud/paas/developer-cloud/csdcs/viewing-and-managing-virtual-machines.html#GUID-0B9A93E2-7231-4E83-A893-2DC9C6FE1F42

 

Configure Build VM Template
The build VM does not have any application installed by default. We need to Terraform installed on the Build VM we will you. Therefore we need to create a Build VM Template

Guide: https://docs.oracle.com/en/cloud/paas/developer-cloud/csdcs/managing-virtual-machine-templates1.html#GUID-8C39E8D0-4A04-4AEA-AF54-4677B0E6A972

Note: When you get to ‘Configuring a VM Template’s Software’ step 3. Here you have to add Terraform

Git Repository
The Git Repo is where we will store our Terraform files and other need binaries. Therefore we need one

Guide: https://docs.oracle.com/en/cloud/paas/developer-cloud/csdcs/using-git-oracle-developer-cloud-service.html#GUID-B59EBAB8-92A5-467E-988C-64815139ECC0

When you have created the Git Repo, then please add you Terraform files and other need files

 

How to create Terraform Build Job

There have been many Prerequisites that need to be in place before you can create you build job for Terraform. Where you can deploy the wanted platform you like to have.

  1. Open your Project
  2. Go to Build

  3. Add ‘New Job’

  4. Give it a name and choose your software template

  5. Configure your Job
  6. In ‘Source Control’ add Source Control Git and select you Terraform Repository

  7. Go to the ‘Builders’ tab and add ‘Builder’ Unix Shell Builder. Here you type your need command.

  8. Go now to ‘Post Build’ tab and ‘Post Build Actions’ select ‘Artifact Archiver and type what file(s) you like to add to the Archive after the build.
  9. Now Save it

  10. Now you can run your job

  11. You can use ‘Build Log’ to check what is going on and you can Compute Service Console to see the output.

 

 

 

Comments are closed.