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

FR: set volume_tags on aws_instance resource #186

Closed
chpl opened this issue Feb 8, 2024 · 4 comments · Fixed by #187
Closed

FR: set volume_tags on aws_instance resource #186

chpl opened this issue Feb 8, 2024 · 4 comments · Fixed by #187
Assignees
Labels
enhancement New feature or request

Comments

@chpl
Copy link

chpl commented Feb 8, 2024

Is your feature request related to a problem? Please describe.
The aws_instance resource creates an ebs volume, but the tags are not applied to it.
See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#tags

Note that these tags apply to the instance and not block storage devices

Describe the solution you'd like
There's volume_tags attribute that controls volume tags, terratag should set it too.

Describe alternatives you've considered
Another option is to manage volumes as separate resource and attach them using aws_volume_attachment but this won't work for root volume.

Additional context
n/a

@TomerHeber TomerHeber added the enhancement New feature or request label Feb 8, 2024
@TomerHeber TomerHeber self-assigned this Feb 8, 2024
@TomerHeber
Copy link
Collaborator

@chpl - by any chance do you have a sample file?

@sachin-ks
Copy link

sachin-ks commented Feb 14, 2024

@TomerHeber sample file:

resource "aws_instance" "ubuntu" {
  ami = var.ami_id
  instance_type = "t3.micro"
  availability_zone = "us-west-2"


  tags = {
    Name = "terratag-test"
    env = "test"
  }
  volume_tags = {
    env = "test"
  }
}

OR:

resource "aws_instance" "ubuntu" {
  ami = var.ami_id
  instance_type = "t3.micro"
  availability_zone = "us-west-2"


  tags = {
    Name = "terratag-test"
    env = "test"
  }
}

@terenho-jobber
Copy link

The PR #187 introduces a conflict error. I have more details in #187 (comment). Should I open a new issue or reopen this one?

@TomerHeber
Copy link
Collaborator

@terenho-jobber - if you can open a new issue I will greatly appreciate that.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants