Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data "template_file" "cloud-config" {
- template = <<YAML
- #cloud-config
- runcmd:
- - echo 'This instance was provisioned by Terraform.' >> /etc/motd
- YAML
- }
- resource "oci_core_instance" "example" {
- count = 1
- compartment_id = "${var.compartment_ocid}"
- availability_domain = "${var.availability_domain}"
- subnet_id = "${var.subnet_ocid}"
- display_name = "example"
- image = "${lookup(data.oci_core_images.image-list.images[0], "id")}"
- shape = "VM.Standard1.1"
- metadata = {
- ssh_authorized_keys = "${file(var.ssh_public_key_file)}"
- user_data = "${base64encode(data.template_file.cloud-config.rendered)}"
- }
- }
Add Comment
Please, Sign In to add comment