-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Make the syntax work:
x-vpc:
Lookup:
VpcId:
Identifier: vpc-xxx
Output (if there are no VPC with tags in whole AWS acct):
2025-03-25 11:39:47 [ INFO] Processing x-vpc
Traceback (most recent call last):
File "/Users/user/.local/bin/compose-x", line 8, in <module>
sys.exit(main())
~~~~^^
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/cli.py", line 213, in main
root_stack = generate_full_template(settings)
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/ecs_composex.py", line 257, in generate_full_template
add_x_resources(settings)
~~~~~~~~~~~~~~~^^^^^^^^^^
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/ecs_composex.py", line 181, in add_x_resources
x_stack = module.stack_class(
module.mapping_key,
...<2 lines>...
Parameters={ROOT_STACK_NAME.title: Ref(AWS_STACK_NAME)},
)
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/vpc/vpc_stack.py", line 371, in __init__
self.vpc_resource.lookup_vpc()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/vpc/vpc_stack.py", line 173, in lookup_vpc
vpc_settings = lookup_x_vpc_settings(self)
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/vpc/vpc_aws.py", line 106, in lookup_x_vpc_settings
vpc_arn = find_aws_resource_arn_from_tags_api(
vpc_resource.lookup[VPC_ID.title],
...<2 lines>...
allow_multi=False,
)
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/common/aws.py", line 237, in find_aws_resource_arn_from_tags_api
return handle_search_results(
arns, name, res_types, aws_resource_search, allow_multi=allow_multi
)
File "/Users/user/.local/pipx/venvs/ecs-composex/lib/python3.13/site-packages/ecs_composex/common/aws.py", line 176, in handle_search_results
raise LookupError(
...<3 lines>...
)
LookupError: ('No resources were found with the provided tags and information', None, 'ec2:vpc')
Output (if there are two tagged VPCs but using "Identifier"):
LookupError: ('More than one resource None:ec2:vpc was found with the current tags.Found', ['arn:aws:ec2:us-east-2:123:vpc/vpc-xxx', 'arn:aws:ec2:us-east-2:123:vpc/vpc-yyy'])
Not sure if this is a bug or feature. Docs are unclear.
Lookups docs suggest this should be possible:
Identifier | The Service resource ID (i.e. vpc-abcd1234)
x-vpc docs nor test cases ever mention this field
Reasoning:
- Network resources shared via RAM shares do not have Tags by default (unless some effort is made), ID/Arn lookup would be great.
Describe the solution you'd like
Allow ID/ARN lookup
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
mikejgray
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request