Skip to content

Commit

Permalink
Add output of VPC subnet tagging to resourcegroupstaggingapi
Browse files Browse the repository at this point in the history
  • Loading branch information
silv-io committed Sep 23, 2024
1 parent 375eb58 commit 03a1bf5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion moto/resourcegroupstaggingapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,12 +663,27 @@ def format_tag_keys(
"ResourceARN": f"arn:{self.partition}:ec2:{self.region_name}:{self.account_id}:vpc/{vpc.id}",
"Tags": tags,
}
# VPC Subnet
if (
not resource_type_filters
or "ec2" in resource_type_filters
or "ec2:subnet" in resource_type_filters
):
for subnet in self.ec2_backend.subnets.values():
for subnet_id in subnet.keys():
tags = format_tags(self.ec2_backend.tags.get(subnet_id, {}))
if not tags or not tag_filter(tags):
continue
yield {
"ResourceARN": f"arn:{self.partition}:ec2:{self.region_name}:{self.account_id}:subnet/{subnet_id}",
"Tags": tags,
}

# VPC Customer Gateway
# VPC DHCP Option Set
# VPC Internet Gateway
# VPC Network ACL
# VPC Route Table
# VPC Subnet
# VPC Virtual Private Gateway
# VPC VPN Connection

Expand Down

0 comments on commit 03a1bf5

Please sign in to comment.