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.73k stars 9.09k forks source link

[Enhancement]: aws_ec2_tag improvement or new aws_lb_tag resource #31851

Open julillosamaral opened 1 year ago

julillosamaral commented 1 year ago

Description

Port the behaviour of aws_ec2_tag to tag resources aws_lb.

The need of this feature is because I create resources using aws_elastic_beanstalk_environment and the load balancers created have the tag Name loaded with the value of the aws_elastic_beanstalk_environment, I would like to specify my custom Name tag to group all the resources in the project the same way and not depending on aws_elastic_beanstalk_environment name.

I expected aws_ec2_tag to solve this problem but I get the following panic: Screenshot 2023-06-08 at 1 14 40 PM

Affected Resource(s) and/or Data Source(s)

I expected to have: aws_ec2_tag solve this but it could also create something like aws_lb_tag

Potential Terraform Configuration

resource "aws_lb_tag" "ec2_lb_environment" {  
  resource_id = data.aws_lb.arn
  key         = "Environment"
  value       = "staging"
}

or

resource "aws_ec2_tag" "ec2_lb_environment" {  
  resource_id = data.aws_lb.arn
  key         = "Environment"
  value       = "staging"
}

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue