Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.12 KB

README.md

File metadata and controls

67 lines (48 loc) · 2.12 KB

Terraform Provider for Oracle Compute Cloud

PLEASE NOTE: This repository location has changed from github.com/oracle/terraform to github.com/oracle/terraform-provider-compute

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

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

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