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

volume_tags on instance (sometimes) clobbers attached EBS volume tags #15302

Closed
gavD opened this issue Jun 15, 2017 · 1 comment
Closed

volume_tags on instance (sometimes) clobbers attached EBS volume tags #15302

gavD opened this issue Jun 15, 2017 · 1 comment

Comments

@gavD
Copy link

gavD commented Jun 15, 2017

Terraform Version

0.9.8

### Description

I use volume_tags on an EC2 instance to set my boot volume's tags. However, for my mounted volumes, I want slightly different tags (I use MakeSnapshot: True so a custom tool makes a snapshots ONLY of the mounted volume)

Expected Behavior

MakeSnapshot: True is set on the mounted volume

Actual Behavior

Terraform SOMETIMES does what I want and SOMETIMES stripes the MakeSnapshot tag. Here's the plan output:

~ module.basic2.aws_instance.database.0
    volume_tags.%:            "10" => "9"
    volume_tags.MakeSnapshot: "True" => ""

Steps to Reproduce

Here's an example terraform config with the irrelevant parts stripped out.

resource "aws_instance" "database" {

   # ...various config here...

  root_block_device {
    volume_type = "gp2"
  }

  tags {
    Name           =  "myinstance"
  }

  # I only want these on the boot volume
  volume_tags {
    Name           = "myinstance-bootVolume"
  }
}

resource "aws_ebs_volume" "database" {

  # ... various config here...

  type              = "gp2"

  tags {
    Name           = "myinstance-dataVolume"
    MakeSnapshot   = "True"
  }
}

resource "aws_volume_attachment" "database" {
  # ... various config here ...
}

then run terraform plan

Important Factoids

  • Running in EC2 VPCs
  • Sometimes it will strip the tag from the data, sometimes it will not

References

@ghost
Copy link

ghost commented Apr 8, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants