File provisioning Process exited with status 1 while using terraform to provision nginx on aws ec2

my main .tf file is following

resource “aws_instance” “web1” {
ami = “ami-040c7ad0a93be494e”
instance_type = “t2.micro”
key_name = “project1key”
depends_on = [aws_instance.web2, aws_instance.web3]
tags = {
Name = “NginxWeb1”
}

connection {
type = “ssh”
user = “ec2-user”
private_key = file("/home/manjeet-profedge/Downloads/project1key.pem")
host = self.public_ip
}

provisioner “remote-exec” {
inline = [
“sleep 5”,
“sudo amazon-linux-extras enable nginx1.12”,
“sudo yum -y install nginx”,
“sudo systemctl start nginx”
]
}

provisioner “file” {
content = “data.template_file.nginxconf.rendered”
destination = “/tmp/nginx.conf”
}

provisioner “remote-exec” {
inline = [
“sudo cp /tmp/nginx.conf /etc/nginx/nginx.conf”,
“sudo service nginx restart”
]
}
}

And i’m getting the following error

aws_instance.web1 (remote-exec): libXpm.x86_64 0:3.5.12-1.amzn2.0.2
aws_instance.web1 (remote-exec): libpng.x86_64 2:1.5.13-7.amzn2.0.2
aws_instance.web1 (remote-exec): libxcb.x86_64 0:1.12-1.amzn2.0.2
aws_instance.web1 (remote-exec): libxslt.x86_64 0:1.1.28-5.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-all-modules.noarch 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-filesystem.noarch 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-mod-http-geoip.x86_64 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-mod-http-image-filter.x86_64 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-mod-http-perl.x86_64 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-mod-http-xslt-filter.x86_64 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-mod-mail.x86_64 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): nginx-mod-stream.x86_64 1:1.12.2-2.amzn2.0.2
aws_instance.web1 (remote-exec): stix-fonts.noarch 0:1.1.0-5.amzn2

aws_instance.web1 (remote-exec): Complete!
aws_instance.web1: Provisioning with ‘file’…
aws_instance.web1: Provisioning with ‘remote-exec’…
aws_instance.web1 (remote-exec): Connecting to remote host via SSH…
aws_instance.web1 (remote-exec): Host: 13.235.8.181
aws_instance.web1 (remote-exec): User: ec2-user
aws_instance.web1 (remote-exec): Password: false
aws_instance.web1 (remote-exec): Private key: true
aws_instance.web1 (remote-exec): Certificate: false
aws_instance.web1 (remote-exec): SSH Agent: true
aws_instance.web1 (remote-exec): Checking Host Key: false
aws_instance.web1 (remote-exec): Connected!
aws_instance.web1: Still creating… [1m0s elapsed]
aws_instance.web1 (remote-exec): Redirecting to /bin/systemctl restart nginx.service

Error: error executing “/tmp/terraform_1480807078.sh”: Process exited with status 1

***Kindly resolve my issue