hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.84k stars 9.19k forks source link

Root block device tagging in aws_launch_configuration #2891

Open hashibot opened 6 years ago

hashibot commented 6 years ago

This issue was originally opened by @zoltan-toth-mw as hashicorp/terraform#17054. It was migrated here as a result of the provider split. The original body of the issue is below.


It would be nice to have volume tags in aws_launch_configuration resource to make them easily identifiable.

Something like:

resource "aws_launch_configuration" "proxy" {
  [...]
  root_block_device {
    volume_size = 50
    volume_type = "gp2"
    delete_on_termination = true

    tags {
           Name = "proxy_root"
           BillingGroup = "FooBar"
    }

  }
DanielMarquard commented 6 years ago

Agreed. We need to comply with a naming convention for all resources, so this would be super helpful.

jayanderson commented 6 years ago

This may be unsupported by AWS (see https://forums.aws.amazon.com/thread.jspa?threadID=122354). Terraform may not be able to implement this directly.

Two main workarounds (See https://blog.cloudability.com/two-solutions-for-tagging-elusive-aws-ebs-volumes/): 1) Periodically look for untagged volumes and apply instance tags to the volume 2) Apply instance tags to the volume during startup

include commented 5 years ago

https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#propagate_at_launch this is not a option?

zoltan-toth-mw commented 5 years ago

https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html#propagate_at_launch this is not a option?

That only tags the instances but not their root block volume.

mengmann commented 5 years ago

workaround: root-device tagging with userdata: https://stackoverflow.com/a/55158550/10374572

FearlessHyena commented 4 years ago

The fix would probably also apply to the root_block_device for the aws_instance as mentioned in #4017

cptcrush2 commented 4 years ago

Using volume_tags couldbe another workaround as it will tag root_block_device

leeuw471 commented 2 years ago

Seems launch config should support tags for volumes as well: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html

Any update on this one?