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

azure & gcp: do not stop when service not enable, 404 or not enough permission #247

Closed
talset opened this issue Sep 28, 2021 · 3 comments · Fixed by #257
Closed

azure & gcp: do not stop when service not enable, 404 or not enough permission #247

talset opened this issue Sep 28, 2021 · 3 comments · Fixed by #257
Labels
Feature roadmap feature

Comments

@talset
Copy link
Member

talset commented Sep 28, 2021

Abstract

With a valid credential, terracognita should import everything possible and not stop for

  • a missing permission
  • 404/403 error
  • service not enabled

Errors should be displayed (at least in verbose)

For example with azure azurerm_storage_queue

could not import from Azure: error while reading from resource "azurerm_storage_queue": unable to list storage queues from reader: unable to list storage.ListQueue from Azure APIs: storage.QueueClient#List: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ParentResourceNotFound" Message="Can not perform requested operation on nested resource. Parent resource 'cycloidlabtfstate' not found."

Example with gcp google_compute_instance

 error while reading from resource "google_compute_instance": unable to list instances from reader: unable to get zones in region: unable to fetch information for region europe-west1: googleapi: Error 403: Compute Engine API has not been used in project XXXXXXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/compute.googleapis.com/overview?project=XXXXXXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured

Proposal

Implementation

Open issues (if applicable)

@talset talset added the Feature roadmap feature label Sep 28, 2021
@xescugc
Copy link
Member

xescugc commented Oct 5, 2021

We should add a logic similar to the aws one https://github.com/cycloidio/terracognita/blob/master/aws/provider.go#L92 for those providers.

@majorku5anagi
Copy link

majorku5anagi commented Jan 25, 2022

@talset I'm running into same issue. Is there an alternative way in which I can somehow get around these issues? All required flags are correctly defined and it breaks with azurerm_storage_queue.

EDIT: I have managed to make a workaround by excluding all resources starting with azurerm_storage_*. Neverthless, the issue is there

@talset
Copy link
Member Author

talset commented Feb 8, 2022

@talset I'm running into same issue. Is there an alternative way in which I can somehow get around these issues? All required flags are correctly defined and it breaks with azurerm_storage_queue.

EDIT: I have managed to make a workaround by excluding all resources starting with azurerm_storage_*. Neverthless, the issue is there

Sorry to be late, I planned to work on it this week ;)

talset added a commit that referenced this issue Feb 9, 2022
we filter the error from Azure and return a custom error
type if it's an error that we want to skip
azure seems to not return error interface. Use regex
to get Code
talset added a commit that referenced this issue Feb 10, 2022
we filter the error from Azure and return a custom error
type if it's an error that we want to skip
talset added a commit that referenced this issue Mar 9, 2022
azurerm&gcp: do not stop when service not enable fix #247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature roadmap feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants