[Enhancement]: Allow ARN as identifier for aws_ec2_tag resource #39445
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
needs-triage
Waiting for first response or review from a maintainer.
service/ec2
Issues and PRs that pertain to the ec2 service.
Description
TL;DR: I have 2 AWS accounts, one creating resources and tagging them then sharing them to the other account using AWS RAM and generating a file containing maps of tags per resource's ARN. But
aws_ec2_tag
do not accept resource ARN (it needs resource ID). Please add support for ARN.I would like to suggest improvement on how
aws_ec2_tag
is given instruction on which resource to tag. I think it should accept ARN identifiers.My use-case is:
Network team in charge of the AWS infrastructure creates some resources in their "network" AWS account. They also and tag and share them with a second "application" account (for the Application team) using AWS RAM/Resource Access Manager.
Because tags are not shared from one account to another, Application team need to (re-)tag those same resources.
So network team also generates a (YAML) file using the
aws_resourcegroupstaggingapi_resources
data source where each key is the ARN of a resource and the value is a map of the tags applied to said resource:Example of file:
The best (only) way to re-tag thoses ram-obtained resources is the
aws_ec2_tag
, but it only accepts IDs, not ARN.On the other side, the
aws_resourcegroupstaggingapi
data source only exports ARNs, not IDs.If I try to pass an ARN to
aws_ec2_tag
asresource_id
argument, it fails with:Affected Resource(s) and/or Data Source(s)
aws_ec2_tag
Potential Terraform Configuration
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: