Git Product home page Git Product logo

terraform-provider-compute's Introduction

Terraform Provider for Oracle Compute Cloud

THE PROVIDER PLUGIN IMPLEMENTATION IN THIS REPOSITORY IS DEPRECATED

For Terraform release 0.9.4 and onwards the Oracle Compute Cloud resouce provisioning is supported by the built-in Oracle Public Cloud opc provider included in the main Terraform distribution. See the Terraform Oracle Public Cloud Provider documentation for more details.

All future development and ongoing support for the built-in opc provider is at https://github.com/terraform-providers/terraform-provider-opc*

If you are still using Terraform 0.7.x to 0.9.3 the provider plugin in this repository is required to provision Oracle Compute Cloud resources. See the details below to build and install the provider plugin. See the migration guide to update existing configurations and deployments to the build-in provider for Terraform 0.9.4+

For the Terraform Provider for Oracle Bare Metal Cloud Services go to github.com/oracle/terraform-provider-baremetal

Requirements

Building

Create a directory where the provider will be built, and set the Go language GOPATH

$ export GOPATH=/home/opc/terraform-provider
$ cd $GOPATH

Fetch the source and build the provider.

$ go get -d github.com/oracle/terraform-provider-compute/provider
$ go build -o terraform-provider-opc github.com/oracle/terraform-provider-compute/provider

Usage

Add the generated terraform-provider-opc executable to your .terraformrc configuration (%APPDATA%/terraform.rc on Windows), e.g.

providers {
    opc = "/home/opc/terraform-provider/terraform-provider-opc"
}

To authenticate with the Oracle Compute Cloud the provider will prompt for the required environment credentials. These credentails can be set in the following environment variables:

  • OPC_ENDPOINT - Endpoint provided by Oracle Public Cloud (e.g. https://api-z13.compute.em2.oraclecloud.com/\)
  • OPC_USERNAME - Username for Oracle Public Cloud
  • OPC_PASSWORD - Password for Oracle Public Cloud
  • OPC_IDENTITY_DOMAIN - Identity domain for Oracle Public Cloud

or directly in the terraform configuration:

provider "opc" {
  user = "xxxx@xxx"
  password = "xxxx"
  identityDomain = "xxxx"
  endpoint = "https://api-z13.compute.em2.oraclecloud.com/"
}

Example Terraform configuration

An example test.tf is provided that demonstatates the basic usage of the Oracle Compute Cloud Terraform Provider.

$ cd $GOPATH/src/github.com/oracle/terraform-provider-compute/test
$ terraform plan
$ terraform apply
$ terraform destroy

Additional examples are in the examples directory.

Running the Integration Tests

An Oracle Compute Cloud Account is required to run the integration tests. The OCP_* variables must have been exported

$ cd $GOPATH/src/github.com/oracle/terraform-provider-compute/sdk/compute
$ go test

Common build issues

The following build issue can occur if you have an older version of the terraform executable installed.

Error configuring: 1 error(s) occurred:

* Incompatible API version with plugin. Plugin version: 3, Ours: 2

To build the provider plugin against a specific terraform version, checkout the version in the $GOPATH/src/github.com/hashicorp/terraform source directory and rebuild. Be sure the align the checkout tag with the version of terraform you have installed, e.g for Terraform v0.8.5 you will need to git checkout v0.8.5

$ terraform --version
Terraform v0.8.5

$ ( cd $GOPATH/src/github.com/hashicorp/terraform && git checkout v0.8.5 )
$ go build -o terraform-provider-opc github.com/oracle/terraform-provider-compute/provider

To revert back to building againt the latest source change the git checkout statement to git checkout master

terraform-provider-compute's People

Contributors

scross01 avatar snaugle avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.