Terraform v0.9.4
Please list the resources as a list, for example:
resource "aws_instance" "mydb" {
ami = "..."
instance_type = "..."
availability_zone = "..."
vpc_security_group_ids = ["..."]
root_block_device {
volume_type = "gp2"
volume_size = 30
}
}
resource "aws_ebs_volume" "mydb_data" {
availability_zone = "..."
size = "10"
type = "gp2"
tags {
Name = "mydb:/data"
}
}
resource "aws_volume_attachment" "mydb_data" {
device_name = "/dev/sdh"
volume_id = "${aws_ebs_volume.mydb_data.id}"
instance_id = "${aws_instance.mydb.id}"
connection {
host = "${aws_instance.mydb.public_ip}"
user = "ec2-user"
private_key = "..."
}
# Run a script to mount this volume as '/data'.
provisioner "remote-exec" {
scripts = [
"${path.module}/scripts/mount-ebs-data-volume.sh"
]
}
}
We can supply this if this proves difficult to reproduce, but we'll need to strip out proprietary data.
None.
Terraform should leave the Name of the volume alone, and not try to remove it.
The plan _always_ includes:
~ aws_instance.mydb
volume_tags.%: "1" => "0"
volume_tags.Name: "mydb:/data" => ""
If run, this will strip the Name off our volume.
Please list the steps required to reproduce the issue, for example:
terraform applyWe use a lot of aws_volume_attachment declarations.
None.
It appears possible to fix/improve this by adding:
lifecycle {
# Don't allow Terraform to update volume tags, because if it does, it will
# erase tags on volumes attached by aws_volume_attachment.
ignore_changes = ["volume_tags"]
}
...to each affected instance.
Hi @emk
I just fixed this this afternoon in master - it will be released in Terraform 0.9.5 which i will try and ship soon!
Sorry for the issue
Paul
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hi @emk
I just fixed this this afternoon in master - it will be released in Terraform 0.9.5 which i will try and ship soon!
Sorry for the issue
Paul