-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Terraform volume tags changes on alternate run if defined in both aws_instance and aws_ebs_volume resources #5609
Comments
was seeing this also for a while. |
similar issue with #5080 |
+1 |
we have a similar issue |
I've also run into this issue. |
Same issue. Is there any solution? |
They don't actually change, so you can ignore it. |
I can see this happening too
|
This is still happening.
|
There is a workaround:
|
Are there any plans to address this? I am also seeing this issue |
The behavior seems to be worse with the latest versions of Terraform and the AWS provider. Now, under some circumstances, tags can be removed from volumes even if |
We have merged a fix to the Now that the fix is in place, if you find any problems with |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @saveshnshetty as hashicorp/terraform#18713. It was migrated here as a result of the provider split. The original body of the issue is below.
Hi team,
I've defined volume tags in aws_instance resource and aws_ebs_volume resource since I need to add tags to root volume also. But when I ran "terraform apply" second time. Ebs volumes tags got replaced with aws instance volume tags. On third run it got replaced with original ebs volume tags .
This tags changes alternatively . Can you please look into it .
syntax :
resource "aws_instance" "app" {
count = "1"
ami = "${lookup(var.ami,var.region)}"
ebs_optimized = "${var.ebs_optimized}"
instance_type = "${var.instance_type_app}"
monitoring = "${var.monitoring}"
key_name = "${var.key_name}"
user_data = "${data.template_file.userdata-app..rendered[count.index]}"
network_interface {
network_interface_id = "${element(aws_network_interface.network-interface-app..id, count.index)}"
device_index = 0
}
tags {
Name = "$app-${count.index + 1}"
Type = "app"
Env = "${var.env}"
Customer_id = "${var.customer_id}"
}
}
resource "aws_ebs_volume" "ebs-app" {
count = "${var.app_count}"
availability_zone = "****"
size = "${var.ebs_volume_size[0]}"
type = "${var.ebs_volume_type[0]}"
tags {
Name = "app-tmp"
Type = "ebs-volume"
Env = "${var.env}"
Customer_id = "${var.customer_id}"
}
}
The text was updated successfully, but these errors were encountered: