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.78k stars 9.13k forks source link

Add support for tag maps to aws_ec2_tag resource #25739

Open ecout opened 2 years ago

ecout commented 2 years ago

Community Note

Description

Please add support for tag map as input besides key,value pairs. This resource is great for compensating for the AWS RAM Permision not allowing ec2:Describe Tags when sharing subnets, as described here: https://discuss.hashicorp.com/t/aws-ram-not-passing-through-tags/12776/5 But given the documentation of this resource, the proposed use case in it: compensating for RAM lack of permissions for tag sharing of subnets across accounts, this resource is lacking support for tag maps as inputs. A valid use cases is to copy over all tags from the original account sharing resources with AWS RAM into the destination account. Using key and name one by one doesn't fit the format of how the subnet Data Sources store their tags(as a map). A 1 to 1 match where the entire tags attribute of the aws_subnet resource in the origin account is used as input for aws_ec2_tags to complete the tag transfer process would be best.

New or Affected Resource(s)

*aws_ec2_tag

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

ayoh1 commented 1 year ago

+1 here... accepting map would help a lot when copying tags from root account to all the shared ones...

btw @ecout did you find a module or something that helps with this? getting the list of shared resources and apply tags