-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when terraform apply
is run multiple times
#698
Comments
@dacbd - tested several variations of this with aws and could not reproduce an error. Could you provide more information on what kind of an error you saw? |
@tasdomas I think this was caused by file changes to the main.tf, the original attempt to reproduce with: #!/bin/bash
dir=$(mktemp -d)
pushd "$dir"
cat <<END >> main.tf
terraform {
required_providers { iterative = { source = "iterative/iterative" } }
}
provider "iterative" {}
resource "iterative_task" "test" {
cloud = "aws"
machine = "t3.small"
region = "us-west-1"
image = "ubuntu"
disk_size = 10
storage {
workdir = "."
output = "."
}
script = <<-SCRIPT
#!/bin/bash
echo "hi"
sleep 300
echo "done"
SCRIPT
}
END
for i in {0..9}; do
dd if=/dev/random of="file_$i.txt" bs=16M count=1
done
terraform init
terraform apply --auto-approve
terraform apply --auto-approve
terraform destroy --auto-approve
popd && rm -r "$dir" I was able to reproduce the behavior I saw by editing the #!/bin/bash
dir=$(mktemp -d)
pushd "$dir"
cat <<END >> main.tf
terraform {
required_providers { iterative = { source = "iterative/iterative" } }
}
provider "iterative" {}
resource "iterative_task" "test" {
cloud = "aws"
machine = "t3.small"
region = "us-west-1"
image = "ubuntu"
disk_size = 10
storage {
workdir = "."
output = "."
}
script = <<-SCRIPT
#!/bin/bash
echo "hi"
sleep 300
echo "done"
SCRIPT
}
END
for i in {0..9}; do
dd if=/dev/random of="file_$i.txt" bs=16M count=1
done
terraform init
terraform apply --auto-approve
cp main.tf ./org.txt
sed -i 's/10/20/g' main.tf
terraform apply --auto-approve
terraform destroy --auto-approve
popd && rm -r "$dir"
If you run the above, you will see the other undesirable behavior I think this is better solved with a combo of: #590 and #697 |
No description provided.
The text was updated successfully, but these errors were encountered: