Loading...
Loading...
### Terraform Version 0.10.7 ### Terraform Configuration Files ```hcl resource "aws_instance" "master" { ... connection { type = "ssh" host = "${aws_instance.master.public_dns}" agent = false user = "ubuntu" private_key = "${file(var.private_key_file)}" } provisioner "file" { source = "registry/config.yaml" destination = "/home/ubuntu/registry/config.yaml" } tags = { Name = "swarm-manager" } } ``` ### Expected Behavior Either 1. config.yaml file located in directory /home/ubuntu/registry or 2. error message stating that the directory doesn't exist ### Actual Behavior new file named registry located in /home/ubuntu ### Steps to Reproduce 1. `terraform apply` ### Important Factoids Adding the following before the file provisioner works around the issue: ```hcl provisioner "remote-exec" { inline = [ "cd /home/ubuntu", "sudo mkdir registry", "sudo chown ubuntu registry" ] } ``` Seems that remote-exec runs as root hence the `chown` command is necessary or else the file provisioner fails with permission denied.
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.