PLEASE NOTE: This repository location has changed from github.com/oracle/terraform to github.com/oracle/terraform-provider-compute
- Terraform 0.7.x
- Oracle Compute Cloud Account
- Go 1.7 (to build the provider plugin)
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
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 CloudOPC_PASSWORD
- Password for Oracle Public CloudOPC_IDENTITY_DOMAIN
- Identity domain for Oracle Public Cloud
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
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