Skip to content

Commit

Permalink
ResourceGroupTagging: Fix filtering for lambda functions with "lambda…
Browse files Browse the repository at this point in the history
…:function" (#7690)
  • Loading branch information
kirberich authored May 14, 2024
1 parent 421ab40 commit 792f7a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion moto/resourcegroupstaggingapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,11 @@ def format_tag_keys(
# VPC VPN Connection

# Lambda Instance
if not resource_type_filters or "lambda" in resource_type_filters:
if (
not resource_type_filters
or "lambda" in resource_type_filters
or "lambda:function" in resource_type_filters
):
for f in self.lambda_backend.list_functions():
tags = format_tags(f.tags)
if not tags or not tag_filter(tags):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ def assert_response(response, expected_arns):
resp = rtapi.get_resources(ResourceTypeFilters=["lambda"])
assert_response(resp, [circle_arn, rectangle_arn])

resp = rtapi.get_resources(ResourceTypeFilters=["lambda:function"])
assert_response(resp, [circle_arn, rectangle_arn])

resp = rtapi.get_resources(TagFilters=[{"Key": "Color", "Values": ["green"]}])
assert_response(resp, [circle_arn, rectangle_arn])

Expand Down

0 comments on commit 792f7a3

Please sign in to comment.