Skip to content
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

Alternating tags in volume #5080

Closed
heldersepu opened this issue Jul 5, 2018 · 2 comments · Fixed by #15474
Closed

Alternating tags in volume #5080

heldersepu opened this issue Jul 5, 2018 · 2 comments · Fixed by #15474
Labels
documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@heldersepu
Copy link
Contributor

heldersepu commented Jul 5, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.7
+ provider.aws v1.23.0
+ provider.template v1.0.0

Affected Resource(s)

  • aws_instance
  • aws_ebs_volume
  • aws_volume_attachment

Debug Output

  • First apply we get:
    volume_tags.Name: "suse12 volume tags" => "suse12-data-ndj"
  • Second apply we get:
    volume_tags.Name: "suse12-data-ndj" => "suse12 volume tags"

Here is a longer output

PS C:\Users\helde\Documents\GitHub\hs-scripts\TerraForm\suse> terraform apply
aws_ebs_volume.data-ndj: Refreshing state... (ID: vol-0e4ee5ad2c9a3629e)
data.aws_ami.suse12: Refreshing state...
aws_instance.suse12: Refreshing state... (ID: i-0140a00017d5c96dc)
aws_volume_attachment.data-ndj: Refreshing state... (ID: vai-2788403704)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ aws_ebs_volume.data-ndj
      tags.Name: "suse12 volume tags" => "suse12-data-ndj"


Plan: 0 to add, 1 to change, 0 to destroy.
...

PS C:\Users\helde\Documents\GitHub\hs-scripts\TerraForm\suse> terraform apply
aws_ebs_volume.data-ndj: Refreshing state... (ID: vol-0e4ee5ad2c9a3629e)
data.aws_ami.suse12: Refreshing state...
aws_instance.suse12: Refreshing state... (ID: i-0140a00017d5c96dc)
aws_volume_attachment.data-ndj: Refreshing state... (ID: vai-2788403704)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ aws_instance.suse12
      volume_tags.Name: "suse12-data-ndj" => "suse12 volume tags"


Plan: 0 to add, 1 to change, 0 to destroy.
...

Expected Behavior

The Volume tag set at aws_ebs_volume should not be overwritten by those on volume_tags

Actual Behavior

On every apply Tags are alternating

Steps to Reproduce

terraform apply this:
https://github.com/heldersepu/hs-scripts/blob/master/TerraForm/suse/ec2.tf

@YakDriver
Copy link
Member

We have merged a fix to the volume_tags issue in #15474. We have added tests to cover the issues observed. Please note that using volume_tags in aws_instance is not compatible with using tags in aws_ebs_volume. You need to use one or the other. Prior to this fix, even following this rule, you would encounter errors. Along with the fix, we've added tags to the root_block_device and ebs_block_device configuration blocks in aws_instance.

Now that the fix is in place, if you find any problems with volume_tags, let us know by opening a new issue.

@ghost
Copy link

ghost commented Feb 13, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
3 participants