Skip to content

fzakaria/terraform-provider-compute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Terraform Provider for Oracle Compute Cloud

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published