hashicorp / hcl2

Former temporary home for experimental new version of HCL
https://github.com/hashicorp/hcl
Mozilla Public License 2.0
375 stars 64 forks source link

Argument or block definition required terraform #121

Closed ashwini9860 closed 5 years ago

ashwini9860 commented 5 years ago

I am new to terraform not able to solve this error

Error Argument or block definition required on main.tf line 77, in resource "null_resource" "default_provisioner": An argument or block definition is required here

My code resource "null_resource" "default_provisioner" {

triggers {

default_instance_id = "${aws_instance.testInstance.id}"

}

connection {

host = "${aws_instance.testInstance.public_ip}"

type = "ssh"

user = "terraform"   # as created in 'user_data'

private_key = "${file("/root/.ssh/id_rsa_terraform")}"

}

provisioner "remote-exec" {

inline = [

  "echo 'ready'"

]

} provisioner "ansible" {

plays {

  playbook = {

    file_path = "./ansible/playbook/main.yml"

    roles_path = [

      "./ansible/roles",
    ]

  }

hosts = ["${aws_instance.testInstance.public_ip}"]

become = true

become_method = "sudo"

become_user = "root"

extra_vars = { ansible_become_pass = "${file("/etc/ansible/become_pass")}" } }
}

apparentlymart commented 5 years ago

Hi @ashwini9860,

This is a Terraform question, so please instead ask it in the Terraform community forum. Thanks!