Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-e --exclude does not exclude resources #398

Open
MajorRockStar opened this issue Sep 20, 2023 · 1 comment
Open

-e --exclude does not exclude resources #398

MajorRockStar opened this issue Sep 20, 2023 · 1 comment
Assignees
Labels
Type: Bug Something isn't working

Comments

@MajorRockStar
Copy link

MajorRockStar commented Sep 20, 2023

General information:
Using -e or --exclude does not exclude the resources. I have tried with individual resources and multiple resources.

  • Operating System: MacOS Ventura 13.5.2
  • Terracognita version / tag: v.0.8.4
  • Did you build Terracognita from sources or did you use the Docker image: No

Describe the bug:

Running the following command but the resources are still included.

terracognita aws --aws-access-key ${AWS_ACCESS_KEY_ID} --aws-default-region eu-west-2 --aws-secret-access-key ${AWS_SECRET_ACCESS_KEY} --tfstate services/services.tfstate --hcl services --exclude aws_lb -e aws_lb_cookie_stickiness_policy -e aws_lb_listener -e aws_lb_listener_certificate -e aws_lb_listener_rule -e aws_lb_target_group -e aws_lb_target_group_attachment

The command then errors as follows.

Starting Terracognita with version v0.8.4
Importing with filters:
Tags: [],
Include: [],
Exclude: [aws_lb aws_lb_cookie_stickiness_policy aws_lb_listener aws_lb_listener_certificate aws_lb_listener_rule aws_lb_target_group aws_lb_target_group_attachment],
Targets: [],
Importing aws_instance [25/25] Done!
Importing aws_alb [2/2] Done!
Importing aws_alb_listener [2/2] Done!
Error: could not import from aws: error while reading from resource "aws_alb_listener_certificate": ValidationError: This operation does not support Gateway Load Balancer Listeners.
status code: 400, request id: 19bba2e3-bced-4818-9e19-49afcc7da3b6

Log message

Error: could not import from aws: error while reading from resource "aws_alb_listener_certificate": ValidationError: This operation does not support Gateway Load Balancer Listeners.
status code: 400, request id: 19bba2e3-bced-4818-9e19-49afcc7da3b6

Additional context

@MajorRockStar MajorRockStar added the Type: Bug Something isn't working label Sep 20, 2023
@xescugc
Copy link
Member

xescugc commented Sep 27, 2023

Ok so apart from the actual error

Error: could not import from aws: error while reading from resource "aws_alb_listener_certificate": ValidationError: This operation does not support Gateway Load Balancer Listeners.
status code: 400, request id: 19bba2e3-bced-4818-9e19-49afcc7da3b6

I'm guessing that you say it does not exclude because you excluded lb and it imported alb? Ok this is a bug and i'll fix it, the issues is that lb and alb are aliases but when excluding we are not checking that, we have the information of some of the aliases so we can remap it :).

@xescugc xescugc self-assigned this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants