Created
April 24, 2017 15:52
-
-
Save brunoborges/2b9aeccf88cb83c6205a7b55ee79130e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "opc" { | |
identity_domain = "mydomain" | |
endpoint = "https://api-z27.compute.us6.oraclecloud.com/" | |
user = "user.name@example.com" | |
password = "Pa$$w0rd" | |
} | |
resource "opc_compute_ssh_key" "sshkey1" { | |
name = "example-sshkey1" | |
key = "${file("~/.ssh/id_rsa.pub")}" | |
} | |
resource "opc_compute_instance" "instance1" { | |
name = "example-instance1" | |
shape = "oc3" | |
image_list = "/oracle/public/OL_7.2_UEKR3_x86_64" | |
ssh_keys = [ "${opc_compute_ssh_key.sshkey1.name}" ] | |
networking_info { | |
index = 0 | |
shared_network = true | |
nat = ["${opc_compute_ip_reservation.ipreservation1.name}"] | |
} | |
} | |
resource "opc_compute_ip_reservation" "ipreservation1" { | |
name = "example-ipreservation1" | |
parent_pool = "/oracle/public/ippool" | |
permanent = true | |
} | |
output "public_ip" { | |
value = "${opc_compute_ip_reservation.ipreservation1.ip}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment