Guest User

Untitled

a guest
Nov 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. data "template_file" "cloud-config" {
  2. template = <<YAML
  3. #cloud-config
  4. runcmd:
  5. - echo 'This instance was provisioned by Terraform.' >> /etc/motd
  6. YAML
  7. }
  8.  
  9. resource "oci_core_instance" "example" {
  10. count = 1
  11. compartment_id = "${var.compartment_ocid}"
  12. availability_domain = "${var.availability_domain}"
  13. subnet_id = "${var.subnet_ocid}"
  14. display_name = "example"
  15. image = "${lookup(data.oci_core_images.image-list.images[0], "id")}"
  16. shape = "VM.Standard1.1"
  17.  
  18. metadata = {
  19. ssh_authorized_keys = "${file(var.ssh_public_key_file)}"
  20. user_data = "${base64encode(data.template_file.cloud-config.rendered)}"
  21. }
  22. }
Add Comment
Please, Sign In to add comment